Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion apps/desktop/src/app/session/hooks/use-model-controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function useModelControls({ activeSessionId, queryClient, requestGateway
await requestGateway('config.set', {
session_id: activeSessionId,
key: 'model',
value: `${selection.model} --provider ${selection.provider}`
value: `${selection.model} --provider ${selection.provider} --session`
})

void queryClient.invalidateQueries({ queryKey: ['model-options', activeSessionId] })
Expand Down
5 changes: 4 additions & 1 deletion ui-tui/src/app/slash/commands/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ const modelValueForConfigSet = (arg: string) => {
}

if (TUI_SESSION_MODEL_RE.test(trimmed)) {
return stripTuiSessionFlag(trimmed)
// Convert --tui-session → --session so the gateway's parse_model_flags()
// recognises the intent as session-scoped instead of persisting globally.
const stripped = stripTuiSessionFlag(trimmed)
return `${stripped} --session`.trim()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This correctly fixes the primary overlay slash path, but the other TUI ModelPicker flow is still unscoped: ActiveSessionSwitcher uses allowPersistGlobal={false} at ui-tui/src/components/activeSessionSwitcher.tsx:663-669, strips the sentinel at :207-219, and startPromptLiveSession() forwards the plain value at ui-tui/src/app/useMainApp.ts:119-123. Please carry --session through that path too.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roger that

}

return trimmed
Expand Down