From 55a7f90aade9c052e4694fda70cf896475a2e0f0 Mon Sep 17 00:00:00 2001 From: ayattara Date: Tue, 25 Aug 2026 12:07:42 +0000 Subject: [PATCH] fix(plugins): split inference capability requirement by context Plugin/sessionless utility pickers (includeWorkspaceProfiles=false) still require inference_capable=true. Configuration Chat context (includeWorkspaceProfiles=true) preserves eligibility for non-inference workspace profiles while still rejecting CLI passthrough and disabled profiles universally. Fixes regression where ConfigChatAgentSection lost valid custom TUI profiles after the inference_capable tightening. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../utility-agent-profile-picker.test.ts | 31 +++++++++++++++++++ .../settings/utility-agent-profile-picker.tsx | 5 +-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/apps/web/components/settings/utility-agent-profile-picker.test.ts b/apps/web/components/settings/utility-agent-profile-picker.test.ts index 1f2f4a2544..531bfc7fcf 100644 --- a/apps/web/components/settings/utility-agent-profile-picker.test.ts +++ b/apps/web/components/settings/utility-agent-profile-picker.test.ts @@ -31,4 +31,35 @@ describe("utilityProfileEligibility", () => { true, ); }); + + describe("with includeWorkspaceProfiles=true (Config Chat context)", () => { + it.each([ + [ + "non-inference workspace profile", + profile({ workspace_id: "ws-1", inference_capable: false }), + true, + ], + ["non-inference global profile", profile({ inference_capable: false }), true], + [ + "unknown inference workspace profile", + profile({ workspace_id: "ws-1", inference_capable: undefined }), + true, + ], + ])("returns %s = %s", (_label, candidate, expected) => { + expect(utilityProfileEligibility(candidate, true, true)).toBe(expected); + }); + + it.each([ + ["CLI passthrough", true], + ["disabled", false], + ])("still rejects %s profile", (_label, enabled) => { + expect( + utilityProfileEligibility( + profile({ workspace_id: "ws-1", cli_passthrough: true, enabled }), + true, + true, + ), + ).toBe(false); + }); + }); }); diff --git a/apps/web/components/settings/utility-agent-profile-picker.tsx b/apps/web/components/settings/utility-agent-profile-picker.tsx index de0467ed16..629d3c9f88 100644 --- a/apps/web/components/settings/utility-agent-profile-picker.tsx +++ b/apps/web/components/settings/utility-agent-profile-picker.tsx @@ -10,9 +10,10 @@ export const utilityProfileEligibility = ( includeWorkspaceProfiles = false, ) => profile.enabled !== false && - profile.inference_capable === true && + !profile.cli_passthrough && + (includeWorkspaceProfiles || profile.inference_capable === true) && (dynamicRoutingEnabled || profile.kind !== "dynamic") && - (includeWorkspaceProfiles || (!profile.cli_passthrough && !profile.workspace_id)); + (includeWorkspaceProfiles || !profile.workspace_id); type UtilityAgentProfilePickerProps = { profiles: AgentProfileOption[];