Fix context window, drop model tiers, and pick a provider before a model - #363
Merged
Conversation
Model identity is provider:model, and a custom provider name (an account label like xai/thegreataxios) never exact-matches the models.dev registry, which publishes bare and canonical provider/model keys only. Try the bare model id and the canonical provider/model form before falling through to the heuristic. Give heuristicWindow a grok/xai branch so an unpopulated registry still lands on a plausible window instead of the 128k default. Expose hasContextWindowFor so callers can tell a confident registry hit from the heuristic fallback, and use it to mark estimated windows in the picker footer.
Model tiers (fast/standard/clever fallback chains) added a second selection mechanism alongside per-agent inference pins without buying anything the pins didn't already cover, and the picker footer's "tier unknown" label carried no operator-facing meaning. Remove the tier config surface end to end: settings.tiers, the ProviderTier/TierConfig family, tierProviderRefs/resolveTier and friends, task(tier=), and profile.tier (native and frontmatter). Subagent dispatch already fell back to a tier-free single-source build whenever no tier chain was configured, so buildMainSessionSources and buildSubagentSources collapse to that path unconditionally, still backed by the other configured providers for mid-run failover. /fast, /standard, and /clever are retired outright rather than re-expressed as favourites or aliases: tiers were a fallback chain per name, and neither favourites nor a single pinned model captures that shape, so there is no faithful one-to-one replacement. Per-agent model selection continues to work through profile.inference, which was already the primary mechanism. An old settings file with a tiers key still loads; the key is accepted and silently dropped on the next save, same as the existing workflowPlugins/agentPlugins precedent. The xai auth surface's "tier" (src/auth/xai/constants.ts, src/auth/xai/usage.ts) is the provider's prepaid subscription tier, an unrelated concept, and is untouched.
The picker was one flat list of every provider-account-model combination — 30+ rows, the same models repeated once per account, providers interleaved. Group it: the top level now shows one row per provider (each account is already its own catalog entry, e.g. codex/abk-labs vs codex/dirtroad, so no extra grouping key is needed), selecting one descends into that provider's models, and Escape at the model level steps back to the provider level instead of closing the picker. Recent and favorite picks stay flat at the top so the default model is reachable without descending, same as before. The active model's row (and its provider group, when the row itself is not already surfaced via Recent) reads "(current)" so the pick is identifiable at a glance. Both levels reuse the same scrolling list overlay the picker already used, so a short terminal scrolls within the picker rather than overflowing it. Escape only stepped back for permissions/operator overlays before — extended to model_picker so the provider level can be restored via the same dismiss path, harmless no-op for a caller that sets no onCancel. The description-zone fallback for a provider row shows its model count so the zone is never blank before descending.
TheGreatAxios
force-pushed
the
cl-5590-model-surface
branch
from
August 7, 2026 08:09
4bb4d34 to
732dfba
Compare
6 tasks
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
xai/thegreataxios) now resolve their real context window instead of silently landing on the 128k default, and a heuristic miss is now marked "(estimated)" in the picker./fast/standard/clevercommands, and the tier fallback-chain machinery. Subagent dispatch already worked without a configured tier chain, so it now always runs that path, still backed by other configured providers for failover. An old settings file with atierskey still loads (dropped on next save, same as the existing workflowPlugins/agentPlugins precedent). The xai auth surface's "tier" is an unrelated prepaid subscription concept and is untouched.Verification
bun run typecheck,bun run build, andbun run testall pass (3981 pass, 0 fail).src/provider/context-window.test.ts).withTestRenderer-based frame captures for the provider level, the model level, escape-back-to-provider, and a short terminal that must scroll (src/tui-opentui/product-host.test.ts).Closes CL-5587
Closes CL-5591
Closes CL-5590