mirror of
https://github.com/stablyai/orca.git
synced 2026-11-03 02:27:43 +00:00
grok 1.0.41's `grok models` now reports `Default model: grok-4.7` and its model cache advertises low/medium/high/xhigh effort for grok-4.7. Seed it as the CLI default with an xhigh ceiling, keep grok-4.6 and grok-4.5, and move the probe spec default in step with the seed. Fixes STA-9652
59 lines
2.0 KiB
TypeScript
59 lines
2.0 KiB
TypeScript
import { getCommitMessageAgentSpec, type CommitMessageAgentSpec } from './commit-message-agent-spec'
|
|
import { GROK_MODEL_LIST_ARGS, parseGrokModelList } from './grok-model-list-probe'
|
|
import { OMP_MODEL_LIST_ARGS, parseOmpModelList } from './omp-model-list-probe'
|
|
import type { TuiAgent } from './tui-agent'
|
|
|
|
/** Why: model discovery reads only these fields; excluding the prompt-delivery
|
|
* half is what keeps a probe-only agent out of the commit-message registry. */
|
|
export type AgentModelProbeSpec = Omit<CommitMessageAgentSpec, 'promptDelivery' | 'buildArgs'>
|
|
|
|
/** Agents that support model discovery but are not commit-message agents. */
|
|
const MODEL_DISCOVERY_ONLY_SPECS: Partial<Record<TuiAgent, AgentModelProbeSpec>> = {
|
|
grok: {
|
|
id: 'grok',
|
|
label: 'Grok',
|
|
binary: 'grok',
|
|
modelSource: 'dynamic',
|
|
modelDiscovery: {
|
|
binary: 'grok',
|
|
args: GROK_MODEL_LIST_ARGS,
|
|
parse: parseGrokModelList
|
|
},
|
|
// Why: empty so a failed probe degrades to the catalog seed instead of a
|
|
// second model list here that can drift from it.
|
|
models: [],
|
|
defaultModelId: 'grok-4.7'
|
|
},
|
|
omp: {
|
|
id: 'omp',
|
|
label: 'OMP',
|
|
binary: 'omp',
|
|
modelSource: 'dynamic',
|
|
modelDiscovery: {
|
|
binary: 'omp',
|
|
args: OMP_MODEL_LIST_ARGS,
|
|
parse: parseOmpModelList
|
|
},
|
|
// Why: nothing is available on every OMP install, so there is no seed and no
|
|
// default to name; discovery's first row stands in when a default is required.
|
|
models: [],
|
|
defaultModelId: ''
|
|
}
|
|
}
|
|
|
|
export function getAgentModelProbeSpec(agentId: TuiAgent): AgentModelProbeSpec | undefined {
|
|
const spec = getCommitMessageAgentSpec(agentId) ?? MODEL_DISCOVERY_ONLY_SPECS[agentId]
|
|
if (!spec) {
|
|
return undefined
|
|
}
|
|
// OMP's `default` means the provider configured in its own settings, not a selectable model.
|
|
if (agentId !== 'omp') {
|
|
return spec
|
|
}
|
|
return {
|
|
...spec,
|
|
models: spec.models.filter((model) => model.id !== 'default'),
|
|
defaultModelId: spec.defaultModelId === 'default' ? '' : spec.defaultModelId
|
|
}
|
|
}
|