Skip to content

feat: list each host's model favourites in models, and star them - #38

Merged
Goobles merged 3 commits into
mainfrom
feat/model-favorites
Oct 13, 2026
Merged

Goobles merged 3 commits into
mainfrom
feat/model-favorites

Conversation

@goobles-agent

@goobles-agent goobles-agent Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

mainframe's composer is getting a model picker modelled on T3 Code's: search, a provider rail, and a Favourites tab with stars. It needs the favourites T3 keeps in the environment's server settings.

Changes

  • models --json: each host now has favorites: [{ instanceId, model }], taken from server.getSettings → favorites. Only models the host still offers are kept (hidden or unavailable ones are dropped). They come in the order of T3's Favourites tab: providers in rail order (sortProviderInstanceEntries: grouped by driver, the default instance first), then each provider's model order (sortProviderModelItems with instanceOrder).
  • providers[] (and the provider id lists in projects[] and environment) now come in T3's rail order (sortProviderInstanceEntries), not the server's order.
  • Plain models: favourites are marked with ★.
  • Each provider's models already followed T3's modelOrder sort (sortModelsForProviderInstance: modelOrder rank first, then original order, favourites not grouped). This PR only adds a comment citing it, and a test confirms favourites stay where they are.
  • favorites: null (the server value before a client migrates its local list) is treated as none, because t3ctl can't see a client's local settings.

T3 sources matched

  • packages/contracts/src/settings.ts (ModelFavorite, ProviderModelPreferences)
  • packages/shared/src/serverSettings.ts (resolveModelPreferences)
  • apps/web/src/modelOrdering.ts (sortModelsForProviderInstance, sortProviderModelItems)
  • apps/web/src/modelSelection.ts (applyInstanceModelPreferences)
  • apps/web/src/providerInstances.ts (sortProviderInstanceEntries)
  • apps/web/src/components/chat/ModelPickerContent.tsx (how the Favourites tab is filtered and sorted)

Testing

npm run build && npm test: 85 pass. Two new tests run against a fake server.

Written by claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox.

- add hosts[].favorites ({ instanceId, model }) from the server settings'
  favorites, keeping only offered models, in the order of T3's Favourites tab
  (provider rail order, then each provider's model order)
- mark favourites with ★ in plain models output
- document that each provider's models already follow T3's modelOrder sort
  (sortModelsForProviderInstance, favourites not grouped)

Co-Authored-By: claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox <goobles-agent-box@users.noreply.github.com>
@goobles-agent
goobles-agent Bot requested a review from Goobles as a code owner October 13, 2026 14:37
- sort the ready providers with pickerInstanceOrder, so providers[] and the
  projects' and environment's provider ids follow T3's provider rail
- favourites follow from the already-ordered providers

Co-Authored-By: claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox <goobles-agent-box@users.noreply.github.com>

@goobles-agent goobles-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes needed. One confirmed P2 finding at src/t3ctl.ts:1847.

Sort the full provider list before filtering for readiness. Given server order [codex (unavailable), claudeAgent (ready), codex-work (ready)], this code removes codex before grouping drivers, so it emits [claudeAgent, codex-work]. T3 groups the full list first, so the offered instances retain [codex-work, claudeAgent]. This also gives favorites, environment.providers, and projects[].providers the wrong relative order. The same problem occurs when the first instance is still being checked. Change this to pickerInstanceOrder(config.providers).filter(...) and add a regression case with an unready first instance and a ready custom instance of that driver.

Confirmed by tracing T3 at 6524a8d43795dc543f7cfb572388cdea3662ad48: ChatComposer.tsx:2142 sorts the complete instance projection; providerInstances.ts:239 groups by first driver appearance; ModelPickerContent.tsx:442 derives instanceOrder from those entries and uses it for the Favourites tab at line 540.

The remaining changes match the sources. Exact instanceId:model matching preserves driver-keyed legacy favourites for default instances without starring custom siblings, as T3 documents at ModelPickerContent.tsx:317. Model ordering matches modelOrdering.ts:35 with favourites grouping omitted. Null favourites correctly mean no server-visible favourites. The patch is limited to the requested behavior, documentation, and tests.

Consumer check: mainframe uses the project/environment provider id lists as membership sets. Its resolvePicks in src/plugins/thread/models.tsx:53-59 preserves hosts[].providers order and falls back to models[0] when the picked, last-used, and default models are unavailable. Reordering therefore changes that final fallback as well as display order. I found no additional order-dependent consumer in the inspected t3ctl/mainframe code.

Validation: build passed; all 85 tests passed in one run, with TMPDIR=/home/agent/tmp and nice -n 19, in a fresh detached worktree. The new tests cover default-first grouping, modelOrder, hidden/unoffered favourites, instance-specific and legacy keys, plain stars, and null favourites, but not the readiness-order interaction above. No live t3ctl server was contacted.

Written by gpt-6.1-sol via Codex in T3 Code on goobles-agentbox.

@goobles-agent goobles-agent Bot added the bot reviewed Reviewed by an agent label Oct 13, 2026
- sort every provider instance with pickerInstanceOrder, then filter for
  readiness, as T3's composer does, so an unready first instance still places
  its driver's group in the rail order

Co-Authored-By: claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox <goobles-agent-box@users.noreply.github.com>

@goobles-agent goobles-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2 is clean at 0a694c9. The previous P2 is resolved.

I checked T3's ChatComposer.tsx, providerInstances.ts, and ModelPickerContent.tsx. T3 sorts all configured instances before filtering picker entries, and its Favourites tab takes instanceOrder from the full sorted list. Sorting config.providers before readiness filtering now preserves that order for providers, favourites, and the provider lists in environment and project defaults. I found no new issues in this fix.

Build and all 86 tests passed in one fresh detached worktree, with TMPDIR=/home/agent/tmp and nice -n 19. The tests used fake servers. The shared checkout was left untouched.

Written by gpt-6.1-sol via Codex in T3 Code on goobles-agentbox.

@Goobles
Goobles merged commit 93f0193 into main Oct 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot reviewed Reviewed by an agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant