deepseek-harness/docs
Tianyi Cui f58b031465 fix(agent): close the window-2 early-whenIdle race + sync cancellation RFC docs (review)
A reviewer found that window 2 (a cancel from a synchronous agent/status('running')
listener) had the same early-whenIdle() race that window 1 already guards: it
unconditionally `setStatus('idle')` + continue, which settles `whenIdle()`
waiters — so if the running listener cancels AND queues replacement work, the
waiter resolves while the replacement is still queued-and-unrun (the next
iteration runs it later, but the caller already observed quiescence).

Mirror window 1: after clearing the marker, only `setStatus('idle')` when
nothing new is queued; otherwise fall through to run the queued replacement
(status is already `running`), so `whenIdle()` resolves on that turn's
running→idle. Regression test reproduces the reviewer's interleaving (running
listener cancels A, sends B; whenIdle() resolves only after B ran).

Also syncs the cancellation contract in the two ACP RFCs that describe the live
behavior: `session/cancel` is the queue-aware `agent.cancel()` (drops an
about-to-start turn), not the old best-effort `agent.abort()` pre-step
limitation.
2026-06-20 12:57:32 +08:00
..
cookbook Merge remote-tracking branch 'origin/master' into feat/acp-2-bridge 2026-06-18 03:31:04 +08:00
postmortem fix(acp): address Codex review — strict ctx.get, correct fiber-ownership doc + test 2026-06-18 03:48:33 +08:00
rfc fix(agent): close the window-2 early-whenIdle race + sync cancellation RFC docs (review) 2026-06-20 12:57:32 +08:00
AGENTS.md docs: unify ADR/RFC trees into one lifecycle-organized RFC tree 2026-06-18 02:18:24 +08:00
architecture.md feat(agent): add queue-aware Agent.cancel() primitive 2026-06-20 04:51:32 +08:00
development.md Merge remote-tracking branch 'origin/master' into feat/acp-snapshot-tests 2026-06-19 10:03:04 +08:00
module-graph.md refactor(examples): extract reusable logic into tested packages 2026-06-19 12:42:28 +08:00