Skip to content

Suppress model fallback notices in rooms - #107209

Merged
obviyus merged 6 commits into
openclaw:mainfrom
NehoraiHadad:codex/suppress-fallback-notices-in-rooms
Aug 16, 2026
Merged

obviyus merged 6 commits into
openclaw:mainfrom
NehoraiHadad:codex/suppress-fallback-notices-in-rooms

Conversation

@NehoraiHadad

@NehoraiHadad NehoraiHadad commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Suppress model fallback transition and recovery notices in group and channel conversations. Keep direct-chat notices, persisted fallback state, and lifecycle events unchanged.

What Problem This Solves

Fallback notices bypass ordinary source-reply suppression and expose internal model-routing details in shared conversations. This change keeps those operational details out of group and channel replies while preserving the existing direct-chat behavior and internal state/lifecycle records.

Root cause

Fallback notices deliberately bypass ordinary source-reply suppression. The current payload owner, src/auto-reply/reply/agent-runner-result-payloads.ts, built and delivered those notices without applying the source chat type. The original patch targeted the pre-refactor monolithic runner, so it no longer affected current main.

Fix

  • Apply the canonical normalizeChatType contract at the fallback-notice payload owner.
  • Suppress only group and channel; preserve direct and unknown/non-room behavior.
  • Keep state persistence and fallback / fallback_cleared lifecycle emission outside the presentation gate.
  • Skip notice formatting entirely for suppressed rooms.
  • Document the room behavior.
  • Table-drive the owner-boundary regression across direct, group, and channel contexts, including transition, recovery, persistence, and lifecycle assertions.

Production delta: +35/-30 (net +5); tests +94/-72 (net +22); docs net 0. The production growth is the canonical chat-type import and rare-path visibility gate.

Evidence

Exact head: be13689f6636128a0429d13162fc85865c5ce963

  • Pre-fix regression: direct controls passed; group transition and channel recovery failed because Model Fallback notices remained visible.
  • Focused regression: 3 passed across direct/group/channel.
  • Grouped owner-prefix suite: 44 files, 801 tests passed across four Vitest shards.
  • git diff --check origin/main...HEAD
  • pnpm exec oxfmt --check on all three touched files
  • node scripts/run-oxlint.mjs on production and test TypeScript
  • docs MDX check plus repository markdownlint: 0 issues
  • pnpm tsgo
  • pnpm tsgo:test (check:test-types implementation)
  • $distill: zero blockers; single owner and 0/1 payload path confirmed.
  • $greybeard: initial low allocation finding fixed by moving chat normalization and notice formatting to the rare fallback-change path; zero remaining medium/high findings.

Codex contract check: sibling Codex source treats fallback selection as internal model metadata/telemetry (codex-rs/models-manager/src/manager.rs, codex-rs/models-manager/src/model_info.rs, codex-rs/core/src/compact_model_fallback.rs); it defines no channel-visible notice policy.

Maintainer decision

Approved 2026-08-16 by maintainer Ayaan: fallback notices remain visible in direct and unknown/non-room contexts; normalized group and channel conversations suppress them. This preserves the author's audience policy and matches the existing room-versus-direct presentation boundary.

Telegram real-user proof

Exact head: be13689f6636128a0429d13162fc85865c5ce963.

  • Room transition: primary returned HTTP 503; openai/gpt-5.5 fallback succeeded; TDLib observed the delivered SUT reply OPENCLAW_E2E_OK; visible fallback notices: 0.
  • Room recovery: seed turn fell back after primary HTTP 503; the next turn recovered on primary HTTP 200; TDLib observed the delivered SUT reply OPENCLAW_E2E_OK; visible fallback-cleared notices: 0.
  • Provider request log: transition fallback request plus recovery primary request; Gateway decision log confirms fallback candidate success before recovery.
  • Raw user/chat IDs and credential/session data are intentionally omitted.

Redacted transcript excerpt (verbatim retained fields; user, chat, message, run, session, and trace identifiers removed):

08:39:03 provider-transport-fetch: provider=proof-primary model=proof-primary status=503
08:39:04 model-fallback/decision: decision=candidate_succeeded candidateProvider=openai candidateModel=gpt-5.5
TDLib: {"elapsedMs":3164,"kind":"message","isSut":true,"isOutgoing":false,"contentType":"messageText","textLen":15,"text":"OPENCLAW_E2E_OK","topicType":"messageTopicForum"}
transition events scan: visible text matching "Model Fallback" = 0

