wip: context-meter + model-label UI and provider/inference tweaks
Checkpoint of in-flight work so the orchestrator branch can rebase onto a clean main: ContextBar → ContextMeter, model-label helper, model/agent picker + provider-snapshot/registry changes, inference payload + message-columns. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -47,17 +47,18 @@ export const PROVIDERS: ProviderDef[] = [
|
||||
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
|
||||
// Passed verbatim to `claude --model <id>` (PTY dispatch). Pinned full
|
||||
// names; the `[1m]` suffix selects the 1M-context variant of that model
|
||||
// (e.g. `claude --model claude-opus-4-8[1m]`). First entry is the default
|
||||
// (the snapshot carries no isDefault, so the frontend falls back to
|
||||
// models[0]). 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[1m]', label: 'Opus 4.8 1M' },
|
||||
{ id: 'claude-opus-4-8', label: 'Opus 4.8' },
|
||||
{ id: 'sonnet', label: 'Sonnet (latest)' },
|
||||
{ id: 'claude-sonnet-4-6[1m]', label: 'Sonnet 4.6 1M' },
|
||||
{ id: 'claude-sonnet-4-6', label: 'Sonnet 4.6' },
|
||||
{ id: 'haiku', label: 'Haiku (latest)' },
|
||||
{ id: 'claude-haiku-4-5-20251001[1m]', label: 'Haiku 4.5 1M' },
|
||||
{ id: 'claude-haiku-4-5-20251001', label: 'Haiku 4.5' },
|
||||
],
|
||||
},
|
||||
|
||||
@@ -34,7 +34,14 @@ export async function fetchLlamaSwapModels(config: Config): Promise<ProviderMode
|
||||
const res = await fetch(`${config.LLAMA_SWAP_URL}/v1/models`);
|
||||
if (!res.ok) return [];
|
||||
const parsed = (await res.json()) as { data?: Array<{ id: string }> };
|
||||
return (parsed.data ?? []).map((m) => ({ id: m.id, label: m.id }));
|
||||
const models = (parsed.data ?? []).map((m) => ({ id: m.id, label: m.id }));
|
||||
// Hoist the configured DEFAULT_MODEL to the front so the BooCoder picker —
|
||||
// which defaults to models[0] (no isDefault on llama-swap entries) — selects
|
||||
// the same model the dispatcher falls back to. Rest keep llama-swap's order.
|
||||
const def = config.DEFAULT_MODEL;
|
||||
const i = models.findIndex((m) => m.id === def);
|
||||
if (i > 0) models.unshift(models.splice(i, 1)[0]!);
|
||||
return models;
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user