ai: composer chip inherits active config's reasoning default
Pulls the reasoning storage out of ai.tsx and into the shared llm-configs.ts helpers so Settings → LLM and the /ai composer coordinate via one localStorage key (crema.ai.reasoning): - loadActiveReasoning / saveActiveReasoning: read/write helpers. - subscribeActiveReasoning: dispatches a CustomEvent on writes (same-tab) plus a storage-event listener (cross-tab), so the chip updates live when the operator stars a different config in another tab or in the settings panel. Wiring: - Settings panel onMakeActive() now also calls saveActiveReasoning(c.reasoning_effort ?? "off"). Starring a config seeds the chip with that config's default. - /ai chip useEffect subscribes to changes; a star in Settings while /ai is open flips the chip in real time. - resetAndClear no longer wipes reasoningEffort. Clearing the conversation shouldn't silently undo the operator's stated intent for thinking-mode (which is bound to their active config, not to the conversation). Net behaviour: - Star a config with reasoning_effort=medium → chip on /ai shows THINK MEDIUM next time you visit (or immediately if /ai is open). - Cycle the chip while on /ai → just an override for the current conversation, not back-propagated to the saved config. - Edit the config in Settings to change its default → propagates to the chip on next star (intentional — direct edits don't auto- re-activate). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,7 @@ import {
|
||||
getUsageSummary,
|
||||
listConfigurations,
|
||||
REASONING_EFFORTS,
|
||||
saveActiveReasoning,
|
||||
updateConfiguration,
|
||||
type CatalogEntry,
|
||||
type LlmConfiguration,
|
||||
@@ -134,6 +135,10 @@ export function LlmConfigurationsPanel() {
|
||||
baseURL: c.base_url || undefined,
|
||||
secretName: c.secret_name || undefined,
|
||||
})
|
||||
// Inherit this config's reasoning default. The /ai composer chip
|
||||
// listens for this and updates live; if the operator already
|
||||
// override it via the chip, the next save propagates here.
|
||||
saveActiveReasoning(c.reasoning_effort ?? "off")
|
||||
setActive(loadActiveSettings())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user