Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/remove-model-reset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Remove the model reset button from the chat and worktree prompt controls.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ While the specifics change constantly, some principles stay consistent:
- Press `Shift+Tab` in the prompt input to cycle to the next reasoning effort variant, wrapping after the last one. This works in the sidebar chat, the Agent Manager prompt, and the New Worktree dialog, and the variant selector tooltip shows the shortcut on hover. To keep `Shift+Tab` for keyboard focus navigation instead, disable the `kilo-code.new.chat.shiftTabCyclesVariant` setting (also available under **Settings → Display**).
- Set per-agent defaults and a global default in the **Settings** panel (Models tab), or directly in the `kilo.jsonc` config file.
- **Model precedence:** Session override → Last picked per agent → Per-agent config → Global config → [Auto Free](/docs/code-with-ai/agents/auto-model#tiers) (note: Auto Free may route to providers that log prompts — see the Auto Model page for details).
- The model selector remembers the last model you picked for each agent switching agents restores your previous choice. A manual pick always beats config settings; use the **reset button** (visible when your active model differs from config) to go back to the config default.
- The model selector remembers the last model you picked for each agent, so switching agents restores your previous choice. A manual pick always beats config settings.

{% /tab %}
{% tab label="CLI" %}
Expand Down

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions packages/kilo-vscode/src/kilo-provider/model-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ export async function handleMessage(
await write(client, "model", model)
return true
}
if (type === "clearModelSelection") {
const data = await read(client)
const model = validateModelSelections(data.model)
delete model[message.agent as string]
await write(client, "model", model)
return true
}
if (type === "requestModelSelections") {
const data = await read(client)
const selections = validateModelSelections(data.model)
Expand Down
47 changes: 0 additions & 47 deletions packages/kilo-vscode/tests/unit/session-model-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,53 +234,6 @@ describe("per-mode model memory", () => {
expect(Object.keys(result.sessionOverrides)).toHaveLength(0)
})

it("clearing both session override and per-mode selection falls back to config default", () => {
let store = emptyStore()
// Simulate mode model set in config (getModeModel returns claude).
const configured: ResolveEnv = {
...env(),
getModeModel: (name) => (name === "code" ? claude : null),
}

// User picked gpt globally for "code"
let result = applyModel(store, "code", gpt, undefined)
store = { ...store, ...result }

// User then overrode the session with claude
result = applyModel(store, "code", claude, "session-a")
store = { ...store, ...result }

// Simulate clearModelOverride: clear both session override and per-mode selection
const reset: ModelStore = {
...store,
sessionOverrides: {},
modelSelections: { ...store.modelSelections, code: null },
}

// Should fall through to the configured per-mode model (claude from config)
expect(getSelected(reset, configured, "session-a", "code")).toEqual(claude)
})

it("clearing only session override but not per-mode selection leaves persisted pick visible", () => {
let store = emptyStore()
const e = env()

// User picked claude globally for "code"
const result = applyModel(store, "code", claude, undefined)
store = { ...store, ...result }

// User then overrode the session with gpt
const r2 = applyModel(store, "code", gpt, "session-a")
store = { ...store, ...r2 }

// Simulate OLD behaviour: only clear session override, leave modelSelections intact
const partial: ModelStore = { ...store, sessionOverrides: {} }

// The persisted per-mode selection (claude) is still returned — this is
// why the reset appeared to "do nothing" when config also resolved to claude.
expect(getSelected(partial, e, "session-a", "code")).toEqual(claude)
})

it("switching from plan to implementation uses implementation config after clearing stale memory", () => {
let store = emptyStore()
const configured: ResolveEnv = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ export const NewWorktreeDialog: Component<{
setVariant(session.variantForAgent(name, sel))
}

const resetModel = () => {
const sel = session.configModelForAgent(agent())
setModel(sel)
setVariant(session.variantForAgent(agent(), sel))
}

const cycle = (direction: 1 | -1) => {
cycleAgent({
agents: session.agents(),
Expand Down Expand Up @@ -252,14 +246,6 @@ export const NewWorktreeDialog: Component<{
return stored && list.includes(stored) ? stored : undefined
})

// True when the user has changed the model from the session/config default
const overridden = createMemo(() => {
const sel = model()
const cfg = session.configModelForAgent(agent())
if (!sel || !cfg) return false
return sel.providerID !== cfg.providerID || sel.modelID !== cfg.modelID
})

// Reset variant when model changes and stored variant is not in new list
createEffect(() => {
const list = variants()
Expand Down Expand Up @@ -895,20 +881,6 @@ export const NewWorktreeDialog: Component<{
deferDismiss
cycleHint={settings()["chat.shiftTabCyclesVariant"] !== false}
/>
<Show when={overridden()}>
<Tooltip value={t("prompt.action.resetModel")} placement="top">
<Button
variant="ghost"
size="small"
onClick={resetModel}
aria-label={t("prompt.action.resetModel")}
>
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
<path d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z" />
</svg>
</Button>
</Tooltip>
</Show>
</Show>
</div>
<div class="prompt-input-hint-actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1522,20 +1522,6 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
<ModeSwitcher sessionID={sid} />
<ModelSelector sessionID={sid} />
<ThinkingSelector sessionID={sid} />
<Show when={session.hasModelOverride(sid())}>
<Tooltip value={language.t("prompt.action.resetModel")} placement="top" openDelay={0}>
<Button
variant="ghost"
size="small"
onClick={() => session.clearModelOverride(sid())}
aria-label={language.t("prompt.action.resetModel")}
>
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
<path d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z" />
</svg>
</Button>
</Tooltip>
</Show>
</div>
<div class="prompt-input-hint-actions">
<Show when={showIndexing()}>
Expand Down
48 changes: 2 additions & 46 deletions packages/kilo-vscode/webview-ui/src/context/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,8 @@ interface SessionContextValue {

// Model selection (global, extension-lifetime)
selected: (sessionID?: string) => ModelSelection | null
configModel: (sessionID?: string) => ModelSelection | null
modelForAgent: (agent: string) => ModelSelection | null
configModelForAgent: (agent: string) => ModelSelection | null
selectModel: (providerID: string, modelID: string, sessionID?: string) => void
hasModelOverride: (sessionID?: string) => boolean
clearModelOverride: (sessionID?: string) => void

// Cost and context usage for the current session
costBreakdown: Accessor<Array<{ label: string; cost: number }>>
Expand Down Expand Up @@ -736,7 +732,7 @@ export const SessionProvider: ParentComponent = (props) => {
})
}

function clearModeModelSelection(agentName: string, persist = false) {
function clearModeModelSelection(agentName: string) {
setUserSetAgents((prev) => {
const next = { ...prev }
delete next[agentName]
Expand All @@ -748,7 +744,6 @@ export const SessionProvider: ParentComponent = (props) => {
delete selections[agentName]
}),
)
if (persist) vscode.postMessage({ type: "clearModelSelection", agent: agentName })
}

function shouldClearModeModelSelection(agentName: string) {
Expand All @@ -765,11 +760,6 @@ export const SessionProvider: ParentComponent = (props) => {
})
}

function configModel(sessionID?: string): ModelSelection | null {
const agentName = agentForScope(sessionID)
return resolveModel(agentName)
}

function modelForAgent(agentName: string): ModelSelection | null {
return getAgentModel(
{
Expand All @@ -790,36 +780,6 @@ export const SessionProvider: ParentComponent = (props) => {
)
}

function configModelForAgent(agentName: string): ModelSelection | null {
return resolveModel(agentName)
}

/** True when the active model differs from what the config dictates. */
function hasModelOverride(sessionID?: string) {
const sel = selected(sessionID)
const cfg = configModel(sessionID)
if (!sel || !cfg) return false
return sel.providerID !== cfg.providerID || sel.modelID !== cfg.modelID
}

/** Clear the per-mode model override, falling back to config default. */
function clearModelOverride(sessionID?: string) {
const sid = sessionID ?? currentSessionID()
const agentName = sid ? agentForScope(sid) : selectedAgentName()
// Always clear the persisted per-mode model selection so the user's
// configured (or fallback) model becomes effective, not the last manual pick.
clearModeModelSelection(agentName, true)
if (sid) {
setStore(
"sessionOverrides",
produce((overrides) => {
delete overrides[sid]
}),
)
hideErrors(sid)
}
}

// Handle agentsLoaded immediately (not in onMount) so we never miss
// the initial push that arrives before the DOM mounts. This mirrors the
// pattern used by ProviderProvider for providersLoaded.
Expand Down Expand Up @@ -932,7 +892,7 @@ export const SessionProvider: ParentComponent = (props) => {
onCleanup(variants.load())

// Load persisted per-mode model selections from model.json via extension host.
// Uses replace semantics so a reset (empty payload) clears old entries.
// Uses replace semantics so an empty payload clears old entries.
const unsubSelections = vscode.onMessage((message: ExtensionMessage) => {
if (message.type !== "modelSelectionsLoaded") return
setStore("modelSelections", reconcile(message.selections))
Expand Down Expand Up @@ -2994,12 +2954,8 @@ export const SessionProvider: ParentComponent = (props) => {
scopedQuestions,
scopedSuggestions,
selected,
configModel,
modelForAgent,
configModelForAgent,
selectModel,
hasModelOverride,
clearModelOverride,
costBreakdown,
contextUsage,
modelUsage,
Expand Down
1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/ar.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/br.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/bs.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/da.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ export const dict = {
"Automatische Genehmigung ist aktiviert. Berechtigungsanfragen werden automatisch genehmigt.",
"prompt.action.autoApprove.disabled":
"Automatische Genehmigung ist deaktiviert. Klicken, um Berechtigungsanfragen automatisch zu genehmigen.",
"prompt.action.resetModel": "Modell auf Standard zurücksetzen",
"prompt.action.enhanceDescription":
"Die Schaltfläche 'Prompt verbessern' hilft, deine Anfrage durch zusätzlichen Kontext, Klarstellungen oder Umformulierungen zu verbessern. Versuche, hier eine Anfrage einzugeben und klicke erneut auf die Schaltfläche, um zu sehen, wie es funktioniert.",
"prompt.action.sandbox.enable": "Sandbox aktivieren",
Expand Down
1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export const dict = {
"prompt.action.sandbox.description.disabled": "Click to restrict filesystem writes and network access.",
"prompt.action.sandbox.description.disabledNetworkAllowed":
"Click to restrict filesystem writes. Network access remains allowed by your sandbox settings.",
"prompt.action.resetModel": "Reset model to default",
"prompt.action.enhanceDescription":
"The 'Enhance Prompt' button helps improve your prompt by providing additional context, clarification, or rephrasing. Try typing a prompt in here and clicking the button again to see how it works.",
"speechToText.tooltip.start": "Start voice input with Kilo Gateway",
Expand Down
1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/es.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/fa.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/fr.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/it.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/ja.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading