Skip to content

Fix context window, drop model tiers, and pick a provider before a model - #363

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-5590-model-surface
Aug 7, 2026
Merged

Fix context window, drop model tiers, and pick a provider before a model#363
TheGreatAxios merged 3 commits into
mainfrom
cl-5590-model-surface

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Custom-named providers (e.g. an account label like 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.
  • Model tiers (fast/standard/clever) are removed end to end — config, settings, /fast /standard /clever commands, 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 a tiers key 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.
  • The model picker now lists providers first (one row per account), not every provider-account-model combination. Selecting a provider descends into its models; Escape at the model level returns to the provider level instead of closing the picker. Recent/favorites stay flat at the top so the default model is reachable without descending, and the active pick reads "(current)".
  • The picker footer now reads reasoning support plus context size (e.g. "Deep reasoning. 500k context." or "Reasoning support unknown. 128k context (estimated)."), settled once across all three changes rather than three times.

Verification

  • bun run typecheck, bun run build, and bun run test all pass (3981 pass, 0 fail).
  • Added a failing-first test for the custom-provider context window lookup (src/provider/context-window.test.ts).
  • Added 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

@linear-code

linear-code Bot commented Aug 7, 2026

Copy link
Copy Markdown

CL-5587

CL-5591

CL-5590

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
TheGreatAxios force-pushed the cl-5590-model-surface branch from 4bb4d34 to 732dfba Compare August 7, 2026 08:09
@TheGreatAxios
TheGreatAxios merged commit 794670e into main Aug 7, 2026
2 checks passed
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.

1 participant