rowboat/apps
PRAKHAR PANDEY 2274369383
Feat/model selector (#770)
* feat(x): add useModels hook — shared model-catalog store

One module-level store behind useSyncExternalStore: N mounted consumers
share one snapshot and one in-flight fetch (models:list + models.json +
oauth state + llm:getDefaultModel). Re-fetches on models-config-changed,
oauth:didConnect and chatgpt:statusChanged; newest-wins seq guard ports
the composer's epoch race protection. Extracted verbatim from the chat
composer's loadModelConfig for the ModelSelector consolidation (Phase 1).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(x): add ModelSelector extracted from the chat composer

Controlled picker ({provider, model} value + onChange, persistence stays
with the caller) rendering the composer's exact UI: provider-grouped
catalog + live groups via useProviderModels, search filter, standalone
default row, locked-model display, and the reasoning-effort control
(shown only for catalog-flagged reasoning models, '' reported up when
the model loses reasoning support). Catalog comes from useModels().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(x): migrate chat composer to useModels + ModelSelector

Deletes the composer's inline copies of the catalog loader (oauth state,
llm:getDefaultModel, models:list, models.json parsing, event listeners)
and the picker/effort dropdown JSX in favor of the shared hook and
component. Behavior preserved: picks persist globally via
models:updateConfig({defaultSelection}) + models-config-changed dispatch,
locked-model display, per-turn unpersisted reasoning effort, and the
tab-activation re-fetch. SelectedModel/ReasoningEffortLevel exports stay
for existing consumers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(x): ModelSelector settings modes — sentinel, field trigger, provider scoping, custom ids

defaultOption pins a top entry that selects null ('Rowboat default' /
'Same as assistant'); variant='field' renders a SelectTrigger-style
full-width box; providerFilter scopes to one provider's group, falling
back to the raw models:list catalog (newly exposed on the useModels
snapshot as catalogByProvider) for providers mid-setup; allowCustom
offers a Use-"<text>" row when the search matches nothing. onChange
widens to ModelRef | null — the composer guards the (unreachable
without defaultOption) null and is otherwise untouched. Still zero
persistence inside the component.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(x): signed-in Settings Models section on ModelSelector

The four hybrid dropdowns (Assistant / Knowledge graph / Background
agents / Permission checks) become field-variant ModelSelectors with a
'Rowboat default' sentinel, sourcing the shared store's groups — BYOK
providers without a static catalog (e.g. OpenRouter) now live-fetch
their full list inside the open dropdown instead of showing only the
saved model (user-reported bug). State is ModelRef | null; the
provider::model hybridKey round-trip, options collector, and local
providerDisplayNames map are gone. Persistence unchanged: nothing
writes until Save's single models:updateConfig + models-config-changed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(x): BYOK per-provider category fields on ModelSelector

Knowledge graph / Meeting notes / Track block / Auto-permission become
provider-scoped field-variant ModelSelectors (providerFilter=active
card, allowCustom, 'Same as assistant' sentinel), replacing the static
catalog Select + free-text Input pair. Values still persist as bare
model-id strings inside providers[flavor] through the existing save
path — the ModelRef ↔ string adapter lives at the call site. Deletes
the section's own models:list loader (modelsCatalog/modelsLoading/
showModelInput/LlmModelOption); scoped pickers fall back to the store's
catalogByProvider for providers mid-setup, and configured providers now
live-fetch full lists (OpenRouter bug fix on the BYOK side too).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(x): assert defaultModel refreshes on models-config-changed

Covers the settings-Save → event → store refetch leg that updates a
fresh composer tab's trigger label.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(x): ModelSelector inheritance mode + un-scoped custom ids

inheritDefault?: {label} is defaultOption with placeholder styling —
one sentinel code path, the trigger renders the label muted when
nothing overrides. allowCustom no longer requires providerFilter: an
un-scoped custom entry splits 'provider/model' on the first slash
(OpenRouter-style ids must be typed provider-qualified) and pairs
slash-less text with the global default's provider, matching how the
runtime resolves a provider-less override. Adds modelOverrideToRef /
refToModelOverride adapters for the two-optional-strings persistence
shape shared by BackgroundTask and LiveNote.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(x): bg-task model/provider override on ModelSelector

The Advanced section's two free-text Inputs become one inheritance-mode
picker ('(global default)' sentinel, allowCustom for arbitrary ids).
Same draft state and bg-task:patch save path; a task with model set but
no provider round-trips untouched via the shared override adapters.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(x): live-note model/provider override on ModelSelector

Same inheritance-mode picker as bg-tasks (the section was a copy-paste
of it), same shared adapters, unchanged live-note:set save path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(x): EnableAgentsDialog model picker on ModelSelector

Replaces the flat models:list-flattening <select> with an
inheritance-mode picker pre-seeded from the pinned agent's bg-task
model/provider. '(default)' (null) still enables with an active-only
patch so agents keep their pinned model; a picked model still patches
each bundled agent once. Drops the dialog's private catalog fetch —
the shared store already has the data.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(x): ModelSelector staticOptions mode for caller-supplied lists

When staticOptions is set the picker renders ONLY those rows (+ the
defaultOption sentinel) — no catalog groups, no live fetches. Entries
are opaque engine ids carried in ref.model with provider '', so
call-site adapters stay one-liners ('default' ↔ null, id ↔ string).
Rows whose label differs from their id show the id as secondary text,
disambiguating Claude's colliding 'Opus' labels (alias + concrete id).
Adds toSelectorOptions() in code-agent-options to split an engine list
into sentinel label + rows, and a triggerTitle prop for header tooltips.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(x): new-session dialog on ModelSelector

Deletes loadModelOptions() — the admitted composer-mirror duplicate —
in favor of the shared store: the Rowboat-mode picker (still rendered
only for rowboat mode, gated on configured providers) is a field
ModelSelector whose null sentinel keeps 'default → omit model/provider'
create-payload semantics. The agent-model select becomes a
staticOptions picker fed by toSelectorOptions(fetchCodeAgentOptions),
preserving per-agent reload/reset and the 'default → omit agentModel'
payload rule. The effort select stays a plain Select on purpose — a
caller-supplied axis, not model selection.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(x): code session header agent-model picker on ModelSelector

The header's model DropdownMenu becomes a pill ModelSelector with
staticOptions (search + Opus id disambiguation for free); the effort
dropdown stays untouched. codeSession:update payload semantics
unchanged — the sentinel still sends the literal 'default'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(x): delete dead onboarding-modal.tsx

Nothing imports it — App.tsx renders OnboardingModal from
components/onboarding/index.tsx (the steps-based flow). Its rich
four-category model picker was superseded by the silent auto-resolve
in use-onboarding-state; the only other mention was a stale comment in
useConnectors, updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 10:59:35 +05:30
..
cli Small cleanup in rowboat 2026-07-12 21:14:14 +03:00
docs Small cleanup in rowboat 2026-07-12 21:14:14 +03:00
experimental Fix/prebuilt cards updates (#263) 2025-09-16 15:29:48 +05:30
python-sdk update py-sdk docs 2025-08-19 13:35:10 +05:30
rowboat fix: make dev script cross-platform for Windows PowerShell 2026-02-19 13:07:07 +05:30
rowboatx wip-electron 2026-01-16 12:05:33 +05:30
x Feat/model selector (#770) 2026-07-22 10:59:35 +05:30