Repository navigation
Fix /model picker confirm flow discarding correctly-resolved selections - #254
Merged
Merged
Conversation
The picker's Enter-key handler compared the raw typed filter text against the full resolved catalogue id (e.g. "luna" vs "openai-codex/gpt-5.6-luna"), which almost never matched, so an already-correctly-resolved row was discarded and re-dispatched as free-text "/model luna" — which then got wrongly re-prefixed to "openai-codex/luna", a model that doesn't exist. Trust the resolved row whenever one exists; only fall back to free-text when the filtered row list is genuinely empty. Also introduce ModelSelection (provider/model/profile_id/effort) as a single structured value threaded through picker confirm, default-model application, quick switch, and restore-on-restart, replacing four independently-assigned fields that could drift apart.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
…ns (#254) * Fix /model picker confirm flow discarding correctly-resolved selections The picker's Enter-key handler compared the raw typed filter text against the full resolved catalogue id (e.g. "luna" vs "openai-codex/gpt-5.6-luna"), which almost never matched, so an already-correctly-resolved row was discarded and re-dispatched as free-text "/model luna" — which then got wrongly re-prefixed to "openai-codex/luna", a model that doesn't exist. Trust the resolved row whenever one exists; only fall back to free-text when the filtered row list is genuinely empty. Also introduce ModelSelection (provider/model/profile_id/effort) as a single structured value threaded through picker confirm, default-model application, quick switch, and restore-on-restart, replacing four independently-assigned fields that could drift apart. * Remove duplicate Tokyo Night theme
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…ns (#254) * Fix /model picker confirm flow discarding correctly-resolved selections The picker's Enter-key handler compared the raw typed filter text against the full resolved catalogue id (e.g. "luna" vs "openai-codex/gpt-5.6-luna"), which almost never matched, so an already-correctly-resolved row was discarded and re-dispatched as free-text "/model luna" — which then got wrongly re-prefixed to "openai-codex/luna", a model that doesn't exist. Trust the resolved row whenever one exists; only fall back to free-text when the filtered row list is genuinely empty. Also introduce ModelSelection (provider/model/profile_id/effort) as a single structured value threaded through picker confirm, default-model application, quick switch, and restore-on-restart, replacing four independently-assigned fields that could drift apart. * Remove duplicate Tokyo Night theme
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…ns (#254) * Fix /model picker confirm flow discarding correctly-resolved selections The picker's Enter-key handler compared the raw typed filter text against the full resolved catalogue id (e.g. "luna" vs "openai-codex/gpt-5.6-luna"), which almost never matched, so an already-correctly-resolved row was discarded and re-dispatched as free-text "/model luna" — which then got wrongly re-prefixed to "openai-codex/luna", a model that doesn't exist. Trust the resolved row whenever one exists; only fall back to free-text when the filtered row list is genuinely empty. Also introduce ModelSelection (provider/model/profile_id/effort) as a single structured value threaded through picker confirm, default-model application, quick switch, and restore-on-restart, replacing four independently-assigned fields that could drift apart. * Remove duplicate Tokyo Night theme
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
openai-codex/luna is not foundafter selectinggpt-5.6-lunafrom the/modelpicker. The suspected cause was hyphen-splitting of model ids, but no such splitting exists anywhere in the codebase.crates/forge-tui/src/overlays.rs,ConnectModelColumn::Modelsarm) compared the raw typed filter text against the full resolved catalogue id ("luna"vs"openai-codex/gpt-5.6-luna"). Since a substring filter is almost never byte-equal to the canonical id, the already-correctly-highlighted row was discarded and re-dispatched as free-text/model luna, which then got re-prefixed to a nonexistentopenai-codex/luna./model <arg>when there is genuinely no matching row at all.ModelSelection(provider/model/profile_id/effort) inforge-connectas a single structured value threaded from catalogue row → picker confirm → active app state → persistence → outbound request, via one newTuiApp::apply_selection()setter. Replaces four independently-assigned fields (runtime.model_label,runtime.provider,connect.profile,reasoning_effort.value) that could previously drift apart — which is exactly the failure mode the picker bug demonstrated. No on-disk format change; persistence still uses the existing flat TOML keys, composed intoModelSelectionat the store boundary only.Test plan
overlays.rs: typing a substring of a real catalogue id (lunaforopenai-codex/gpt-5.6-luna) now confirms the resolved row instead of falling back to free text; genuinely unlisted text still falls back correctly; empty-filter Enter still selects the current row.app/tests/connect.rs: selecting the current model (no-op), switching models via a partial filter (the literal repro path), changing reasoning effort after a switch, cancelling at the Models and Effort columns (state untouched), restart/restore viarestore_saved_auth, and the first outboundModelRequestafter a switch carrying the exact complete id.cargo test --workspace— all green except two pre-existing, unrelated failures on this machine (documentedforge-configpermissions tests reading real repo files)cargo clippy --workspace --all-targetscleancargo fmt --all -- --checkclean