Skip to content

gut(ui): strip model-fallback UI dead wiring (#2549)#2554

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/2549-ui-fallback-dead-wiring
Apr 24, 2026
Merged

gut(ui): strip model-fallback UI dead wiring (#2549)#2554
alexey-pelykh merged 1 commit intomainfrom
gut/2549-ui-fallback-dead-wiring

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Closes #2549.

Summary

  • Strips the UI-side model-fallback handler stack that became dead wiring
    after the backend fallback-state module was stubbed to return {} during
    the Pi-era cleanup. The guarded emit branches in agent-runner.ts never
    fire, so handleLifecycleFallbackEvent, the toast indicator, and the
    AppViewState.fallbackStatus field have no live producer.
  • Completes the spike(ui): re-audit prior gut areas for UI remnants (session-cost, model-fallback, default-agent) #2529 F2 audit follow-up to gut(session): remove vestigial model fallback system #2130, which claimed to remove
    the fallback UI indicators but missed the handler, the state field, the
    CSS rules, and the test scaffolding.
  • Net: 461 deletions, 3 insertions across 7 files. Scope extensions
    beyond the issue body: views/chat.test.ts (3 obsolete tests + default
    prop) and app.smoke.test.ts comment — both required for the AC grep to
    return empty.

What was removed

File Removal
ui/src/ui/app-tool-stream.ts FallbackStatus / FallbackAttempt types, parseFallbackAttempt{Summaries,s}, handleLifecycleFallbackEvent, lifecycle/fallback dispatcher branch, FALLBACK_TOAST_DURATION_MS, fallback fields on CompactionHost, now-dead private helpers (toTrimmedString, resolveModelLabel, resolveAcceptedSession)
ui/src/ui/app-tool-stream.node.test.ts whole file (100% fallback tests)
ui/src/ui/app-view-state.ts FallbackStatus import + fallbackStatus field
ui/src/ui/views/chat.ts FallbackIndicatorStatus, ChatProps.fallbackStatus, renderFallbackIndicator, toast constant, call-site
ui/src/ui/views/chat.test.ts 3 obsolete test cases + default fallbackStatus: null prop
ui/src/ui/app.smoke.test.ts doc comment updated ("four optional fields" → "two optional fields")
ui/src/styles/components.css .compaction-indicator--fallback + --fallback-cleared rules

What stays

  • Backend stub (src/auto-reply/fallback-state.ts) + guarded emit branches in
    src/auto-reply/reply/agent-runner.ts — explicitly out of scope per the
    issue body ("separate follow-up"). The stub already returns empty, so
    nothing emits regardless.
  • Unrelated "fallback" uses preserved: agent model fallback configuration
    (app-render.ts), default agent ID fallback (app-chat.ts), display-name
    fallbacks (app-render.helpers.ts), channel-status fallbacks
    (src/commands/onboard-channels.ts).

Test plan

  • pnpm check — format, tsgo, oxlint (0/0), no-random-messaging, no-remoteclaw-ai, css-class-drift (0 orphans, 0 clusters)
  • pnpm test:ui:smoke — 12/12 pass (8 in app.smoke.test.ts, 4 in app.computed-style.test.ts)
  • chat.test.ts retained tests (7/7) pass after removing the 3 fallback cases
  • AC grep verified empty: fallbackStatus|FallbackStatus|FallbackIndicatorStatus|handleLifecycleFallbackEvent|renderFallbackIndicator|parseFallbackAttempt across ui/src returns 0 matches (also clean across docs/ and extensions/)

Related

🤖 Generated with Claude Code

#2549)

The backend fallback-state stub returns `{}`/`undefined`, so the guarded
emit branches in `agent-runner.ts` never fire. The UI handler stack,
toast indicator, state field, and CSS rules are dead wiring — remnants
of the incomplete #2130 cleanup (#2529 F2).

Removals (UI-side only; backend cleanup deferred per issue scope):
- `app-tool-stream.ts`: `FallbackStatus` type, `FallbackAttempt` type,
  parse helpers, `handleLifecycleFallbackEvent`, `lifecycle`/`fallback`
  dispatcher branch, `FALLBACK_TOAST_DURATION_MS`, fallback fields on
  `CompactionHost`, and now-dead locals (`toTrimmedString`,
  `resolveModelLabel`, `resolveAcceptedSession`)
- `app-tool-stream.node.test.ts`: deleted (100% fallback tests)
- `app-view-state.ts`: removed `fallbackStatus` field + import
- `views/chat.ts`: removed `FallbackIndicatorStatus`, `ChatProps.fallbackStatus`,
  `renderFallbackIndicator`, toast constant, call-site
- `views/chat.test.ts`: removed 3 obsolete `renderFallbackIndicator` tests
  and default `fallbackStatus: null` prop
- `app.smoke.test.ts`: updated `COMPACTION_HOST` doc comment to reflect
  remaining two optional fields
- `styles/components.css`: removed `.compaction-indicator--fallback` and
  `--fallback-cleared` rules

Net: 461 deletions, 3 insertions across 7 files.

Verification:
- `pnpm check` (format, tsgo, oxlint, css-class-drift): green
- `pnpm test:ui:smoke`: 12/12 pass
- AC grep (`fallbackStatus|FallbackStatus|FallbackIndicatorStatus|handleLifecycleFallbackEvent|renderFallbackIndicator|parseFallbackAttempt` across `ui/src`): 0 matches

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh merged commit ed860f1 into main Apr 24, 2026
16 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/2549-ui-fallback-dead-wiring branch April 24, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gut(ui): strip model-fallback UI dead wiring — backend stub returns {} (#2529 F2)

1 participant