08:37:32 provider-transport-fetch: provider=proof-primary model=proof-primary status=503
08:37:33 model-fallback/decision: decision=candidate_succeeded candidateProvider=openai candidateModel=gpt-5.5
08:37:38 provider-transport-fetch: provider=proof-primary model=proof-primary status=200
TDLib: {"elapsedMs":2462,"kind":"message","isSut":true,"isOutgoing":false,"contentType":"messageText","textLen":15,"text":"OPENCLAW_E2E_OK","topicType":"messageTopicForum"}
recovery events scan: visible text matching "Model Fallback cleared" = 0

Visual recorder limitation: current main no longer contains the installed userbot skill's scripts/e2e/telegram-desktop-recorder.ts, the replacement openclaw-telegram-user-crabbox-proof command is not installed, and artifact publishing is not configured on this host. No visual artifact is claimed; the proof above is the real-user TDLib observation plus redacted provider/Gateway facts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 14, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. labels Jul 14, 2026
@clawsweeper

clawsweeper Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 2:27 AM ET / 06:27 UTC.

ClawSweeper review

What this changes

The PR stops model-fallback transition and recovery notices from being posted in group and channel conversations while leaving direct and unknown conversation behavior unchanged.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

No blocking patch findings. The payload-owner gate cleanly suppresses room notices while retaining fallback state and lifecycle events; exact-head CI remains before merge. Likely related people: Peter Steinberger (high confidence).

Priority: P1
Reviewed head: be13689f6636128a0429d13162fc85865c5ce963

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The owner-local implementation, state/lifecycle regression coverage, and real transport trace provide normal merge-ready evidence once exact-head CI completes.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Redacted TDLib live output shows a real Telegram room fallback and recovery with the final reply delivered and zero visible notices; the production and test blobs are unchanged on the final head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Redacted TDLib live output shows a real Telegram room fallback and recovery with the final reply delivered and zero visible notices; the production and test blobs are unchanged on the final head.
Evidence reviewed 8 items Current-main behavior: Current main unconditionally builds and marks transition and recovery fallback notices for delivery after lifecycle emission; it does not consult the source chat type.
Owner-boundary repair: The PR normalizes the canonical chat type only when notice state changes, keeps lifecycle events outside the presentation gate, and creates a notice payload only for non-room types.
Persistence remains independent: Fallback state is persisted before presentation payload preparation, so room suppression does not discard status or recovery state.
Findings None None.
Security None None.

How this fits together

The reply runner turns an agent run’s fallback result into outbound payloads and lifecycle records. This PR changes only the user-facing notice branch after fallback state has already been recorded.

flowchart LR
  A[Agent run] --> B[Fallback outcome]
  B --> C[Fallback state accounting]
  C --> D[Reply payload builder]
  D --> E{Conversation type}
  E --> F[Direct or unknown notice]
  E --> G[Group or channel suppression]
  C --> H[Lifecycle event]
Loading

Before merge

  • Resolve merge risk (P2) - This intentionally changes an existing group/channel delivery behavior: operators who relied on visible fallback banners in rooms will no longer receive them, although direct and unknown contexts remain unchanged.
  • Resolve merge risk (P1) - The bug fix has a net production increase of five lines; the shared gate keeps lifecycle/state accounting separate from presentation, and no simpler owner-local representation was evident.
  • Resolve merge risk (P1) - The PR is mergeable but behind main and required exact-head checks are still running; land only after the clean merge result and required checks are confirmed.
  • Complete next step (P2) - No mechanical repair is indicated; wait for exact-head CI and normal merge handling.
Agent review details

Security

None.

PR surface

Source +5, Tests +22, Docs 0. Total +27 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 35 30 +5
Tests 1 94 72 +22
Docs 1 4 4 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 133 106 +27

Review metrics

Metric Value Why it matters
Production versus test LOC production +5 (+35/-30); tests +22 (+94/-72); docs 0 (+4/-4) The small production increase is the owner-local chat-type presentation gate; tests add transition, recovery, persistence, and lifecycle coverage.

Mantis proof suggestion

A short Telegram Desktop capture would make the absence of fallback and recovery banners in a room directly inspectable alongside the delivered reply. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: reproduce fallback and recovery in a group/topic, and capture that no Model Fallback notices are posted while the reply arrives.

Merge-risk options

