fix(auto-reply): suppress room-event notice leaks#99145
Merged
Conversation
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(auto-reply): suppress room-event notice leaks This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #99142
What Problem This Solves
room_event(ambient) turns have a strict contract: nothing reaches the source chat unless the agent explicitly callsmessage(action=send). Five paths violate it, so ambient groups receive unprompted bot output that no instruction can prevent: fast-mode auto notices ("💨Fast: auto-off(...)") bypass suppression on both the direct dispatch path and queued followups; verbose 🛠️ tool summaries deliver from queued room-event followups (while the direct path correctly suppresses them); followup-path compaction/preflight-failure/cross-channel-error notices deliver to the group; and queue-overflow summaries strip theroom_eventkind, turning a burst of ambient chatter into a normal turn withforceMessageTool— a direct invitation to respond to messages nobody addressed to the bot.Why This Change Was Made
Each fix mirrors the existing correct gate rather than inventing new policy: the fast-mode dispatch bypass now requires
ctx.InboundEventKind !== "room_event"exactly like the sibling verbose/forced bypasses; the followup paths gate on the queued run'scurrentInboundEventKindwith logging consistent with the direct path's suppressed-notice logs; overflow summaries carrycurrentInboundEventKind: "room_event"only when every summarized item was a room event (mixed batches keep current behavior), tracked via anallRoomEventsflag on elision entries so the retry source preserves the kind.User Impact
Ambient-mode group chats no longer receive fast-mode status lines, tool summaries, compaction warnings, or overflow-triggered replies the agent never chose to send. Non-room-event behavior is unchanged, including the existing "delivers fast auto progress in message-tool-only mode" contract.
Evidence
dispatch-from-config.test.ts,followup-runner.test.ts, andqueue.collect.test.ts: room_event variant suppressed, non-room-event variant unchanged; the overflow test's pinnedundefinedkind updated to the new all-room-events contract.node scripts/run-vitest.mjsover the three touched test files: 382 tests; both tsgo lanes; oxlint clean; repo autoreview clean; combined-tree validation with the two sibling PRs (both tsgo lanes + 16 test files + Linux Testbox gates).