Repository navigation
fix: keep ambient room events silent - #126527
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 11:41 PM ET / August 20, 2026, 03:41 UTC. ClawSweeper reviewWhat this changesThe PR keeps ambient Telegram room events silent after an empty model completion while preserving visible recovery for directed messages and commands. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessNo blocking correctness finding: the patch carries the producer-owned ambient reply expectation through the queue to the terminal-recovery owner. This maintainer-labeled, P1 delivery change should stay open for exact-current-base merge verification. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherTelegram events enter auto-reply classification, which prepares a queued embedded agent run; terminal recovery then decides whether an empty completion owes a visible response. This patch preserves that reply expectation across the queue boundary. flowchart LR
A[Telegram inbound event] --> B[Auto-reply classification]
B --> C[Reply expectation]
C --> D[Queued embedded run]
D --> E[Terminal recovery]
E --> F[Ambient event stays silent]
E --> G[Directed turn retries visibly]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +23, Tests +16. Total +39 across 9 files. View PR surface stats
Review metrics
Mantis proof suggestionA Telegram Desktop before/after trace would directly show that ambient chatter stays silent while a directed mention still gets recovery. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep one reply-expectation fact owned by auto-reply preparation, preserve it through all queued execution paths, and validate the rebased head with the ambient-silence and directed-recovery trace. Do we have a high-confidence way to reproduce the issue? Yes, from source and supplied exact-head proof: send an undirected room event with group silence disallowed and force a reasoning-only completion, then compare it with a directed mention. Independent current-main execution was unavailable because this checkout lacks its main merge base. Is this the best way to solve the issue? Yes: the terminal runner already owns optional-versus-required recovery, so recording that fact at auto-reply preparation and carrying it through queueing is the narrowest coherent repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 916eef4e9960. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Landing review:
|
Restore intentional silence for undirected room events while retaining visible-answer recovery for mentions, commands, and ordinary requests. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes an issue where ambient Telegram group messages configured as
room_eventcould trigger a forced visible-answer retry after the model deliberately stayed silent.Why This Change Was Made
Auto-reply classified the turn and allowed silence, but did not carry the matching terminal-reply expectation into the embedded runner. The runner therefore inferred that every user-triggered run required a visible reply. This change records that fact at the auto-reply producer, carries it through queued runs, and shares one directed-turn predicate with visible fallback policy.
Undirected
room_eventturns now declare an optional terminal reply even when generic group silence is configured asdisallow. Direct messages, mentions, commands, and ordinary user requests remain reply-required. The generic incomplete-turn recovery and Telegram adapter are unchanged.Provenance: behavior introduced by #118305 (
97034f3d953b); later refactors only moved the policy.User Impact
Ambient Telegram mode can observe group chatter without speaking unless the model explicitly sends a message. Genuine mentions and commands still recover from empty or reasoning-only provider completions with a visible-answer retry.
Evidence
room_eventwithsilentReply.group=disallowproducedallowEmptyAssistantReplyAsSilent=falseand no terminal expectation.pnpm tsgo: passed.pnpm check:test-types: passed.git diff --check: passed.Exact-head Telegram userbot proof at
623af24b9b84dc77bd8f69646d74323b7aa97003, withmessages.groupChat.unmentionedInbound=room_event,silentReply.group=disallow, and a deterministic reasoning-only first provider completion:run-mock-sut-user-e2e.mjs --text 'OPENCLAW_E2E_AMBIENT_SILENCE' --record <events> --output <summary>.Sent Bot API message
48876. Provider requests: 1. Recorded SUT totals: no messages. Gateway log: no visible-answer continuation.run-mock-sut-user-e2e.mjs --text '@<sut> OPENCLAW_E2E_DIRECTED_RECOVERY' --record <events> --output <summary>.Sent Bot API message
48877. Provider requests: 2. Gateway recorded the reasoning-only visible-answer continuation. Telegram recorded one SUT message, Bot API48878, at 3187 ms withOPENCLAW_E2E_DIRECTED_RECOVERY.ok=true; both runner scratch directories removed after exit.