Skip to content

gut(session): remove vestigial model fallback system#2130

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/remove-model-fallback-system
Apr 8, 2026
Merged

gut(session): remove vestigial model fallback system#2130
alexey-pelykh merged 1 commit intomainfrom
gut/remove-model-fallback-system

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Delete src/auto-reply/fallback-state.ts entirely (198 lines)
  • Remove fallbackNoticeSelectedModel, fallbackNoticeActiveModel, fallbackNoticeReason from SessionEntry
  • Remove RuntimeFallbackAttempt type and fallbackProvider/fallbackModel/fallbackAttempts from agent run loop
  • Remove resolveFallbackTransition calls, fallback notice building, and fallback event emission from agent-runner.ts
  • Remove fallback notice clearing from sessions-patch.ts and session-status-tool.ts
  • Remove fallback UI indicators (FallbackStatus, handleLifecycleFallbackEvent, renderFallbackIndicator) from web UI
  • Update all affected tests

Closes #2106

Test plan

  • pnpm check passes (format + typecheck + lint)
  • pnpm test passes (883 passed, 83 skipped — no regressions)
  • CI build + test + lint + docs jobs pass

🤖 Generated with Claude Code

CLI runtimes manage their own model selection — RemoteClaw has no model
fallback. Remove the dead transition system: resolveFallbackTransition,
fallback notices, fallbackNotice* session fields, RuntimeFallbackAttempt,
fallbackProvider/fallbackModel tracking, and UI fallback indicators.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 8, 2026 11:51
@alexey-pelykh alexey-pelykh merged commit f8426f9 into main Apr 8, 2026
9 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/remove-model-fallback-system branch April 8, 2026 12:03
alexey-pelykh added a commit that referenced this pull request Apr 24, 2026
#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 added a commit that referenced this pull request Apr 24, 2026
#2549) (#2554)

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>
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(session): remove vestigial model fallback system

1 participant