Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions packages/tui/src/context/local.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,18 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
selected() {
const m = currentModel()
if (!m) return undefined
const key = `${m.providerID}/${m.modelID}`
return modelStore.variant[key]
const a = agent.current()
const modelKey = `${m.providerID}/${m.modelID}`
// Manual overrides are keyed per agent+model so agents that pin
// different reasoning efforts on the same model stay distinct
// (e.g. quick=low, build=high, debug=max). Falls back to the
// agent's configured variant, then to no variant at all — the
// server then applies the agent's own variant server-side.
const key = a ? `${a.name}:${modelKey}` : modelKey
const manual = modelStore.variant[key]
if (manual !== undefined) return manual
if (a?.variant && this.list().includes(a.variant)) return a.variant
return undefined
},
current() {
const v = this.selected()
Expand All @@ -383,7 +393,9 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
set(value: string | undefined) {
const m = currentModel()
if (!m) return
const key = `${m.providerID}/${m.modelID}`
const a = agent.current()
const modelKey = `${m.providerID}/${m.modelID}`
const key = a ? `${a.name}:${modelKey}` : modelKey
setModelStore("variant", key, value ?? "default")
save()
},
Expand Down
Loading