Maintainer options:

  1. Retain the approved room policy (recommended)
    Accept the documented change that group and channel conversations omit fallback notices while direct and unknown contexts retain them, subject to exact-head CI.
  2. Keep existing room notices
    Pause this PR if maintainers decide room operators must continue receiving routing notices, then resolve the broader external-channel policy in the related issue.

Technical review

Best possible solution:

Keep state persistence and lifecycle emission universal, retain the single payload-owner presentation gate for normalized rooms, and merge only after exact-head checks confirm the approved audience policy.

Do we have a high-confidence way to reproduce the issue?

Yes—source-reproducible with high confidence: current main builds notices without consulting chat type, and the submitted real Telegram trace exercises fallback transition and recovery in a room.

Is this the best way to solve the issue?

Yes: presentation is gated at the generic payload owner after accounting, avoiding channel-specific divergence while preserving persisted state and lifecycle events.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fa57fe5ae5c9.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Redacted TDLib live output shows a real Telegram room fallback and recovery with the final reply delivered and zero visible notices; the production and test blobs are unchanged on the final head.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Redacted TDLib live output shows a real Telegram room fallback and recovery with the final reply delivered and zero visible notices; the production and test blobs are unchanged on the final head.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: This changes active user-visible fallback messaging in shared conversations.
  • merge-risk: 🚨 compatibility: Existing group and channel operators will stop receiving previously visible fallback status notices.
  • merge-risk: 🚨 message-delivery: The PR intentionally suppresses two kinds of outbound operational messages for normalized room contexts.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Redacted TDLib live output shows a real Telegram room fallback and recovery with the final reply delivered and zero visible notices; the production and test blobs are unchanged on the final head.
  • proof: sufficient: Contributor real behavior proof is sufficient. Redacted TDLib live output shows a real Telegram room fallback and recovery with the final reply delivered and zero visible notices; the production and test blobs are unchanged on the final head.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. This changes visible Telegram room-message behavior and is straightforward to demonstrate in Telegram Desktop.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Current-main blame assigns the fallback notice construction to the payload-owner refactor. (role: recent payload-owner contributor; confidence: high; commits: bb68ad057c6d; files: src/auto-reply/reply/agent-runner-result-payloads.ts, src/auto-reply/reply/agent-runner-result-accounting.ts, src/auto-reply/fallback-state.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for required exact-head checks to finish successfully.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (18 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-01T08:55:55.435Z sha b463aca :: needs real behavior proof before merge. :: [P1] Rebase the guard onto the current fallback payload owner
  • reviewed 2026-08-03T07:26:07.731Z sha b463aca :: needs real behavior proof before merge. :: [P1] Rebase the guard onto the current fallback payload owner
  • reviewed 2026-08-09T20:43:13.389Z sha b463aca :: needs real behavior proof before merge. :: [P1] Move the guard to the current fallback-payload owner
  • reviewed 2026-08-14T09:11:45.157Z sha b463aca :: needs real behavior proof before merge. :: [P1] Move room suppression to the current payload owner
  • reviewed 2026-08-15T13:18:35.333Z sha b463aca :: needs real behavior proof before merge. :: [P1] Move room suppression to the current payload owner
  • reviewed 2026-08-15T20:15:00.501Z sha b463aca :: needs real behavior proof before merge. :: [P1] Move room suppression to the current payload owner
  • reviewed 2026-08-16T05:26:55.641Z sha 7c69f8e :: needs real behavior proof before merge. :: [P1] Confirm the room-notice policy before changing the default
  • reviewed 2026-08-16T05:43:45.965Z sha 7c69f8e :: needs real behavior proof before merge. :: [P1] Obtain approval for the new room-delivery policy

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 14, 2026
@NehoraiHadad

Copy link
Copy Markdown
Contributor Author

Updated in b463aca.

  • Fallback and fallback_cleared lifecycle events are now emitted for group/channel sources.
  • Only the user-visible fallback notice payloads are suppressed for rooms.
  • Added e2e assertions covering both suppressed visible notices and preserved lifecycle events.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 18, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. labels Aug 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Aug 16, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 16, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Aug 16, 2026
@obviyus
obviyus marked this pull request as ready for review August 16, 2026 06:21
@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 16, 2026
@obviyus obviyus self-assigned this Aug 16, 2026
@obviyus
obviyus merged commit 7d05f7c into openclaw:main Aug 16, 2026
137 of 139 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 17, 2026
Hide model fallback and recovery notices in group and channel conversations while preserving direct-chat notices, persisted state, and lifecycle events.

Co-authored-by: NehoraiHadad <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants