CompactResult
이 콘텐츠는 아직 번역되지 않았습니다.
type CompactResult = | { checkpointId?: string; compactionId: string; removedRange: [number, number]; status: "compacted";} | { reason: "turn_running" | "empty_history" | "not_configured" | "hook_blocked"; status: "rejected";} | { checkpointId?: string; reason: CompactionFailureReason; status: "failed";};compact() 结果联合(compacted / rejected / failed;failed 形亦携失败前已落的快照 id)
{ checkpointId?: string; compactionId: string; removedRange: [number, number]; status: "compacted";}checkpointId?
Section titled “checkpointId?”optional checkpointId?: string;压缩前快照 id(落了才在场)
compactionId
Section titled “compactionId”compactionId: string;压缩执行 id(与 session.compacted.compactionId / 摘要 meta.compactionId 同源)
removedRange
Section titled “removedRange”removedRange: [number, number];被移除消息的 index 闭区间(压缩前坐标)
status
Section titled “status”status: "compacted";{ reason: "turn_running" | "empty_history" | "not_configured" | "hook_blocked"; status: "rejected";}reason
Section titled “reason”reason: "turn_running" | "empty_history" | "not_configured" | "hook_blocked";turn_running = 运行中(不排队,await idle() 后重试)/ empty_history = 历史为空 / not_configured = compaction:false 或上下文窗口未知 / hook_blocked = PreCompact hook 否决(SDK 无查询 hooks 面,保留为联合成员)
status
Section titled “status”status: "rejected";{ checkpointId?: string; reason: CompactionFailureReason; status: "failed";}checkpointId?
Section titled “checkpointId?”optional checkpointId?: string;失败前已落的快照不回滚,id 随结果交付
reason
Section titled “reason”reason: CompactionFailureReason;kernel 压缩失败原因(nothing_to_compact / model_error / before_compact_failed …)
status
Section titled “status”status: "failed";이 페이지가 도움이 되었나요?
피드백 감사합니다. 이 문서를 계속 개선하겠습니다.