Repository navigation
feat: tee execution output to a VFS file; native capture offload for Deep Agents - #2818
Merged
Merged
Conversation
…Deep Agents - core: Execution::output_file(path, max_bytes) writes combined stdout+stderr to a VFS file bounded by its own cap and FsLimits, not the in-memory caps - python: execute/execute_sync accept output_file / max_output_file_bytes - deepagents: BashkitBackend subclasses BaseSandbox with enable_capture_offload and implements execute_with_offload natively, so large output stays greppable in /large_tool_results without a subshell
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 6a69b03 | Commit Preview URL Branch Preview URL |
Nov 03 2026, 04:24 AM |
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.
Requested by Михайло · project thread
Large command output can now be written in full to a file on the virtual filesystem as the command runs, and the Deep Agents backend uses this to keep big
executeresults greppable.What changed
Execution::output_file(path, max_bytes). Combined stdout and stderr are written, in the order they're produced, into a VFS file that is created (or truncated) before the script runs.FsLimits, not bymax_stdout_bytes/max_stderr_bytes. The bytes stay in the sandbox, the same as a{ script; } > file 2>&1redirect.captureand the sinks keep the in-memory caps.cd,exportand functions carry over to the next call.Bash/BashToolexecuteandexecute_syncacceptoutput_file=andmax_output_file_bytes=(absolute VFS path, 10 MiB default). These can't be combined withon_output.BashkitBackendnow subclassesBaseSandboxwithenable_capture_offload = True, because the framework only offers capture toBaseSandboxtypes.execute_with_offload/aexecute_with_offloaduse the native file output instead of the upstream bash wrapper. That wrapper's( eval … )subshell would drop shell state between commands./large_tool_results/<id>, with the same head/tail preview and clip notices as upstream.python3helper, includingals/awrite/aedit, is overridden with direct VFS code.Why
Today, large
executeoutput passes through Bashkit's 1 MB in-memory stdout limit before deepagents saves it to a file, so anything past 1 MB is lost. Upstream's capture wrapper avoids that, but it runs the command in a subshell, which would break Bashkit's persistent shell. Writing to the file natively keeps up to 10 MB and keeps the shell state.Before / After
execute/large_tool_results/<id>; model gets a head/tail previewcd /tmp; export K=1in a large-output command, thenecho $K $PWD1 /tmp1 /tmp(no subshell)execute_sync(cmd, output_file="/tmp/o.log")/tmp/o.logholds 3,000,004 bytes whilestdoutis capped at 1 MiB withstdout_truncated=TrueTests:
output_file_tests: output beyond the stdout cap plus shell state, the file's own cap and truncation of old content,FsLimitsbounding without failing the call, and rejection of relative or missing-parent paths.create_deep_agentloop offloading 2 MB.pytest crates/bashkit-python/tests: 975 passed, 2 skipped. The three suites that need thebashkit_random_fsfixture crate were not run locally.--no-default-features),cargo doc -D warnings --all-features, ruff,just check-okfandjust check-doc-linksare clean.Risk
FsLimits, and is noted in TM-DOS-058.BashkitBackend's base class changes toBaseSandbox. All of that class's execute-based helpers are overridden.Checklist
<a href="
https://backend.blacksmith.sh/track/enable-autofix?expires=1796271858&installation_model_id=447267&pr_number=2818&ref=codesmith_pr_footer&repository=everruns%2Fbashkit&return_to=https%3A%2F%2Fgithub.com%2Feverruns%2Fbashkit%2Fpull%2F2818&signature=c517dc1ec01cdbc675f4814db9093b8d679ea920d29b474070144484426af886"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28">Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Generated by Claude Code