Skip to content

🤖 fix: keep a workflow-owned reported leaf while the user's queued follow-up is being prepared - #8115

Open
ThomasK33 wants to merge 2 commits into
mainfrom
fix/probe-follow-ups
Open

ThomasK33 wants to merge 2 commits into
mainfrom
fix/probe-follow-ups

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

The cleanup of a reported workflow task no longer removes the task while the user's queued follow-up is still being prepared. Before, the check for unsent user input saw the queue and the held inputs, but not a message that had left the queue and not yet published. The cleanup then went on to remove the workspace, which disposes the session that holds the message. This PR also corrects one field doc and adds three test rows that #8076 left open.

Background

#8076 let a stream's decision skip the plan-like probe where its answer changes nothing. Reviewing it left three items:

  1. The ChildStreamEndState.isPlanLike doc said a reported row's final response never reads the probe. A final response that carries a propose_plan result still does (probeDecidesReport).
  2. The "still waits for the plan-like probe" rows cover final responses on running, awaiting_report and interrupted rows. A row that is queued, starting or has no status also reads the probe, and no test said so.
  3. A workflow-owned reported task is a leaf that the cleanup removes. A follow-up queued behind its last stream runs after the decision resolves nonreport, while the row still reads reported. AgentSession.hasPendingUserInput, which the cleanup asks, did not count a manual send that is being prepared. userInputBlocksGoalAdvancement already counted it with its own extra clause.

Implementation

  • agentSession.ts: hasPendingUserInput() also returns true while a manual send sits in preparingQueuedInput. userInputBlocksGoalAdvancement() now delegates to it (the same condition as before).
  • taskService.ts: comments only. The isPlanLike field doc and the comment above probeDecidesReport now state why a propose_plan result reads the probe: it decides whether the handler resolves the decision now.
  • taskService.reportDecisionHold.test.ts: three rows for a final response on a queued, starting and status-less row (the helper's statusAtEnd accepts null to remove the status), and one real-host test of the cleanup race.

Validation

  • Race test. It holds the report cleanup at its entry, holds the follow-up's stream start so the message is preparing (hasQueuedMessages is false), then releases the cleanup. It asserts that workspaceService.remove is never called and that the row survives the follow-up's dispatch. With the hasPendingUserInput change reverted, both cases (plan, explore) fail with Expected: 0, Received: 1 on the remove call count.
  • Status rows. I mutated the read rule in readChildStreamEndReport. Reading the probe only for running, awaiting_report and interrupted rows turns the three new rows red. Requiring a status turns the status-less row red. Reading it only for running rows turns five rows red (the three new ones, awaiting_report and interrupted).
  • Direct send. In a scratch repro (not committed), a direct send held in preparation on the same kind of leaf made the cleanup's remove() wait, and the row stayed while the send prepared. The lifecycle lock covers that path, so this PR changes only the queued path.

Risks

Low. One behavior change: a workflow-owned reported leaf whose cleanup runs while the user's queued follow-up is preparing now stays until the next cleanup trigger. The follow-up's own report is that trigger. This is the same trade-off the code already accepts for queued and held input. hasPendingUserInput has two other readers. The goal-advancement check keeps its condition. The goal-continuation eligibility flag hasQueuedMessages can now read true while a manual send is preparing, and that path was already busy through isBusy() (queue-dispatched sends set PREPARING before dispatch).


Generated with xum • Model: anthropic:claude-sonnet-5-5 • Thinking: xhigh • Cost: $56.01

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T18:06:09.273079Z b6e5267 Manual request
🔒 Security Review ✅ Completed 2026-11-10T18:08:01.222037Z b6e5267 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Head: b6e5267

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: b6e5267f7f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: b6e5267f7f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

22 agent steps · 7 replayed from cache · 15 model calls · 47.1k tokens (25% cached)
Spend: $0.09 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 1 step · 1 call 6.1s
🟢 a chat survives a restart of the server 1 step · 1 call 6.1s
🟢 compaction.e2e.ts · 1 passed 1 step · 1 call 5.0s
🟢 /compact replaces the old chat with a summary 1 step · 1 call 5.0s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 11.1s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 11.1s
🟢 settingsRoundTrip.e2e.ts · 1 passed 2 steps · 1 call 9.4s
🟢 a chat survives trips through Settings 2 steps · 1 call 9.4s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 5.1s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 5.1s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 3.0s
🟢 the agent opens the playground workspace 2 steps · 1 call 3.0s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 7.4s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 7.4s
🟢 todoNudge.e2e.ts · 1 passed 1 step · 1 call 3.2s
🟢 the agent finishes open TODO items after the turn-end nudge 1 step · 1 call 3.2s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 23.2s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 3.8s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 4.1s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 4.7s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.8s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 3.4s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 3.3s

e2e 0.20.0 · 1m 17s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 7.9k tokens (22% cached)
Spend: $0.02 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 6.9s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 6.9s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 6.1s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 6.1s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 5.9s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 5.9s

e2e 0.20.0 · 21.5s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 6.5s · 2 targets (web, phone) · run artifacts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant