fix(settings): require explicit inference profile capability

This commit is contained in:
ayattara
2026-08-25 09:51:49 +00:00
parent 8873b88165
commit 563882f709
3 changed files with 4 additions and 1 deletions
@@ -25,6 +25,7 @@ const profile = (overrides: Partial<AgentProfileOption>): AgentProfileOption =>
agent_name: "claude",
cli_passthrough: false,
enabled: true,
inference_capable: true,
...overrides,
});
@@ -9,6 +9,7 @@ const profile = (overrides: Partial<AgentProfileOption> = {}): AgentProfileOptio
agent_name: "Mock",
cli_passthrough: false,
enabled: true,
inference_capable: true,
...overrides,
});
@@ -20,6 +21,7 @@ describe("utilityProfileEligibility", () => {
["CLI passthrough profile", profile({ cli_passthrough: true }), false],
["workspace profile", profile({ workspace_id: "workspace-1" }), false],
["non-inference profile", profile({ inference_capable: false }), false],
["profile with unknown inference support", profile({ inference_capable: undefined }), false],
])("returns %s = %s", (_label, candidate, expected) => {
expect(utilityProfileEligibility(candidate)).toBe(expected);
});
@@ -10,7 +10,7 @@ export const utilityProfileEligibility = (
includeWorkspaceProfiles = false,
) =>
profile.enabled !== false &&
profile.inference_capable !== false &&
profile.inference_capable === true &&
(dynamicRoutingEnabled || profile.kind !== "dynamic") &&
(includeWorkspaceProfiles || (!profile.cli_passthrough && !profile.workspace_id));