Repository navigation
Open
Description
Monkey test 2026-11-15, finding A10 (P0). A fix was merged in #255 and withdrawn before the release by #256. Parked until after the release.
Symptom
- A turn runs (window
mt1115-win, turnturn_3bdf2aa1…_173); a second message is queued behind it. - The person presses Stop.
- The Chat shows only "Finished thinking". The agent's question ("The drawing tool rejects
señora-müller-coach… May I … recreate the character … under a tool-compatible ID?") is not shown. - The status bar says "1 waiting for you".
- Send/Enter seem to do nothing. Only Reload Window shows the question, and the queued message is then gone.
Root cause (pine-dev gateway log + Studio log; the clocks agree within 15 ms)
| UTC | what |
|---|---|
| 10:13:51.420 | GET agent/turns/…_173 returns after 9375 ms (under the 10 s long poll): Pine ended the turn needs_input |
| 10:13:52.354 | the person's Stop, 0.93 s later. The Studio records a turn's end only after the grace, the event drain and the collection, so it still records running, and cancelTurn sends a cancel |
| 10:13:53.294 | POST agent/cancel 202. The turn is needs_input, so Pine's CancelTurn closes the question (broker.go cancelQuestion, which appends a terminal result "question canceled") |
| 10:13:53.887 | the follower records needs_input from the read it took before the cancel (composeTurnEnding) |
- Two writers, and the stale one wins. The follower records the ending from an earlier read, and nothing records what the Stop's cancel did. The Studio says "waiting for you"; Pine has nothing waiting.
- The question is never shown (Code-OSS, by design). A cancelled request drops all later progress (chatServiceImpl.ts
progressCallback,token.isCancellationRequested), and the extension API cannot push new history into an open session. Reload re-provides it. - Send "does nothing" (inferred, not observed).
- After a cancelled request, Code-OSS keeps the queue and does not run it (
shouldProcessPending = … && !token.isCancellationRequested). - A plain Send with a queued request awaits "You already have pending requests: Keep / Remove". It is a native macOS sheet (
window.dialogStyle: native), which the CDP-driven monkey test neither saw nor answered.
- After a cancelled request, Code-OSS keeps the queue and does not run it (
- The queue is lost on Reload (Code-OSS): Code-OSS (upstream): a contributed session's queued messages are dropped on Reload Window #253.
Plan after the release: one writer, as Claude Agent SDK and codex-rs do it
Precedents:
- codex-rs: an interrupt and a turn's end are decided at one point, and the turn's own path emits its one terminal event (
TurnAborted/TurnComplete, core/src/tasks/mod.rs). - codex-rs app-server: sets the status once, from that event.
- Claude Agent SDK: the interrupted turn's result arrives in the ordered stream (
interrupt(),SDKControlInterruptResponse).
Sketch, no sequence compare:
- Stop only sends the cancel. It records nothing.
- The follower is the one writer of a turn's ending, from Pine's ordered events. Pine's log carries every terminal transition of a turn:
- the run's terminal
result; - then, if a cancel closes the question, a second terminal
result"question canceled" (broker.gocancelQuestion).
- the run's terminal
- Following does not end at
needs_input. It ends when the question is answered (the next turn) or a later terminal result for the turn arrives. As codex-rs treats a turn waiting for approval, the question is part of the turn until settled. - What it needs:
PineEventforresultkeeps the terminal state and reason (todaysdkPort.tsmaps only the summary text);- the follower keeps the event stream open past the grace while a question waits;
followPineTurnfollows a Chat recordedneeds_input;tendIdlestays where the follower writes.
- Open questions:
- How a long-waiting question's stream is held across reconnects and reloads (the existing reconnect loop and the start's resume).
- Whether Stop on a recorded question (it closes it, Pine's contract) is wanted, or is a no-op as codex-rs app-server's "no active turn to interrupt".
Workaround until then
- After a Stop that shows only "Finished thinking", run Developer: Reload Window. The Chat shows the agent's question from its history, and a new message goes as a new run.
- Copy any queued message first. Code-OSS drops a contributed session's queue on Reload (Code-OSS (upstream): a contributed session's queued messages are dropped on Reload Window #253).
Related
- A Stop during a run whose response was lost leaves the turn running, and it may spend money #193: the lost-response family.
- Code-OSS (upstream): a contributed session's queued messages are dropped on Reload Window #253: queue lost on Reload.
- Local note for Pine's owner,
~/RunVid/exports/2026-11-15-pine-cancel-gap.md: a 202 cancel that loses to the run's own result leaves the question open.
Metadata
Metadata
Assignees
Labels
No labels
Activity