SessionDrainOptions
이 콘텐츠는 아직 번역되지 않았습니다.
AgentSession.drain() 的选项:timeoutMs 观察预算(缺省 30 秒;Infinity = 不限)、signal 只取消
观察者不取消共享工作、flushStore 是否顺带调用借用 store 的全局 flush、retryPersistence 是否
重试此前失败的持久化提交、force 观察预算耗尽后是否强制释放自有资源(见字段说明)。
flushStore?
Section titled “flushStore?”optional flushStore?: boolean;force?
Section titled “force?”optional force?: boolean;已关闭会话的收尾观察在 timeoutMs 内未确认(适配器违约:settle 回 pending>0 / 超时,或收尾仍在飞)时,
强制释放自有资源(会话级 MCP host 等)并以结构化失败(*_settlement_incomplete / *_settlement_forced)
交付,再以同一预算等待释放完成。缺省 false = 只观察不强制(既有语义:未确认即不关自有资源)。
对未关闭的会话无效。
retryPersistence?
Section titled “retryPersistence?”optional retryPersistence?: boolean;signal?
Section titled “signal?”optional signal?: any;timeoutMs?
Section titled “timeoutMs?”optional timeoutMs?: number;이 페이지가 도움이 되었나요?
피드백 감사합니다. 이 문서를 계속 개선하겠습니다.