ComposioHQ/composio · warning · ValidationError
Pass either sandbox or workbench, not both. workbench is a b
Error message
Pass either sandbox or workbench, not both. workbench is a backwards-compatible alias for sandbox.
What it means
ValidationError: ToolRouter session creation accepts sandbox (and legacy alias workbench) but rejects passing both, since workbench is just a backwards-compatible rename. The guard prevents ambiguous configs where the two keys disagree.
Source
Thrown at ts/packages/core/src/lib/toolRouterParams.ts:123
if (!parsedResult.success) {
throw new ValidationError('Failed to parse manage connections config', {
cause: parsedResult.error,
});
}
const config = parsedResult.data;
return {
enable: config.enable ?? true,
callback_url: config.callbackUrl,
enable_wait_for_connections: config.waitForConnections,
};
};
export const resolveToolRouterSandboxConfig = (
config: Pick<ToolRouterCreateSessionConfig, 'sandbox' | 'workbench'>
): ToolRouterCreateSessionConfig['sandbox'] | ToolRouterCreateSessionConfig['workbench'] => {
if (config.sandbox !== undefined && config.workbench !== undefined) {
throw new ValidationError(
'Pass either sandbox or workbench, not both. workbench is a backwards-compatible alias for sandbox.'
);
}
return config.sandbox ?? config.workbench;
};
export const transformToolRouterSandboxParams = (
params?: ToolRouterCreateSessionConfig['sandbox'] | ToolRouterCreateSessionConfig['workbench']
): SessionCreateParams.Workbench | undefined => {
if (!params) {
return undefined;
}
return {
enable: params.enable ?? true,
enable_proxy_execution: params.enableProxyExecution,
auto_offload_threshold: params.autoOffloadThreshold,
sandbox_size: params.sandboxSize,View on GitHub (pinned to 64b1b85502)
Solutions
- Delete one of the two keys — prefer sandbox (workbench is the alias)
- If merging config objects, strip workbench before adding sandbox
- Search the codebase for 'workbench' and migrate all uses to sandbox
Example fix
// before
config({ sandbox: { runtime: 'bun' }, workbench: { runtime: 'bun' } })
// after
config({ sandbox: { runtime: 'bun' } }) Defensive patterns
Strategy: validation
Validate before calling
const cfg = { ...(base ?? {}) };
delete cfg.workbench; // keep only sandbox Type guard
const singleSandboxKey = (c: object): boolean =>
!('sandbox' in c && 'workbench' in c); Try / catch
try { createSession(cfg); } catch (e) { if (e.message.includes('not both')) { delete cfg.workbench; createSession(cfg); } } Prevention
- Standardize on sandbox; grep for legacy workbench usage
- Don't deep-merge configs that each define one alias
When it happens
Trigger: Calling createSession({ sandbox: {...}, workbench: {...} }); copy-pasted configs merging old code using workbench with new code using sandbox; spread-merging option objects that each define one key.
Common situations: Upgrading from versions that used workbench while keeping old defaults in a shared config object; LLM/agent-generated configs filling both fields.
Related errors
- Failed to parse manage connections config
- Failed to parse auth config create options
- Failed to parse auth config update data
- Failed to parse connected account list query
- Direct execution options and modifiers cannot be used with a
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/a8c1919f74c80bd8.
Report an issue: GitHub.