Repository navigation
fix(deepseek-harness): keep fault cleanup failures from crashing the Host - #935
Conversation
…Host A connection fault starts adapter cleanup that nobody awaits. When a session could not confirm its native work stopped, that cleanup rejected unhandled and Node exited the shared Host, restarting Codex. Mark the stored cleanup handled; close() still reports the failure.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Summary
DeepSeek Harness 的连接出故障时,Adapter 在
#fail()里启动清理(#performClose(failure)),把这个 Promise 存进#closePromise,但当时没有任何调用方等待它。如果某个 Session 在故障时可能还有原生执行(#faultMayHaveNativeWork),它的close()会以 “native execution stop was not confirmed before the Session fault” 拒绝,#performClose再把这个失败抛出。这个拒绝没有处理者,Node 按默认行为让共享 Host 以 code 1 退出,Codex Desktop 随之重启,其他 Harness 正在进行的任务也被打断。实际日志(Host Runtime):
修法:故障路径存下清理 Promise 时把它标记为已处理。失败仍保存在
#closePromise中,之后调用close()的一方照常收到这个拒绝,不改变清理顺序和错误语义。Test plan
close()仍以该失败拒绝。修复前该用例失败(unhandledRejection被触发)。npx vitest run --config tests/vitest.config.js packages/adapters/deepseek-harness/test/modern/deepseek-harness-adapter.test.ts:73 个用例通过。