Repository navigation
feat(queue): tell the sender whether a busy-time message steered the running turn - #160405
kiranvk-2011 wants to merge 10 commits into
Conversation
…running turn Adds opt-in messages.queue.steerReceipts. In steer mode, each message that arrives during an active run gets a standalone reply quoting it: "🦞🛞 Current run steered with your new message." once the runtime has taken it into the turn, or a "⏳" notice when it falls back to a followup. Receipts are routed replies (mirror off), never the message's terminal reply, so a queued message still gets its real answer. Room events stay silent. Refs openclaw#25222 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesAdds optional quoted channel receipts reporting successful steering, queue fallback, overflow, and later eviction. Example: Telegram message 71 arrives in forum topic 35 during an active turn, with messages.queue.steerReceipts enabled.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR contains meaningful, distinct channel feedback work that current main does not provide, but its new opt-in setting needs an owner decision. Reviewed head: Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherInbound channel messages enter active-turn steering or the followup queue; the added receipt helper routes those outcomes back through the existing channel reply owner. flowchart TD
A[Channel message] --> B[Steering adoption]
B --> C[Active runtime]
B --> D[Followup queue]
C --> E[Receipt helper]
D --> E
E --> F[Reply routing]
F --> G[Quoted channel receipt]
Technical reviewBest possible solution: If approved, attach opt-in receipts to the current session-controller and queue outcomes through existing reply routing while preserving quiet defaults. Do we have a high-confidence way to reproduce the issue? Source confirms that automatic fallback is intentionally quiet; this PR proposes additional feedback rather than repairing a demonstrated violation of that contract. Is this the best way to solve the issue? The patch uses existing steering, queue-disposition, and routing owners appropriately; accepting its new setting is a product choice, and conflict resolution must retain current session-controller ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eee7a1bd5264. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +206, Tests +269, Docs +30, Generated +1. Total +506 across 14 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (9 earlier review cycles; latest 8 shown)
Reviewed November 24, 2026, 4:41 PM ET / 21:41 UTC (Revision 10). |
|
A note on the red checks. The failing suites are the Control UI rename-composition e2e, |
# Conflicts: # docs/.generated/config-baseline.sha256
…osition Releasing a parked steer reapplies queue overflow, so a fallback is not always a retained followup. parkSteerCandidate().fallback() now returns where the message ended up (queued / at-cap / summarized / dropped), and the receipt text follows it: "dropped" tells the sender to resend, "summarized" says it goes into the summary, and "at-cap" covers a retained item whose overflow is still deferred behind a sibling parked steer. Only a final "queued" promises an answer after the run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TRWvtxDWMcs2uSaSRoCwKz
|
Update: merged current Fallback receipt vs. queue overflow. ClawSweeper was right:
Tests in Config and data model. Scope (the open decision). I kept this as a focused, opt-in piece for steer mode rather than the full busy contract in #25222. The receipt kinds are typed and come from the queue's own disposition, so a later generic contract (followup/collect modes, configurable text, reason metadata) can reuse them. It wouldn't need to replace this. If you'd rather not add a steer-only key and want it under a broader Local runs: the steering/queue/receipt suites, the config schema suites, |
Summary-line overflow moves an older source into summaryElisions as a compact copy (tracked through sourceRefs). The fallback outcome resolver only looked at summarySources, so it reported "dropped" for a message the summary turn still delivers. Treat a run whose compact copy is still in an elision as "summarized"; only an evicted copy is a drop. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TRWvtxDWMcs2uSaSRoCwKz
|
The elided-summary P2 is addressed in 9d717ad. The outcome resolver now also checks |
# Conflicts: # docs/.generated/config-baseline.sha256
# Conflicts: # docs/.generated/config-baseline.counts.json # docs/.generated/config-baseline.sha256
…ges later A fallback receipt used to promise "I'll answer this right after it", but a later overflow can still evict that message (drop:old) or trim its summary entry. Fallback wording now states where the message is and never promises an answer. When receipts are on and the fallback was queued, the run's onQueueDisposition is wrapped so a later "queue-cap-old" eviction sends one follow-up reply to the same message asking the sender to resend it, ordered after the first receipt. Summary-entry trimming has no disposition hook, so the summary receipt says older entries can be trimmed instead. SteerReceiptKind now reuses ParkedSteerFallbackOutcome from the queue (fixes the knip unused-export finding). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TRWvtxDWMcs2uSaSRoCwKz
|
Addressed the "keep fallback receipts truthful after later overflow" P2 in 7756af5, after merging current main.
Thanks for the scope recommendation. Keeping this as the focused, opt-in setting for steer mode works for me. |
# Conflicts: # docs/.generated/config-baseline.sha256
# Conflicts: # docs/.generated/config-baseline.sha256
|
This pull request has been automatically marked as stale after 7 days without qualifying human activity. |
Related: #25222, #83871, #124731, #159816
What Problem This Solves
Fixes: in a chat channel, a message sent while a run is active gets no visible response. The sender can't tell whether it steered the running turn or is waiting for its own, so people resend, or
/stopa run that was already doing what they asked.User Impact
User impact: with
messages.queue.steerReceipts: true, each message that arrives during a run in steer mode gets its own reply quoting that message:🦞🛞 Current run steered with your new message.once the runtime has taken the message into the running turn⏳ Couldn't steer the current run; your message is queued behind it.when the message falls back to a followup turn and the queue keeps itmessages.queue.cap, the receipt follows the queue's actual disposition instead of promising an answer:summarized(including a summary line that was elided but is still retained),dropped(asks the sender to resend), orat-cap(a sibling steer is still parked, so the outcome isn't final yet)drop: old, if a later overflow evicts a message that was reported as queued, the sender gets one follow-up reply to that message: dropped, please resend. Summary-entry trimming has no disposition hook, so the summary receipt says older entries can be trimmed instead of sending a second noticeIt is off by default, so nothing changes unless an operator turns it on.
Scope, stated upfront: #25222 describes a broader busy-reply contract: all queue modes, configurable text,
/stopand/newguidance, and stable reason codes. This PR is a first, opt-in piece of that for steer mode only, where the outcome is known exactly. If you'd rather extend it here (for example make the text configurable, or coverfollowup/collect), or change the default wording, tell me and I'll adjust.Why This Change Was Made
runActiveReplySteeralready knows the outcome, and the receipt is sent at exactly those points:finalizeReplyMessageInjectionAttemptreturnsaccepted, meaning the runtime took the input. For runtimes that steer at tool boundaries, that's when the current tool call ends, so the receipt is never premature.parkSteerCandidate().fallback()returns where the message ended up (queued/at-cap/summarized/dropped), because releasing the park reapplies queue overflow. Forqueued/at-capfallbacks,armSteerReceiptEvictionNoticewraps the run's existingonQueueDisposition(the observer still runs first) and sends the follow-up onqueue-cap-old, ordered after the first receipt.The receipt goes out through
routeReplyas a standalone reply withmirror: false, so the model never sees its own receipts. It is deliberately not the message's terminal reply: a queued message still owes its real answer from the followup, and a second terminal reply for the same inbound would collide with it.Two channel details learned from real traffic:
replyToId. It has nothreading.resolveReplyTransport, so the payload names the message.FollowupRun.messageIdis often unset on the steer path, so the id falls back tosessionCtx.MessageSid, the same fallbackresolveAcceptedSteerRunIdalready uses.responsePrefixContextcomes from the active run, so operators who templatemessages.responsePrefixsee the model, not a literal{modelFull}.Config surface: one boolean. The core config budget goes from 2464 to 2465 (
docs/.generated/config-baseline.counts.json). It's opt-in because #83871 asked for this without default chat noise. If you'd prefer receipts on by default with no key, which fits "every action has a visible outcome", I can drop the key.schema.labels.tswas already over the line cap. Themessages.*labels moved unchanged intoschema.labels.messages.ts, and the file shrinks.Evidence
Live, on a Telegram deployment running this PR plus #159816 (claude-cli, Claude Code 2.1.280), in DMs and a forum topic with
message_tool_onlygroup replies. Examples from the logs:outbound send ok … threadId=35 replyToMessageId=714 s after message 71.Tests:
src/auto-reply/reply/steer-receipt.test.tshas 12 pure unit tests, withrouteReplymocked and no timers, I/O or Gateway boot:mirror: falsequeued,at-cap,summarized,dropped) promises an answersrc/auto-reply/reply/queue/enqueue.steering.test.tsasserts the fallback disposition for each drop policy (summarize,old,new), including a deferred overflow behind a parked sibling (drop: oldreportsqueue-cap-oldfor the evicted earlier fallback), a run whose summary line was elided but is still retained, and the same run reporteddroppedonce more overflow trims its elided copy.Single-worker wall time (
vitest run --maxWorkers=1 <file>, local):src/auto-reply/reply/queue/enqueue.steering.test.tssrc/auto-reply/reply/steer-receipt.test.tsAlso run:
runReplyAgentsuites, andsrc/config/schema*: passing. The common-tier snapshot gains exactlymessages.queue.steerReceipts.node scripts/check-changed.mjsagainst current main: the conflict-marker and line-cap ratchets pass. It then stops on the env-var budget (484 > 483), which comes from main because this diff adds no env vars.pnpm tsgo:core, oxlint and oxfmt are clean on the final head.🤖 Generated with Claude Code