diff --git a/ui/src/api/agents.ts b/ui/src/api/agents.ts index 197a8995523..d3e79fc06ed 100644 --- a/ui/src/api/agents.ts +++ b/ui/src/api/agents.ts @@ -13,6 +13,10 @@ import type { Approval, AgentConfigRevision, } from "@paperclipai/shared"; +import type { + AdapterModelProfileDefinition, + AdapterModelProfileKey, +} from "@paperclipai/adapter-utils"; import { isUuidLike, normalizeAgentUrlKey } from "@paperclipai/shared"; import { ApiError, api } from "./client"; @@ -28,15 +32,8 @@ export interface AdapterModel { label: string; } -export type AdapterModelProfileKey = "cheap"; - -export interface AdapterModelProfile { - key: AdapterModelProfileKey; - label: string; - description?: string; - adapterConfig: Record; - source?: "adapter_default" | "discovered"; -} +export type { AdapterModelProfileKey }; +export type AdapterModelProfile = AdapterModelProfileDefinition; export interface DetectedAdapterModel { model: string; diff --git a/ui/src/components/IssueRunLedger.test.tsx b/ui/src/components/IssueRunLedger.test.tsx index 94e89e1c797..e3baabc4420 100644 --- a/ui/src/components/IssueRunLedger.test.tsx +++ b/ui/src/components/IssueRunLedger.test.tsx @@ -451,7 +451,7 @@ describe("IssueRunLedger", () => { resultJson: { modelProfile: { requested: "cheap", - applied: "primary", + applied: null, configSource: null, fallbackReason: "agent_runtime_profile_disabled", }, @@ -461,7 +461,7 @@ describe("IssueRunLedger", () => { }); expect(container.textContent).toContain("Profile: cheap"); - expect(container.textContent).toContain("Profile: cheap → primary"); + expect(container.textContent).toContain("Profile: cheap (unavailable)"); expect(container.textContent).toContain("Cheap profile fell back to primary"); expect(container.textContent).toContain("agent_runtime_profile_disabled"); }); diff --git a/ui/src/lib/new-agent-runtime-config.test.ts b/ui/src/lib/new-agent-runtime-config.test.ts index e44fc0248ce..f33cdc8538a 100644 --- a/ui/src/lib/new-agent-runtime-config.test.ts +++ b/ui/src/lib/new-agent-runtime-config.test.ts @@ -37,6 +37,7 @@ describe("buildNewAgentRuntimeConfig", () => { heartbeatEnabled: true, intervalSec: 600, cheapModel: "claude-sonnet-4-6", + cheapModelEnabled: true, }); expect(config.modelProfiles).toEqual({ diff --git a/ui/src/lib/new-agent-runtime-config.ts b/ui/src/lib/new-agent-runtime-config.ts index 4eb71f68a8a..0e106b984d8 100644 --- a/ui/src/lib/new-agent-runtime-config.ts +++ b/ui/src/lib/new-agent-runtime-config.ts @@ -18,7 +18,7 @@ export function buildNewAgentRuntimeConfig(input?: { }; const cheapModel = input?.cheapModel?.trim() ?? ""; - const cheapEnabled = input?.cheapModelEnabled !== false; + const cheapEnabled = input?.cheapModelEnabled ?? false; if (cheapModel && cheapEnabled) { config.modelProfiles = { cheap: {