Skip to content

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

@alexey-pelykh

Description

@alexey-pelykh

Context

Found during #2529 UI remnants audit (F2). The model-fallback UI handler stack remains in ui/src/ despite #2130 claiming to "Remove fallback UI indicators (FallbackStatus, handleLifecycleFallbackEvent, renderFallbackIndicator) from web UI".

The backend stub at src/auto-reply/fallback-state.ts:9 returns {}, so the guarded emit branches in src/auto-reply/reply/agent-runner.ts:587,616 (if (fallbackTransition.fallbackTransitioned) / if (fallbackTransition.fallbackCleared)) NEVER fire — the UI handler is dead wiring.

UI-side remnants (scope of this issue)

File Lines What
ui/src/ui/app-tool-stream.ts 75-106 FallbackAttempt type, parseFallbackAttemptSummaries, parseFallbackAttempts
ui/src/ui/app-tool-stream.ts 253-261 FallbackStatus type
ui/src/ui/app-tool-stream.ts 266-267 CompactionHost.fallbackStatus, CompactionHost.fallbackClearTimer
ui/src/ui/app-tool-stream.ts 271 FALLBACK_TOAST_DURATION_MS constant
ui/src/ui/app-tool-stream.ts 330-390 handleLifecycleFallbackEvent function
ui/src/ui/app-tool-stream.ts 403-406 Dispatcher branch for stream: "lifecycle" | "fallback"
ui/src/ui/app-tool-stream.node.test.ts (whole file) 22 fallback references — tests asserting the dead handler works
ui/src/ui/app-view-state.ts 2, 59 FallbackStatus import + fallbackStatus: FallbackStatus | null field
ui/src/ui/views/chat.ts 24-42, 86, 122-148, 406 FallbackIndicatorStatus type, fallbackStatus prop, FALLBACK_TOAST_DURATION_MS, renderFallbackIndicator, call-site
ui/src/styles/components.css 1267-1275 .compaction-indicator--fallback, .compaction-indicator--fallback-cleared CSS rules

Backend cleanup (separate follow-up — out of scope here)

src/auto-reply/fallback-state.ts stub + src/auto-reply/reply/agent-runner.ts:398-639 (resolveFallbackTransition call, both emit branches, buildFallbackNotice / buildFallbackClearedNotice calls) should also be removed for full cleanup of the fallback system. File separately.

Acceptance Criteria

  • Remove UI-side fallback handler stack per table above
  • Update app-tool-stream.node.test.ts — delete fallback-related tests (backend doesn't emit)
  • Remove .compaction-indicator--fallback* CSS rules (no TS references after UI cleanup)
  • pnpm check passes
  • pnpm test:ui:smoke passes
  • grep -rn "fallbackStatus\|FallbackStatus\|FallbackIndicatorStatus\|handleLifecycleFallbackEvent\|renderFallbackIndicator\|parseFallbackAttempt" ui/src/ returns no matches

Size estimate

~300 LOC removed across 5 source files + 1 CSS file + 1 test file.

Related

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions