Skip to content

perf(pi): connect the pi() sandbox on first use - #328

Merged
eersnington merged 3 commits into
stack/feat-pi-drain-and-resume-pi-runs-rklvtvuyfrom
stack/perf-pi-connect-the-pi-sandbox-on-first-use-uplyslmp
Oct 5, 2026
Merged

eersnington merged 3 commits into
stack/feat-pi-drain-and-resume-pi-runs-rklvtvuyfrom
stack/perf-pi-connect-the-pi-sandbox-on-first-use-uplyslmp

Conversation

@eersnington

@eersnington eersnington commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Every action on a cold pi() actor opened the session, and opening connected the sandbox. With a remote sandbox, that was a provider round trip for actions that never touch files, and a sandbox outage broke every action.

Before After
Any action on a cold actor connects the sandbox connects nothing, except to create a new session
A tool call or executeBash uses the connected sandbox connects on first use
The sandbox provider is down every action fails history and settings actions work; sandbox work fails until the provider is back
  • A new session still connects at open, because its working directory comes from the sandbox.
  • Tools map paths from the session's working directory onto the sandbox's own (toSandboxPath in src/sandbox.ts), so a replaced sandbox works without changing the session.
  • Known gap: after a replacement, an absolute path the model writes inside a bash command still names the old directory until the session reopens.

This is part 9 of 11 in a stack:

@eersnington
eersnington force-pushed the stack/feat-pi-drain-and-resume-pi-runs-rklvtvuy branch from e52d027 to 3f69319 Compare October 5, 2026 18:53
@eersnington
eersnington force-pushed the stack/perf-pi-connect-the-pi-sandbox-on-first-use-uplyslmp branch from ea27ddf to 72562bf Compare October 5, 2026 18:53
@eersnington
eersnington merged commit df5f250 into stack/feat-pi-drain-and-resume-pi-runs-rklvtvuy Oct 5, 2026
1 of 3 checks passed
@eersnington
eersnington deleted the stack/perf-pi-connect-the-pi-sandbox-on-first-use-uplyslmp branch October 5, 2026 19:13
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.

1 participant