From 286304f4037b3bd5e4caa57e39f3980155f445d2 Mon Sep 17 00:00:00 2001 From: qinjiu Date: Sun, 1 Nov 2026 20:28:49 +0800 Subject: [PATCH] fix(computer-use): match computer_* tool names in capability gates The native Computer Use catalog names its tools computer_*, but the read-only role ceiling and the runtime-availability filter still matched the retired desktop_* prefix. Explore and Verifier could therefore receive computer_* tools, and the tools stayed listed when the Computer Use runtime was unavailable. Fixes #573 --- packages/agent-tools/src/desktop/canonical-tool-policy.ts | 4 ++-- .../agent-host/assembly/local-turn-tool-catalog.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/agent-tools/src/desktop/canonical-tool-policy.ts b/packages/agent-tools/src/desktop/canonical-tool-policy.ts index 231c0cdd3..5878466ab 100644 --- a/packages/agent-tools/src/desktop/canonical-tool-policy.ts +++ b/packages/agent-tools/src/desktop/canonical-tool-policy.ts @@ -19,9 +19,9 @@ const READ_ONLY_CANONICAL_BLOCKED_TOOL_NAMES = new Set([ 'request_feature_enable', ]); -/** Computer-use tools share the desktop_* namespace across native and MCP paths. */ +/** Computer-use tools share the computer_* namespace across native and MCP paths. */ export function isComputerUseRuntimeToolName(name: string): boolean { - return name.startsWith('desktop_'); + return name.startsWith('computer_'); } /** diff --git a/packages/local-runtime-v2/src/service/turn-system/agent-host/assembly/local-turn-tool-catalog.ts b/packages/local-runtime-v2/src/service/turn-system/agent-host/assembly/local-turn-tool-catalog.ts index b32c0003d..25c0ac18b 100644 --- a/packages/local-runtime-v2/src/service/turn-system/agent-host/assembly/local-turn-tool-catalog.ts +++ b/packages/local-runtime-v2/src/service/turn-system/agent-host/assembly/local-turn-tool-catalog.ts @@ -805,7 +805,7 @@ function isReadyTurnToolAllowed(input: { readonly profile: LocalTurnAgentProfileFacts | undefined; }): boolean { if (input.excludedNames.has(input.tool.def.name)) return false; - if (!isDesktopToolAvailable(input.tool, input.cuRuntimeAvailable)) return false; + if (!isComputerToolAvailable(input.tool, input.cuRuntimeAvailable)) return false; if ( !input.selector.allowsTool(input.tool.def.name, input.options.selectorAlias, { featureOwned: isFeatureOwnedBuiltinTool(input.profile, input.tool.def.name, input.source), @@ -844,8 +844,8 @@ function isFeatureOwnedBuiltinTool( ); } -function isDesktopToolAvailable(tool: RuntimeTool, cuRuntimeAvailable: boolean): boolean { - return cuRuntimeAvailable || !tool.def.name.startsWith('desktop_'); +function isComputerToolAvailable(tool: RuntimeTool, cuRuntimeAvailable: boolean): boolean { + return cuRuntimeAvailable || !tool.def.name.startsWith('computer_'); } /** `mcpServers` applies to MCP tools only; without a server it fails closed. */