diff --git a/desktop/src/features/agents/lib/formatAgentModelLabel.ts b/desktop/src/features/agents/lib/formatAgentModelLabel.ts index e0595e4f6..7f83fe704 100644 --- a/desktop/src/features/agents/lib/formatAgentModelLabel.ts +++ b/desktop/src/features/agents/lib/formatAgentModelLabel.ts @@ -1,11 +1,11 @@ -import { DATABRICKS_MODEL_NAMES } from "./databricksModelNames"; +import { DATABRICKS_MODEL_NAMES } from "../ui/modelCapabilities"; /** * Resolves a human-readable label for a model, following the three-tier * precedence documented in AGENTS.md: * * 1. Nonblank discovered/API name (e.g. from AgentModelInfo.name) - * 2. Registry lookup by ID (models.dev-seeded Databricks table) + * 2. Registry lookup by ID (generated registry_label table from model-capabilities manifest) * 3. Raw ID unchanged * * Returns the empty string when both id and discoveredName are blank. diff --git a/desktop/src/features/agents/ui/buzzAgentConfig.ts b/desktop/src/features/agents/ui/buzzAgentConfig.ts index be663c35c..e9c931a98 100644 --- a/desktop/src/features/agents/ui/buzzAgentConfig.ts +++ b/desktop/src/features/agents/ui/buzzAgentConfig.ts @@ -1,9 +1,11 @@ /** * Source-of-truth constants for buzz-agent model-tuning configuration knobs. * - * Values must stay in sync with `crates/buzz-agent/src/config.rs` - * `parse_thinking_effort` — that function is the authoritative list. + * Phase 2b: getProviderEffortConfigFromManifest() is the new generated-manifest + * path. getProviderEffortConfig() (legacy hand-tables) stays live for the + * differential harness until Phase 3 retires it. */ +import { resolveModelCapabilities } from "./modelCapabilities"; /** Env var key for the thinking/effort level sent to the LLM. */ export const BUZZ_AGENT_THINKING_EFFORT = "BUZZ_AGENT_THINKING_EFFORT"; @@ -307,3 +309,30 @@ function openaiConfig(m: string): ProviderEffortConfig { export function isBuzzAgentRuntime(runtimeId: string): boolean { return runtimeId === "buzz-agent"; } + +// --------------------------------------------------------------------------- +// Generated-manifest path (Phase 2b) — thin lookup over resolveModelCapabilities +// --------------------------------------------------------------------------- + +/** + * Returns the valid thinking-effort values and semantic default for the + * given provider and model, resolved from the generated model-capabilities + * manifest (modelCapabilities.ts). + * + * This is the Phase 2b replacement path for getProviderEffortConfig(). + * Both paths are live until Phase 3 retires getProviderEffortConfig(). + * + * The manifest's `supportedEfforts` maps to `validValues`; `defaultEffort` + * (which may be null for manual-budget models — "Inherit" is the natural + * default) maps to `defaultValue`. + */ +export function getProviderEffortConfigFromManifest( + providerId: string, + model?: string, +): ProviderEffortConfig { + const cap = resolveModelCapabilities(providerId, model ?? ""); + return { + validValues: cap.supportedEfforts, + defaultValue: cap.defaultEffort, + }; +}