Repository navigation
feat(agents): stop surfacing model-fallback notice to users - #93
Merged
convyusboy merged 2 commits intoJul 31, 2026
Merged
convyusboy merged 2 commits into
convyusboy merged 2 commits into
Conversation
A self-recovering mid-turn model swap is an internal reliability detail, so the '↪️ Model Fallback:' / 'Model Fallback cleared:' chat notices are no longer surfaced on any audience. The transition stays observable via the structured fallback/fallback_cleared lifecycle events and logs. Deletes the notice text builders and the now-dead internal isFallbackNotice payload flag; keeps transition tracking, persisted notice-state dedupe, and the separate silent-fallback-failure error path. Requested by Deepti.
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
cubic analysis
All reported issues were addressed across 13 files
Linked issue analysis
Linked issue: ENG-17078: Remove Model Fallback message shown in agents
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | No user-visible “Model Fallback” or “Model Fallback cleared” messages are rendered in agent replies | The code that built and injected user-visible fallback notices was removed and the run path no longer composes or injects fallback notice payloads. Tests were updated to assert the absence of the fallback text in reply payloads. |
| ✅ | A forced fallback still returns the assistant response (no duplicated bubble / gap) and the swap is silent to the user | E2E tests were updated to verify payloads do not contain the fallback notice and that the final/visible reply is still delivered. |
| ✅ | Fallback transitions remain observable in telemetry/lifecycle events (UI suppression only — logging/events unchanged) and deduplication of lifecycle events preserved | The code that computes transitions (resolveFallbackTransition) and persisted notice-state used for dedupe is retained; tests assert lifecycle events and counts rather than user-visible text. |
| ✅ | The silent-fallback-failure path is preserved: if a fallback produces no visible reply, the user still gets an error | The logic that returns the silent-failure payload is still present and the run path still checks/returns it when no visible payloads exist; tests were adapted around delivered vs. silent-failure behavior. |
| ✅ | Other agent status/system messages still render normally (rate-limit, tool-execution errors, compaction notices, etc.) | The generic status-notice mechanism remains (isStatusNotice) and the tests were adjusted to ensure other notices are still delivered and excluded from transcripts as before. |
| ❌ | Previously persisted messages in history no longer show the fallback notice (or an explicit handling plan is provided if messages remain stored) | The issue/test plan asked to confirm persisted messages no longer show the notice or to document intended handling (render-only suppression vs. stored content migration). The PR removes UI builders going forward but does not show code that strips or migrates previously persisted message content, nor an explicit test verifying history reload behavior. |
| ❌ | No new React warnings or console errors introduced by removing the notice rendering | The test plan requested checking the browser console for React warnings/errors. The PR includes unit and e2e test updates, but there is no evidence of a browser-console check or an explicit test that would catch runtime React warnings. |
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
…ilent behavior The 'Fallback is invisible to users' section contradicted two other passages that still described sending a visible notice / announcing transitions in user replies. Reword both to internal lifecycle-event + log observability, keeping the dedupe/sticky detail.
There was a problem hiding this comment.
Approved. Clean, well-scoped removal of the user-visible Model Fallback / cleared notices, tracing directly to ENG-17078 (Deepti's #project-rohan ask).
What I checked:
- Root cause is correctly diagnosed: the agents deployment runs the default
operatoraudience (no committedagents.defaults.messaging.audience), so consumer-only suppression wouldn't have hidden it — removing the notice on every audience is the right fix. - Dead code fully garbage-collected:
buildFallbackNotice/buildFallbackClearedNoticeremoved,isFallbackNoticedropped fromReplyPayload+AgentRuntimeReplyPayload, and the coalescer/dispatch/chat call sites cleaned up consistently. - Correctly PRESERVES the important seams:
resolveFallbackTransition+ persisted notice-state (cross-turn dedupe), bothfallback/fallback_clearedlifecycle events, themodel.failoverdiagnostic + counter, and the separate silent-fallback-FAILURE error path (no visible reply). - Tests rewritten properly — they now assert the swap stays silent to the user across verbose levels/channels while lifecycle events still fire once per state change and the silent-failure path is intact. Not just deleted assertions.
- Docs (
model-failover.md) updated to match, no contradictory notice language left.
Non-blocking, already flagged by the author:
- 2 pre-existing overflow-fallback failures in agent-runner e2e are unrelated to this change (untouched tests asserting a string outside this scope) — worth a separate follow-up.
- oxfmt / tsgo / check:changed couldn't run in the linked worktree; commit used --no-verify. Please run format + typecheck + changed-gate on Testbox before merge — that's the one thing to close out.
convyusboy
deleted the
ridho/eng-17078-remove-model-fallback-message-shown-in-agents
branch
July 31, 2026 09:58
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.
What Problem This Solves
The agents surface was showing users an internal operational notice whenever the runtime fell back to a backup model mid-turn, e.g.:
A self-recovering gateway timeout that swaps models mid-turn is an internal reliability detail. The turn still streams and completes normally, so surfacing a chat line just draws attention to plumbing and makes a normal fast turn look like it stalled. Deepti (via #project-rohan) asked for this to be removed from the agents UI.
Why This Change Was Made
The notice already had an audience seam (
operatorvsconsumer), but the agents deployment runs the defaultoperatoraudience —agents.defaults.messaging.audienceis not set in any committed config,render.yaml, or env — so consumer-only suppression would not have hidden it there. The clean fix is to stop surfacing the notice on every audience and keep the fallback observable only where operators actually debug it: structured lifecycle events and logs.This removes the two notice text builders (
buildFallbackNotice/buildFallbackClearedNotice) and garbage-collects the now-dead internalisFallbackNoticepayload flag (internal-only; not part of the plugin SDK or gateway protocol). Kept intact:resolveFallbackTransition+ the persisted notice-state fields (cross-turn dedupe).emitAgentEventlifecycle events (fallback/fallback_cleared).buildSilentFallbackFailurePayload), which surfaces a genuine error when the fallback produced no visible reply.Net −92 non-test prod LOC (one canonical path, no dead flag left behind).
User Impact
Model Fallback/Model Fallback clearedchat message on any channel. A mid-turn model swap is now invisible; the turn just completes normally.⚠️ … produced no visible replyerror.fallback/fallback_clearedstructured lifecycle events, themodel.failoverdiagnostic, and theopenclaw_model_failover_totalcounter.Evidence
scripts/run-vitest.mjs), all green:src/auto-reply/fallback-state.test.ts— 14 passedsrc/auto-reply/reply/dispatch-acp-delivery.test.ts— 31 passedsrc/auto-reply/reply/reply-utils.test.ts— 75 passedsrc/auto-reply/reply/dispatch-from-config.test.ts— 215 passedsrc/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts— 59 passedgit grepconfirms zero remainingisFallbackNotice/buildFallbackNotice/buildFallbackClearedNotice/CONSUMER_FALLBACKreferences.docs/concepts/model-failover.mdnow documents that fallback is invisible to users and recorded only in logs + structured events.Known proof gaps
agent-runner.runreplyagent.e2e.test.ts("overflow fallback" tests assertingAuto-compaction could not recover this turn, a string that no longer exists in source). Not touched by this change; worth a separate follow-up.oxfmt/tsgo/check:changedcould not run in this linked worktree (binaries absent). The commit usedcommitter --fast(--no-verify) to skip the format hook; format + typecheck + changed-gate still need a Testbox run before merge.Summary by cubic
Removed the user-visible “Model Fallback” and “Model Fallback cleared” messages in agents. Fallback swaps are now silent; transitions are tracked only via lifecycle events and logs. Aligns with Linear ENG-17078.
isFallbackNoticeflag fromReplyPayloadandAgentRuntimeReplyPayload; simplified payload handling and the coalescer.resolveFallbackTransitionand persisted notice-state to dedupe lifecycle events; preserved the silent-fallback-failure error path.Written for commit a3a1463. Summary will update on new commits.