Skip to content

fix(auto-reply): suppress room-event notice leaks#99145

Merged
obviyus merged 3 commits into
mainfrom
codex/fix-ambient-leaks
Jul 2, 2026
Merged

fix(auto-reply): suppress room-event notice leaks#99145
obviyus merged 3 commits into
mainfrom
codex/fix-ambient-leaks

Conversation

@obviyus

@obviyus obviyus commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Part of #99142

What Problem This Solves

room_event (ambient) turns have a strict contract: nothing reaches the source chat unless the agent explicitly calls message(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 the room_event kind, turning a burst of ambient chatter into a normal turn with forceMessageTool — 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's currentInboundEventKind with logging consistent with the direct path's suppressed-notice logs; overflow summaries carry currentInboundEventKind: "room_event" only when every summarized item was a room event (mixed batches keep current behavior), tracked via an allRoomEvents flag 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

  • Per-fix regression tests in dispatch-from-config.test.ts, followup-runner.test.ts, and queue.collect.test.ts: room_event variant suppressed, non-room-event variant unchanged; the overflow test's pinned undefined kind updated to the new all-room-events contract.
  • node scripts/run-vitest.mjs over 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).

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Jul 2, 2026
@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
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.

@obviyus
obviyus merged commit 4d5dac1 into main Jul 2, 2026
111 of 113 checks passed
@obviyus
obviyus deleted the codex/fix-ambient-leaks branch July 2, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant