Skip to content

Add durable Strands sandbox support - #1768

Open
brianstrauch wants to merge 5 commits into
mainfrom
strands-temporal-sandbox
Open

Add durable Strands sandbox support#1768
brianstrauch wants to merge 5 commits into
mainfrom
strands-temporal-sandbox

Conversation

@brianstrauch

Copy link
Copy Markdown
Member

Summary

  • add an experimental activity-backed TemporalSandbox implementation for the Strands sandbox API
  • register lazy, worker-lifetime sandbox factories through StrandsPlugin
  • buffer execution streams for deterministic replay and optionally publish raw StreamChunk values through Workflow Streams
  • preserve Strands timeout and missing-path errors across the activity boundary
  • vend the standard sandbox bash and file-editor tools with user overrides
  • document lifecycle, payload, retry, streaming, and environment-value considerations

Testing

  • poe test -s -k strands
  • poe lint
  • git diff --check

@brianstrauch
brianstrauch requested review from a team as code owners August 20, 2026 02:48
@brianstrauch
brianstrauch requested a balanced review from Copilot August 20, 2026 03:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

brianstrauch and others added 4 commits August 20, 2026 16:22
A timeout is the deterministic outcome the caller's own `timeout` argument
asked for, so retrying just re-runs the same hanging command. Under Temporal's
unlimited-attempt default this meant SandboxTimeoutError never reached workflow
code and the agent could never observe the timeout and adapt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every built-in Strands sandbox raises a plain FileNotFoundError from
read/write/remove — only list_files raises the SandboxPathNotFoundError
subclass — so the old handlers were dead code and a missing path retried
forever instead of reaching workflow code. Catch the documented base class
instead, and carry the sandbox's own message through so a timeout reports the
duration it actually enforced rather than the one the caller requested.

Also fix the DockerSandbox import in the README, which is not re-exported from
strands.sandbox, and note that the sandbox cache is per worker process.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants