Files
orca/src/shared/agent-session-option-catalog-codebuddy.ts
T
Jinjing f873aaac5b Fix duplicate session option flags and preserve argument values (#25382)
* Fix duplicate session option flags and preserve argument values

* improve tests
2026-10-04 21:57:55 -07:00

42 lines
1.5 KiB
TypeScript

import { removeAgentArgOption } from './agent-session-option-agent-args'
import type { AgentSessionOptionCatalog, CatalogOption } from './agent-session-option-catalog-types'
const CODEBUDDY_EFFORT: CatalogOption = {
id: 'effort',
label: 'Reasoning effort',
category: 'thought_level',
kind: {
type: 'select',
choices: [
{ value: 'minimal', label: 'Minimal' },
{ value: 'low', label: 'Low' },
{ value: 'medium', label: 'Medium' },
{ value: 'high', label: 'High' },
{ value: 'xhigh', label: 'Extra high' },
{ value: 'max', label: 'Max' }
],
defaultValue: 'medium'
},
apply: {
launchArgs: (value) => ['--effort', String(value)],
removeAgentArgs: (tokens) => removeAgentArgOption('codebuddy', tokens, ['--effort'])
}
}
export const CODEBUDDY_SESSION_OPTION_CATALOG: AgentSessionOptionCatalog = {
supportsWorkerLaunchPreferences: true,
// Stable CLI aliases let CodeBuddy resolve the account's current model choices.
models: [
{ id: 'default-model', label: 'Default' },
{ id: 'fast-model', label: 'Fast' },
{ id: 'balanced-model', label: 'Balanced' },
{ id: 'primary-model', label: 'Primary' },
{ id: 'deep-model', label: 'Deep' }
].map((model) => ({ ...model, options: [CODEBUDDY_EFFORT] })),
modelApply: {
launchArgs: (value) => ['--model', String(value)],
removeAgentArgs: (tokens) => removeAgentArgOption('codebuddy', tokens, ['--model'])
},
unknownModelOptions: [CODEBUDDY_EFFORT]
}