feat: integrate Sandbox with Agent#2563
Conversation
b6c43ab to
f9059ff
Compare
f9059ff to
f9d52ea
Compare
|
Assessment: Comment Clean integration of the Sandbox abstraction into the Agent. The Node/browser split via export conditions is well-architected and the test strategy (separate node/browser vitest projects) is solid. Review Themes
The overall design is well thought-out with good separation of the Node-specific registration from the platform-agnostic interface. |
f9d52ea to
c7de3c2
Compare
|
Assessment: Approve All previous review feedback has been addressed in the current code. The sentinel symbol, error export, Verification Summary
Well-designed feature with clean separation between the platform-agnostic interface and Node-specific registration. |
|
@agent-of-mkmeral feel free to have a look! "do the works" as your creator says |
|
Had a proper look @gautamsirdeshmukh — checked out the PR head, read the diff, and ran the suites locally. This is clean, well-architected work. ✅ What I verified locally (Node 22)New tests for this PR — all green: No regressions — full agent unit suite: Browser-bundler compatibility (the core goal of the PR) — Design review
On the red CI ❌ (non-blocking)The only failing check is Run integration tests (2 of 1188 failed). I traced both — neither is related to this PR:
Both are live-service/Docker integ tests, and the CI Gate check is green, so they're non-blocking. Separately, the VerdictLGTM. 412→ minimal, focused diff; solid test strategy (isolated slot tests + node/browser projects + CJS/ESM package tests); review feedback genuinely addressed. The red X is unrelated flaky integ tests, not a defect in this PR. 🚀 |
|
Re @mkmeral's question on the I checked out the PR head and wrote a probe to answer it empirically rather than just reasoning about it. Same instance, not recreated per call: const a = new Agent({ model })
a.sandbox === a.sandbox // ✅ true (same ref across reads)
const a1 = new Agent({ model })
const a2 = new Agent({ model })
a1.sandbox === a2.sandbox // ✅ true (ONE shared singleton across agents)
new Agent({ model, sandbox: false }).sandbox === a1.sandbox // ✅ trueAll 3 assertions pass. The getter On the "scary" shared-singleton part — it's genuinely a non-issue today. I grepped @gautamsirdeshmukh's factory migration path is exactly right if/when a real default sandbox ever holds per-agent state: TL;DR: shared stateless singleton today (safe), clean non-breaking escape hatch reserved for the stateful future. No action needed on this PR — still LGTM. 🚀 |
c7de3c2 to
de6085a
Compare
|
Assessment: Approve All previous review feedback has been addressed in the current code. No new substantive issues found. Verification Summary
Well-designed feature with clean separation between the platform-agnostic interface and Node-specific registration. |
|
Re-checked on the updated head What's changed since June 4:
Nothing new to fix on my end — the diff is the same focused 17-file change, design is sound, and it's |
Description
Adds the Sandbox as a first-class parameter on
Agent.This is the third PR split off from strands-agents/sdk-typescript#1011, preceded by the base interface merged in strands-agents/sdk-typescript#1090 and Docker/SSH implementations merged in strands-agents/sdk-typescript#1110.
Developer Experience
Explicitly Configured Sandbox
Node: works without configuration (falls back to host-level execution)
Browser: throws if not explicitly configured
Related Issues
Documentation PR
Not yet
Type of Change
New feature
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.