Skip to content

Commit 39c1f42

Browse files
fix(computer-use): match computer_* tool names in capability gates (#579)
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 Co-authored-by: qinjiu <qinjiu@minimaxi.com>
1 parent fffea7a commit 39c1f42

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎packages/agent-tools/src/desktop/canonical-tool-policy.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ const READ_ONLY_CANONICAL_BLOCKED_TOOL_NAMES = new Set([
1919
'request_feature_enable',
2020
]);
2121

22-
/** Computer-use tools share the desktop_* namespace across native and MCP paths. */
22+
/** Computer-use tools share the computer_* namespace across native and MCP paths. */
2323
export function isComputerUseRuntimeToolName(name: string): boolean {
24-
return name.startsWith('desktop_');
24+
return name.startsWith('computer_');
2525
}
2626

2727
/**

‎packages/local-runtime-v2/src/service/turn-system/agent-host/assembly/local-turn-tool-catalog.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ function isReadyTurnToolAllowed(input: {
805805
readonly profile: LocalTurnAgentProfileFacts | undefined;
806806
}): boolean {
807807
if (input.excludedNames.has(input.tool.def.name)) return false;
808-
if (!isDesktopToolAvailable(input.tool, input.cuRuntimeAvailable)) return false;
808+
if (!isComputerToolAvailable(input.tool, input.cuRuntimeAvailable)) return false;
809809
if (
810810
!input.selector.allowsTool(input.tool.def.name, input.options.selectorAlias, {
811811
featureOwned: isFeatureOwnedBuiltinTool(input.profile, input.tool.def.name, input.source),
@@ -844,8 +844,8 @@ function isFeatureOwnedBuiltinTool(
844844
);
845845
}
846846

847-
function isDesktopToolAvailable(tool: RuntimeTool, cuRuntimeAvailable: boolean): boolean {
848-
return cuRuntimeAvailable || !tool.def.name.startsWith('desktop_');
847+
function isComputerToolAvailable(tool: RuntimeTool, cuRuntimeAvailable: boolean): boolean {
848+
return cuRuntimeAvailable || !tool.def.name.startsWith('computer_');
849849
}
850850

851851
/** `mcpServers` applies to MCP tools only; without a server it fails closed. */

0 commit comments

Comments
 (0)