-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Ambient group mode runs blind: room-event turns get no room context, over-reply, and leak notices #99142
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashchannel: telegramChannel integration: telegramChannel integration: telegramclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashchannel: telegramChannel integration: telegramChannel integration: telegramclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Priority
None yet
Ambient group mode runs blind: room-event turns get no room context, over-reply, and leak notices
Current behavior
With
messages.groupChat.unmentionedInbound: "room_event"(ambient mode), the agent decides whether to chime in on every unmentioned group message — but the context pipeline that should inform that decision is broken end-to-end. Production analysis of a real Telegram deployment (48h window):Root causes (all verified against source)
32af1c06972, shipped v2026.6.10):includeGroupHistoryContextdefaults to"mention-only", andincludesRecentTelegramGroupHistoryContext()gates BOTH delivery paths of the pending window (extensions/telegram/src/bot-message-context.session.tscombinedBody fold +inboundHistory) to"recent". Ambient mode's premise is context from unmentioned messages; the default strips exactly that. The PR's tests never exercise ambient mode with the default config.bot-message-dispatch.ts:shouldClearGroupHistory = !isRoomEvent || ...), and delivering room events wipe it too. The semantics come from the legacy "messages since your last reply" model where cleared messages had been folded into a persisted session turn — but room events are deliberately not session-persisted, so the wipe destroys the only copy.user_requestmessages and the bot's own outbound sends never enter the window — the model cannot see the conversation happening with it, nor its own recent posts to self-regulate frequency.messagetool to send the final user-visible answer" (presupposing an answer) and falsely claims status updates are shown; the strongest "Be extremely selective" guidance ships only in the legacy NO_REPLY mode; the always-on group intro instructs "Address the specific sender"; the reply-etiquette bullet is Discord-only.Fix (three PRs)
fix(telegram): keep group history always on— removesincludeGroupHistoryContextentirely (maintainer decision: revert what Control Telegram group history context #89547 added;historyLimit, including0, remains the only knob), converts the window to a rolling window with non-destructive last-self-entry watermark selection, records all group inbound plus the bot's own sends, adds anopenclaw doctor --fixmigration for the retired key ("none"maps tohistoryLimit: 0to preserve privacy intent).fix(auto-reply): default room events to silence— default-silent room-event envelope, truthful room-event delivery hint, selectivity guidance extended to ambient mode, lurk-aware always-on intro, group etiquette generalized beyond Discord.fix(auto-reply): suppress room-event notice leaks— closes the five delivery bypasses listed above.Deliberately deferred: a unified per-room "participation mode" resolver (single owner for wake/classification/history/delivery coherence) — additive, tracked separately after these land.