feat: no baked-in default model — the new-session controls ARE the default settings page
Owner reframe (2026-09-18): the model + thinking + context controls on
the home graph view and /chat/new are not a draft overlay on a baked-in
default — they ARE the settings page for the default model, and the
user's last choice IS the default. BYOK first boot has no keys and
possibly no OpenRouter, so there is NO default to show: the controls
render 'no model' ('—') until the first pick.
The flash was the deeper symptom: the surfaces rendered from client
state that started empty and fetched truth afterward, so every visit
flashed the config pin (GLM/low — a dev artifact) for a few frames.
Fix at the root: both pages are now force-dynamic server components
that read the record (readDefaultSettings → initialSettings) and hand
it to the client — the first frame shows truth. Dynamic routes aren't
cached client-side (staleTimes.dynamic = 0), so every navigation
re-reads the record; the useDefaultSettings hook keeps only save-side
state (optimistic set + PUT). The GET-on-mount and its touch-guard are
gone.
ModelControl gains noDefaultModel (the default surfaces only): unset
settings render no model/level, never the catalog pin; the thinking
menu no-ops until a model exists. Chat surfaces keep the catalog
fallback — the engine runs the config pin when a session record has no
override, so the control keeps showing what will actually run.
Renamed draft→default throughout: data/default-settings.json,
GET/PUT /api/settings/defaults, useDefaultSettings. New sessions
still inherit the default on creation exactly as before.
Live-verified: first-boot 'no model' with zero flash, picker +
Shift+Tab cycle, values held across session→/chat/new→home roundtrips
and a reload (10×100ms samples, never the old default), zero console
errors.
This commit is contained in:
@@ -134,9 +134,11 @@ export const EMBEDDINGS_FILE = path.join(PATHS.graph, "embeddings.json");
|
||||
export const RENDER_SETTINGS_FILE = path.join(PATHS.graph, "render-settings.json");
|
||||
|
||||
/**
|
||||
* DRAFT (pre-session) settings — the model + thinking + knowledge-context
|
||||
* selections shared by the two new-session surfaces (the home graph view
|
||||
* and /chat/new). One small JSON blob, read-modify-write, written only
|
||||
* through the validated app/api/settings/draft route.
|
||||
* DEFAULT settings — THE default model + thinking level + knowledge-context
|
||||
* budget (owner, 2026-09-18): the new-session surfaces' controls are the
|
||||
* settings page for the default model. There is NO baked-in default —
|
||||
* BYOK first boot shows "no model" until the user picks one, and their
|
||||
* last choice IS the default from then on. One small JSON blob,
|
||||
* read-modify-write, written only through app/api/settings/defaults.
|
||||
*/
|
||||
export const DRAFT_SETTINGS_FILE = path.join(DATA_ROOT, "draft-settings.json");
|
||||
export const DEFAULT_SETTINGS_FILE = path.join(DATA_ROOT, "default-settings.json");
|
||||
|
||||
Reference in New Issue
Block a user