-
feat(sdk): workbench sandbox compute tier + connectedAccounts.link() allow_multiple (#3304)
发布于
2026-04-28 12:10:48 +00:00 Description
Two SDK additions on top of
next, plus the test-mock alignment that
fell out of the bundled stainless-client bump. User-facing docs have
been split into a separate branch (zen/sdk-sandbox-size-docs-12ur1a)
so they can land alongside the release PR for these patches — opening
them in this PR would fail the docs build until@composio/core/
composioship the new versions.1.
workbench.sandboxSize/workbench.sandbox_sizeExpose a workbench sandbox compute-tier knob on
ToolRouter.create()so
callers can pickstandard(default),medium,large, orxlarge.
Server-default is unchanged when the field is omitted, so existing
callers keep current behavior.- Bump stainless clients to pick up the field on the wire:
@composio/client0.1.0-alpha.66 → 0.1.0-alpha.67composio-client1.33.0 → 1.34.0
- TS: extend
ToolRouterCreateSessionConfigSchema.workbenchwith
sandboxSizeand forward it as snake_casesandbox_size. Export
SandboxSizetype andSandboxSizeSchemazod enum. - Python: extend
ToolRouterWorkbenchConfigTypedDict with
sandbox_sizeand forward it on the create payload. Export
SandboxSizeliteral alias. - Changeset:
@composio/corepatch.
2.
connectedAccounts.link()allow_multipleguard (SEC-339)Bring
link()to parity withinitiate()so the duplicate-connection
guard moves with customers as Composio-managed redirectable-OAuth
callers migrate fromconnected_accounts/createto
connected_accounts/link.- TS: add
allowMultiple?: booleanto
CreateConnectedAccountLinkOptions.link()now pre-flights
connectedAccounts.list({ statuses: ['ACTIVE'] })and throws
ComposioMultipleConnectedAccountsErrorwhen an active connection
exists andallowMultipleis nottrue. - Python: add
allow_multiple: bool = Falseto
connected_accounts.link()with the same guard and the same
ComposioMultipleConnectedAccountsError. - Behavior change is intentional and patched separately with
.changeset/sdk-link-allow-multiple.md.
3. Test-mock fix (alpha.67 fallout)
The
@composio/clientalpha.66 → alpha.67 bump above added two
newly-required fields onSessionCreateResponsethat the CLI
tool-router test mocks did not return:config_version: numberat the
top level andpreload: { tools: string[] }insideconfig. Added both
to everytoolRouter.createmock in
ts/packages/cli/test/src/commands/**sopnpm typecheck:testpasses
again. The values are arbitrary fixtures (config_version: 1, empty
preload.tools) — none of these tests assert on those fields.How did I test this PR
- TypeScript: new tests in
ts/packages/core/test/models/toolRouter.test.tscover the snake_case
forwarding and the zod enum rejection for invalidsandboxSizevalues.
New tests in
ts/packages/core/test/connectedAccounts/connectedAccounts.test.ts
cover the empty-list (link succeeds), duplicate-active (link throws
ComposioMultipleConnectedAccountsError), andallowMultiple: true
(link skips the guard) paths. - Python: new tests in
python/tests/test_tool_router.pyfor
sandbox_sizeforwarding and enum coverage. New tests in
python/tests/test_connected_accounts.pyand parity tests in
python/tests/test_tool_router.pyforallow_multiple=Trueskipping
the guard. - CLI typecheck: ran
pnpm exec tsgo --noEmit -p ./tsconfig.test.jsonfromts/packages/cli/and full repopnpm typecheckafter addingconfig_version/preloadto the test mocks —
clean. - CI: all 20 checks green on the latest commit (
50758892),
including all six runtime E2E targets (Node 20.18 / 20.19 / 22.12, Deno
2.6.7, Cloudflare Workerd, CLI scratch).
Docs and changelog entries
(docs/content/docs/{configuring-sessions,workbench}.mdx+
docs/content/changelog/04-28-26-sdk-{sandbox-size,link-allow-multiple}.mdx)
live onzen/sdk-sandbox-size-docs-12ur1aand will be opened as a
separate PR once these patches are released.下载附件
- Bump stainless clients to pick up the field on the wire: