Repository navigation
🤖 fix: send the turn-end TODO nudge only after user turns - #7503
Conversation
A transcript audit of 571 nudges (20 workspaces) found that machine wakes (monitor matches, sub-agent reports, heartbeats, peer messages) caused about 90% of nudges. Each wake counts as its own user turn, so coordinator workspaces got one nudge per wake. In 106 of 118 judged nudges the agent only restated that its open items wait on someone. - AgentSession records whether a message the user sent started the turn (streamStartedByUserMessage). Compaction requests and their follow-ups keep the previous value. The nudge runs only for those turns. - The prompt now says not to start an item the agent said waits on something: two judged nudges started a step against the agent's own stated order. - The #7027 prompt text still renders as the compact current nudge row, alone and joined with the status page nudge (#7486). --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high` • Cost: `$7.00`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high costs=7.00 -->
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: 4a8b7a16d7
ℹ️ 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".
🟢 e2e stories (Haiku): 14 passed27 agent steps · 12 replayed from cache · 15 model calls · 45.8k tokens (28% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 28s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 7.9k tokens (33% cached) All 3 tests in 3 files
e2e 0.20.0 · 28.6s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.6s · 2 targets (web, phone) · run artifacts |
Codex review on #7503: resumeStream starts a stream without a new message, so the prompt-free resume after a sub-agent report (taskService) kept the earlier user turn's origin and still got the TODO nudge. An automatic resume that is not a retry now records a machine turn. Auto-retries and manual resumes (Retry, an answered question) keep the current turn's origin. _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high` • Cost: `$11.74`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high costs=11.74 -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a30d504ccf
ℹ️ 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".
…TODO nudge Codex review on #7503: every compaction request kept the previous turn origin, so a heartbeat that compacts after a user turn kept "user" through its follow-up and still got the TODO nudge. Only an auto-compaction request (on-send or mid-stream) continues the current turn now. An idle-compaction request (idle or heartbeat) is a fresh synthetic send: a machine turn. _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high` • Cost: `$11.74`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high costs=11.74 -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95c860b3df
ℹ️ 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".
…ODO nudge Codex review on #7503 found two more ways the inherited turn origin went wrong: an automatic send that is not synthetic (a task brief) counted as a user turn, and a wake compacted on send passed a stale user origin on through its auto-compaction request. Instead of inheriting the earlier origin across compaction, a send now starts a user turn only when it is manual and not synthetic. Compaction requests and follow-ups are automatic, so a user turn that compacts loses its one nudge, which fails closed. _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high` • Cost: `$11.74`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high costs=11.74 -->
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
The status page nudge classifier keeps both variants and, like main, accepts any current TODO nudge text (earlier ones included) before either variant.
Summary
The turn-end TODO nudge now fires only after a turn that a message the user sent started. Machine wakes (monitor matches, sub-agent reports, heartbeats, peer messages, goal continuations) no longer get it. The nudge prompt also tells the agent not to start an item that it said waits on something.
Background
A local transcript audit (2026-10-25) read every nudge in recent
~/.xum/sessionshistories: 571 nudges in 20 workspaces since #6720."No-op" means the agent only restated that its open items wait on someone. "Harmful" means the nudged turn started a step that its own previous message said waits on a review or a merge. This PR keeps the nudge for user turns, where it still does useful work in about 1 of 5 cases. We will re-measure in a few days and then decide whether to keep or remove the feature.
Implementation
streamStartedByUserMessage(todoTurnEndNudge.ts) decides, when a sent message starts its stream, whether a message the user sent started the turn: a manual send that is not synthetic. Machine wakes, goal continuations, task briefs, and compaction requests and follow-ups are automatic, so they start machine turns.resumedStreamStartedByUserMessage): an automatic resume that is not a retry, such as the prompt-free resume after a sub-agent report, is a machine turn. Auto-retries and manual resumes (Retry, an answered question) keep the current turn's origin.AgentSessionrecords the value inturnStartedByUserMessage(retries keep it) and passes it throughStopContinuationProvenance.readTurnEndNudgesadds the TODO nudge only when it is true. The status page nudge (🤖 feat: nudge agents to publish and update the Agent interface status page #7486) is unchanged.agentInitiated: persisted heartbeat rows do not carry it.Validation
[mock:todo-nudge](web, reload and workspace switching, Stop and typed input during the nudge, phone), Sonnet 5.5 explorers on the mock app AI, $0.93 + $0.79 at list price. The explorers reported no confirmed bug. Triage of their claims found the joined-row classifier defect above, which this PR fixes.Follow-ups
Risks
Low. The change only removes nudges. The worst case is a user turn that misses its nudge (after compaction, or after a Xum restart), which is the behavior before #6720.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$11.74