feat(settings): add foreground fallback controls - #5812
Open
RaresKeY wants to merge 3 commits into
Open
Conversation
Make foreground fallback an explicit per-user, availability-only policy shared by streaming Chat, non-stream Chat, and Agent runs. Preserve strict defaults, owner/model and credential boundaries, pinned Agent routes, and truthful per-round provenance/accounting. Carry provider-reported model identifiers through native streaming adapters, non-stream responses, and caches, and keep legacy default_model_fallbacks as tombstoned raw storage that generic settings APIs and agent tools cannot expose or mutate.
Add an off-by-default per-user foreground fallback toggle and an ordered editor for unique concrete LLM endpoint/model candidates. Keep the catalog and runtime on the same owner, allowlist, endpoint-type, known/unknown inventory, and runtime-credential boundaries; preserve legacy data and stale rows without misleading strict-state claims; and fail closed across loading, refresh, and preference-write errors. Reuse existing Settings controls while preserving save ordering, keyboard focus, responsive layout, list limits, and service-worker caching.
RaresKeY
marked this pull request as ready for review
July 28, 2026 16:57
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.
Summary
This replaces #5684, which GitHub closed during the repository transfer and fork-network separation. The branch has been rebuilt on the current dev history; the implementation scope is unchanged.
Settings now exposes an off-by-default per-user foreground fallback toggle and an ordered editor for concrete endpoint/model candidates. The editor writes only the replacement policy keys, never displays or migrates legacy fallback data, and uses the same owner, allowlist, endpoint-type, model-inventory, and runtime-credential boundaries as backend routing.
Target branch
dev, notmain. All PRs land indev;mainis curated by the maintainer at each release. If your PR is onmainby accident, click "Edit" on this PR and change the base.Linked Issue
Fixes #5627
Part of #5625
Depends on #5683
Type of Change
Checklist
devdocker compose uporuvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.Stack
This is the third PR in #5625: #5632 → #5683 → this PR.
Until the preceding PRs merge, GitHub shows the three-commit stack. The issue-specific commit is
266281699442d398cd1fd51c239e427ade9ec417.Behavior contract
default_model_fallbacksis never displayed, copied, or migrated.Scope
In scope: the Settings toggle, ordered editor, foreground-safe model catalog, persistence, failure recovery, keyboard focus, responsive layout, and service-worker caching.
Out of scope: per-message overrides, inferred model profiles, provider discovery, capability inference, legacy-data migration, and controls for Utility, Vision, Deep Research, tasks, teacher, image, embedding, or search providers.
Validation
Desktop/mobile browser validation and screenshots remain outstanding, so this PR remains draft.
How to Test
Visual / UI changes — REQUIRED if you touched anything that renders
--red,--fg,--bg,--card,--border, etc.) — do not introduce new color values, font sizes, or spacing units.static/index.html) or plain text.Fira Code) for primary UI text. Don't override.Screenshots / clips
Not included. Desktop/mobile browser validation and screenshots remain outstanding.