Both new-session pages (the home graph view's topic dock and /chat/new)
held their model + thinking + knowledge-context choices in plain
useState(undefined) — every navigation reset them to config defaults.
Now both surfaces read/write ONE server-side record
(data/draft-settings.json via GET/PUT /api/settings/draft, the
render-settings pattern): whatever the learner last left the controls on
is what every later visit shows. useDraftSettings loads on mount with a
touch-guard (a slow GET never clobbers a fast choice), saves
optimistically. Session creation still carries the choice into the new
chat exactly as before; per-session settings are untouched.
The PUT validation is the exact per-chat contract — parseSettingsBody
extracted verbatim from app/api/chats/[id]/settings and shared by both
routes (unknown model/level → 400 with the supported list, never a
silent clamp). 400s on garbage, {} = the clear-overrides write.
Live-verified: Cmd+K+Enter model pick, Shift+Tab thinking cycle, context
slider — all held across home → session → home → /chat/new, and carried
into a created session's record.
19 lines
731 B
TypeScript
19 lines
731 B
TypeScript
/**
|
|
* THE SERVER-SIDE SURFACE — the only src module (besides the core barrel)
|
|
* that app/ may import. Route handlers and server components come through
|
|
* here; nothing under app/ touches src/store or src/agent directly.
|
|
*/
|
|
|
|
export * from "./chat-handler.ts";
|
|
export * from "./chats.ts";
|
|
export * from "./graph.ts";
|
|
export * from "./commit-positions.ts";
|
|
export * from "./jobs.ts";
|
|
export * from "./stores.ts";
|
|
export { readRenderSettings, writeRenderSettings } from "../store/render-settings.ts";
|
|
export { readDraftSettings, writeDraftSettings } from "../store/draft-settings.ts";
|
|
export * from "./settings-body.ts";
|
|
export * from "./turn-liveness.ts";
|
|
export * from "./observability.ts";
|
|
export * from "./model-catalog.ts";
|