Skip to content

feat(chat): add a custom model id entry to the model picker - #641

Open
Adam-Dalloul wants to merge 1 commit into
xintaofei:mainfrom
Adam-Dalloul:feat/custom-model-id-entry
Open

feat(chat): add a custom model id entry to the model picker#641
Adam-Dalloul wants to merge 1 commit into
xintaofei:mainfrom
Adam-Dalloul:feat/custom-model-id-entry

Conversation

@Adam-Dalloul

Copy link
Copy Markdown
Contributor

Anthropic shipped claude-fable-5-1 days before their published picker list included it: the newest claude adapter advertises only the five curated entries, yet the id already works on the wire (verified live, the model answers). The adapter even handles an out-of-picker id deliberately, per its own source: "The switched-to model may not be among the options ... we track the raw id: the picker shows no selection, but the model-dependent bookkeeping and any later setModel round-trip stay truthful to what the SDK is running." Codeg just offered no way to type one.

Every model-picker surface (the inline dropdown, the searchable popover, the collapsed cog panel) now ends in a "Use custom model ID..." row that opens a small entry dialog. The trimmed id goes through the exact same path as picking an advertised option, for the model option only, with nothing per-agent and no validation beyond trim: agents that reject simply reject.

Three honesty properties. A current id outside the advertised options renders as the raw id on every trigger, now pinned by a test. A pick the agent settles elsewhere still raises the config_option_rejected toast naming the typed id, and a set the agent refuses outright now re-emits the last adopted option list before the error (the same revert-then-report recovery the Grok cross-agent switch uses) instead of leaving the refused id on the trigger. The typed id persists in the saved selector preferences and replays at the next connect like any picked value.

Sibling options follow the agent's own answer: a model switch that rebuilds the option list replaces the selector wholesale, so when claude's per-model effort seeding drops effort for a custom id, the effort selector disappears rather than offering levels that would silently no-op.

A brand-new model is often live on the wire days before an agent's curated
list catches up (claude-fable-5-1 answered while the published picker list
still lacked it), and the stack already handles out-of-picker ids: the
claude adapter deliberately tracks the raw id of a model outside its
options, and every codeg trigger falls back to rendering that raw id. The
only missing piece was a place to type one.

Each model-picker surface (the inline dropdown, the searchable popover,
and the collapsed cog panel) now ends in a "Use custom model ID..." row
opening a small entry dialog. The trimmed id takes the exact path an
advertised pick takes: optimistic apply, saved preference, and
session/set_config_option (Grok's set_model variant included), so an agent
that adopts it runs it, one that settles elsewhere raises the existing
config_option_rejected toast naming the typed id, and the preference
replays on the next connect. Model option only, no per-agent code, no
validation beyond trim.

One rejection shape was silent before: an agent that refuses the set
outright (a JSON-RPC error, e.g. an id claude cannot resolve) emitted only
a recoverable Error, so the composer kept showing an optimistic value the
agent never ran. A failed set now re-emits the last adopted option list
first, the same revert-then-report recovery the Grok cross-agent-type
switch already uses. Sibling options stay honest for free: an agent
answering a model switch with a rebuilt list (claude seeds effort levels
per model, and a custom id carries none, so effort drops out) replaces the
selector wholesale, and a new test pins that adoption.
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