mastra-ai/mastra · error · SandboxFeatureNotSupportedError
FEATURE_NOT_SUPPORTED
FEATURE_NOT_SUPPORTED
Error message
Sandbox does not support computer
What it means
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.
Source
Thrown at packages/core/src/workspace/tools/computer-helpers.ts:40
/** Default for ComputerToolConfig.screenshotDelayMs. */
export const DEFAULT_SCREENSHOT_DELAY_MS = 500;
type ComputerToolName = (typeof WORKSPACE_TOOLS.COMPUTER)[keyof typeof WORKSPACE_TOOLS.COMPUTER];
/**
* Extract the computer capability from the workspace sandbox in the tool
* execution context. Throws if the workspace has no sandbox or the sandbox
* doesn't support the computer capability.
*/
export function requireComputer(context: ToolExecutionContext): {
workspace: Workspace;
sandbox: WorkspaceSandbox;
computer: SandboxComputer;
} {
const { workspace, sandbox } = requireSandbox(context);
if (!supportsComputer(sandbox)) {
throw new SandboxFeatureNotSupportedError('computer');
}
return { workspace, sandbox, computer: sandbox.computer };
}
/** Resolve the per-tool ComputerToolConfig from the workspace tools config. */
export function getComputerToolConfig(
workspace: Workspace,
toolName: ComputerToolName,
): ComputerToolConfig | undefined {
return workspace.getToolsConfig()?.[toolName];
}
/**
* Format a screenshot as a MediaToolResult, falling back to text-only output
* when the image exceeds the configured size cap (so huge base64 payloads
* don't blow up the model context or storage).
*/
export function screenshotToResult(View on GitHub (pinned to 75dd419e61)
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
Example fix
// before const sandbox = createShellSandbox(); // after const sandbox = supportsComputer(desiredSandbox) ? desiredSandbox : createComputerSandbox();
Defensive patterns
Strategy: type-guard
Validate before calling
if (!workspace.sandbox || !supportsComputer(workspace.sandbox)) {
throw new Error('computer tools unavailable');
} Type guard
function hasComputer(s: WorkspaceSandbox): s is WorkspaceSandbox & { computer: SandboxComputer } {
return typeof (s as any).computer === 'object' && (s as any).computer !== null;
} Try / catch
try {
return await computerTool.execute(ctx);
} catch (e: any) {
if (e?.code === 'FEATURE_NOT_SUPPORTED' || /does not support computer/i.test(e?.message ?? '')) {
return { error: 'This sandbox does not support computer use; use shell tools instead.' };
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Local or container sandboxes without desktop/browser automation; switching sandbox providers and assuming computer support; configuring computer tool config without a matching sandbox capability.
Related errors
- Sandbox provider "${sandbox.provider}" does not support netw
- Sandbox provider "${sandbox.provider}" does not support exec
- Sandbox provider "${sandbox.provider}" does not support exec
- Sandbox provider "${options.sandbox.provider}" does not supp
- sandbox_command
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/5f9deec353da6873.
Report an issue: GitHub.