Repository navigation
Stop worker-finished notices from inviting thread_status polling (#1436) - #1582
Conversation
The notice footer claimed "thread_status has full details", but thread_status only echoes the reply line, so leads called it in loops (164 useless calls in one session). The footer now tells the lead to review the worker's branch with git, and the orchestrator instructions say to end the turn after fork/send instead of polling. The renderer still folds notices stored with the old footer. Ported from a local-only merge that never reached GitHub. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50ce256677
ℹ️ 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".
| "its last assistant reply. Runs are asynchronous. After thread_fork or " + | ||
| "thread_send, end your turn: each worker's finish (done or failed) wakes you " + | ||
| "with a notice quoting its last reply. Do not poll thread_status, sleep, " + |
There was a problem hiding this comment.
End only after sends that guarantee a wake-up
When thread_send returns refused/undeliverable, or successfully targets an ordinary thread, no completion notice wakes the caller: thread_send does not establish handoffFrom, and queueOrchNotice only wakes the parent of an orchWorker. The unconditional instruction to end the turn therefore strands these workflows until the user manually prompts the lead again; condition it on dispatching an owned worker that will actually wake the caller.
Useful? React with 👍 / 👎.
| const NOTICE_FOOTER_LINE = | ||
| "\nContinue orchestrating. thread_status only repeats the reply line above, so do not call it for a finished worker; review its branch with git (log/diff against your branch) before reporting."; |
There was a problem hiding this comment.
Preserve failure diagnostics before forbidding thread_status
For a worker finishing with status === "failed", queueOrchNotice includes only the first assistant-reply line and omits thread.lastError, whereas thread_status explicitly returns that stored or recovered error. Telling the lead that the tool only repeats the notice and must not be called can therefore hide the sole diagnostic for a failed run; include lastError in failure notices or retain a failure-specific status lookup.
Useful? React with 👍 / 👎.
| // #1436: thread_status only echoes the reply line; never invite polling. | ||
| // src/workerActivity.ts NOTICE_FOOTER must match this exactly to fold. | ||
| return headed + NOTICE_FOOTER_LINE; |
There was a problem hiding this comment.
Restrict the worker-specific footer to worker completions
noticePrompt is also used for arbitrary deliverNotice traffic such as [peer from ...] and crew-task messages, so every such wake-up now directs the receiver to review “its branch” and report a finished worker even though no worker completion or branch is identified. Since peer_send can target any same-project thread, this can derail normal peer communication; append this footer only to actual worker-finished notices and keep a generic continuation for peer and crew notices.
Useful? React with 👍 / 👎.
Fixes #1436. That issue was closed, but its fix only ever landed as a local-only merge and never reached GitHub. This is a port onto current main.
runnerHelpers.noticePromptno longer appends the false "thread_status has full details" footer, which led orchestrators into 164 uselessthread_statuscalls in one session. The new footer says the tool only repeats the reply line, and tells the lead to review the worker's branch with git.thread_statusdescription now say: end your turn after fork/send, and don't poll, sleep or start watchers.src/workerActivity.tsfolds notices with the new footer and the legacy one, so notices already stored in transcripts keep folding.store-migrate's frozen legacy string is unchanged.Tests: the crew-notices and orch-server assertions are updated. threadView gains a guard that the runner's footer matches the fold matcher, plus a legacy-footer fold test. The full electron suite (4539/4539) and the renderer suite (2943/2943) pass with this combined with #1435 and #1439 in a throwaway merge.
🤖 Generated with Claude Code