Fix: getProviderSnapshot returned synchronous installed:false 'loading' entries on a cache miss (v2.5.5/Phase 2), which AgentComposerBar filters out — with the Phase 5 client poll not yet built, a single fetch stranded on 'loading' and the picker showed no providers. It now awaits the build and returns terminal entries; the sync loading-return is deferred until Phase 5. Builds stay fast via the tier-2 cold-probe skip. Feature: wire the v2.3 config schema's models/additionalModels — buildResolvedRegistry carries them onto ResolvedProviderDef (models replace, additionalModels merge) and provider-snapshot applies them to every ready model list, so /data/coder-providers.json can edit any provider's models with no code change. Claude staticModels bumped from the stale 2-entry list to opus/sonnet/haiku latest-aliases + pinned claude-opus-4-8 / claude-sonnet-4-6 / claude-haiku-4-5-20251001 (passed verbatim to claude --model). +2 tests (109 total). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
70 lines
2.1 KiB
TypeScript
70 lines
2.1 KiB
TypeScript
export interface ProviderDef {
|
|
name: string;
|
|
label: string;
|
|
transport: 'native' | 'acp' | 'pty';
|
|
modelSource: 'llama-swap' | 'static' | 'probe';
|
|
staticModels?: Array<{ id: string; label: string }>;
|
|
/** Merge llama-swap models into probed list (OpenCode). */
|
|
mergeLlamaSwap?: boolean;
|
|
}
|
|
|
|
/**
|
|
* Model discovery rules (see provider-snapshot.ts):
|
|
* - boocode: llama-swap only
|
|
* - opencode: ACP probe + mergeLlamaSwap (prefixed llama-swap/* ids)
|
|
* - qwen: ACP probe + merge ~/.qwen/settings.json; PTY fallback reads settings only
|
|
* - goose: ACP probe only
|
|
* - claude: static manifest models + thinking options
|
|
*/
|
|
export const PROVIDERS: ProviderDef[] = [
|
|
{
|
|
name: 'boocode',
|
|
label: 'BooCoder',
|
|
transport: 'native',
|
|
modelSource: 'llama-swap',
|
|
},
|
|
{
|
|
name: 'opencode',
|
|
label: 'OpenCode',
|
|
transport: 'acp',
|
|
modelSource: 'probe',
|
|
mergeLlamaSwap: true,
|
|
},
|
|
{
|
|
name: 'goose',
|
|
label: 'Goose',
|
|
transport: 'acp',
|
|
modelSource: 'probe',
|
|
},
|
|
{
|
|
name: 'claude',
|
|
label: 'Claude Code',
|
|
transport: 'pty',
|
|
modelSource: 'static',
|
|
// Passed verbatim to `claude --model <id>` (PTY dispatch). The CLI accepts a
|
|
// latest-alias ('opus'/'sonnet'/'haiku') or a pinned full name
|
|
// ('claude-opus-4-8'). Aliases never go stale; pinned IDs let you select an
|
|
// exact version. Extend/replace per-install via data/coder-providers.json
|
|
// (models / additionalModels) without a code change.
|
|
staticModels: [
|
|
{ id: 'opus', label: 'Opus (latest)' },
|
|
{ id: 'claude-opus-4-8', label: 'Opus 4.8' },
|
|
{ id: 'sonnet', label: 'Sonnet (latest)' },
|
|
{ id: 'claude-sonnet-4-6', label: 'Sonnet 4.6' },
|
|
{ id: 'haiku', label: 'Haiku (latest)' },
|
|
{ id: 'claude-haiku-4-5-20251001', label: 'Haiku 4.5' },
|
|
],
|
|
},
|
|
{
|
|
name: 'qwen',
|
|
label: 'Qwen Code',
|
|
transport: 'acp',
|
|
modelSource: 'probe',
|
|
},
|
|
];
|
|
|
|
export const PROVIDERS_BY_NAME = new Map(PROVIDERS.map((p) => [p.name, p]));
|
|
|
|
/** External agents probed on host (excludes native boocode). */
|
|
export const PROBED_AGENT_NAMES = PROVIDERS.filter((p) => p.name !== 'boocode').map((p) => p.name);
|