{"record":{"id":"5f9deec353da6873","repo":"mastra-ai/mastra","slug":"feature-not-supported","errorCode":"FEATURE_NOT_SUPPORTED","errorMessage":"Sandbox does not support computer","messagePattern":"Sandbox does not support computer","errorType":"error_code","errorClass":"SandboxFeatureNotSupportedError","httpStatus":null,"severity":"error","filePath":"packages/core/src/workspace/tools/computer-helpers.ts","lineNumber":40,"sourceCode":"\n/** Default for ComputerToolConfig.screenshotDelayMs. */\nexport const DEFAULT_SCREENSHOT_DELAY_MS = 500;\n\ntype ComputerToolName = (typeof WORKSPACE_TOOLS.COMPUTER)[keyof typeof WORKSPACE_TOOLS.COMPUTER];\n\n/**\n * Extract the computer capability from the workspace sandbox in the tool\n * execution context. Throws if the workspace has no sandbox or the sandbox\n * doesn't support the computer capability.\n */\nexport function requireComputer(context: ToolExecutionContext): {\n  workspace: Workspace;\n  sandbox: WorkspaceSandbox;\n  computer: SandboxComputer;\n} {\n  const { workspace, sandbox } = requireSandbox(context);\n  if (!supportsComputer(sandbox)) {\n    throw new SandboxFeatureNotSupportedError('computer');\n  }\n  return { workspace, sandbox, computer: sandbox.computer };\n}\n\n/** Resolve the per-tool ComputerToolConfig from the workspace tools config. */\nexport function getComputerToolConfig(\n  workspace: Workspace,\n  toolName: ComputerToolName,\n): ComputerToolConfig | undefined {\n  return workspace.getToolsConfig()?.[toolName];\n}\n\n/**\n * Format a screenshot as a MediaToolResult, falling back to text-only output\n * when the image exceeds the configured size cap (so huge base64 payloads\n * don't blow up the model context or storage).\n */\nexport function screenshotToResult(","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workspace/tools/computer-helpers.ts#L22-L58","documentation":"Thrown by requireComputer when a tool needs the sandbox's computer feature but the configured WorkspaceSandbox does not implement/declare support for it (supportsComputer returns false). SandboxComputer capability is optional per sandbox provider, so dependent tools fail fast with code FEATURE_NOT_SUPPORTED.","triggerScenarios":"Invoking computer tools (screenshot, click, type, etc.) against a workspace whose sandbox lacks a computer implementation; using a sandbox provider that only supports processes/filesystem.","commonSituations":"Local or container sandboxes without desktop/browser automation; switching sandbox providers and assuming computer support; configuring computer tool config without a matching sandbox capability.","solutions":["Configure a sandbox that supports computer use (one exposing sandbox.computer)","Guard tool availability: only register/expose computer tools when supportsComputer(sandbox) is true","Check for the FEATURE_NOT_SUPPORTED code in catch blocks and fall back to shell-based tools","Verify the sandbox provider/version actually implements the computer interface"],"exampleFix":"// before\nconst sandbox = createShellSandbox();\n// after\nconst sandbox = supportsComputer(desiredSandbox) ? desiredSandbox : createComputerSandbox();","handlingStrategy":"type-guard","validationCode":"if (!workspace.sandbox || !supportsComputer(workspace.sandbox)) {\n  throw new Error('computer tools unavailable');\n}","typeGuard":"function hasComputer(s: WorkspaceSandbox): s is WorkspaceSandbox & { computer: SandboxComputer } {\n  return typeof (s as any).computer === 'object' && (s as any).computer !== null;\n}","tryCatchPattern":"try {\n  return await computerTool.execute(ctx);\n} catch (e: any) {\n  if (e?.code === 'FEATURE_NOT_SUPPORTED' || /does not support computer/i.test(e?.message ?? '')) {\n    return { error: 'This sandbox does not support computer use; use shell tools instead.' };\n  }\n  throw e;\n}","preventionTips":["Choose a sandbox provider that implements computer use when enabling computer tools","Gate computer tool registration on supportsComputer(sandbox)","Keep a shell/CLI fallback path for non-computer sandboxes","Test sandbox capability flags after any provider upgrade"],"tags":["sandbox","feature-flags","computer-use","capability"],"backgroundTag":"sandbox-feature-not-supported","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}