Repository navigation
feat(harness): keep oversized bash output inside the sandbox - #56
Merged
Merged
Conversation
sanchitrk
force-pushed
the
claude/sandbox-output-spill
branch
from
October 9, 2026 14:12
0689d1e to
aa7e176
Compare
sanchitrk
added this pull request to stack #58
October 9, 2026 14:14
sanchitrk
force-pushed
the
claude/sandbox-output-spill
branch
from
October 9, 2026 14:14
aa7e176 to
8719caf
Compare
The bash tool's full output used to go to a temp file on the harness host, which a remote sandbox cannot read. The command now runs in a POSIX sh wrapper that writes its output to a file under the mount's spill path (SandboxIO.Current.spillPath, /tmp unless the provider sets one), created 0600 and exclusively, and kept only when the output exceeds the display limits. Streaming backends tee it; buffered backends return only a header and the tail window, so a huge output never crosses to the harness. The host sandbox shell now streams and escalates SIGTERM to SIGKILL for the whole process group on interruption, replacing ToolShell.local, which no plugin used. Daytona and Vercel record their spill path in the runtime config like their default cwd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sanchitrk
force-pushed
the
claude/sandbox-output-spill
branch
from
October 9, 2026 14:15
8719caf to
7d5d1fb
Compare
The model cannot tell a host from a sandbox: its tools act on one environment. What it needs is that the full output was saved and where, which the truncation footer already gives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The model saw only the output of a failed command, flagged as an error: the exit code and the deadline lived in `details`, which it never reads, so a silent failure or a timeout arrived blank. Append the reason — "Command exited with code N", "Command timed out after N seconds", "Command terminated without an exit code" — and show "(no output)" for empty successful output. The description now promises the truncation note rather than a path at the end: no path is given when the output file could not be created or was not kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third of three stacked PRs — based on #55. Merge #54 and #55 first.
What
shwrapper (tool/output.ts) that writes its combined output to a file under the mount's spill path, created0600and exclusively, kept only when the raw output exceeds the display limits.teeit; output still flows back live.Accumulator.skip).spillPathon the mount identity (SandboxIO.Current):/tmpby default; Daytona and Vercel defineSPILL_PATHand record it in their runtime config likeDEFAULT_CWD, so it can become configurable later.ToolShell.local, which no plugin used since bash moved ontoSandboxIO.Shell.Testing
test/tools.output.test.ts: the bash tool end to end over the host shell (streaming), the host shell without streaming (buffered under a realsh) and just-bash — no file for small output, complete file + correct tail/line numbers for large output (with non-ASCII),0600,)in a comment andexit, background jobs still writing, a huge final line, invalid UTF-8, a trailing NUL, deadlines, cancellation, and an orphaned child that ignores SIGTERM.🤖 Generated with Claude Code