mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
Cordis effect disposers are single-shot but not await-idempotent: when the owning fiber's unload invokes the raw wrapper first, a concurrent handle.dispose() got an immediate undefined and resolved before teardown finished — violating the driver's stated one-boundary contract (Codex implementation-review finding). The teardown chain's FIRST-yielded (so disposed-last) disposer now resolves a shared completion promise; the handle path awaits it after the wrapper, so tool-finally, parent-teardown, and owner-unload all observe the same fully-torn-down state. Regression test: owner unload begins first, concurrent handle.dispose still awaits unregistration + session detach.