Repository navigation
Conversation
…streaming exec Sandboxes that only implement exec_with_output (smol_vm, and the ARP provider in agentenvhub-sdk <= 0.34.18) failed in _collect_file with AttributeError. FDE-2526. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dmchoiboi
force-pushed
the
michaelchoi/_claude/collect-artifacts-exec-fallback
branch
from
October 23, 2026 14:50
3a058fa to
6a94df6
Compare
| await stderr_task | ||
| except Exception: | ||
| pass | ||
| if not hasattr(sandbox, "exec"): |
There was a problem hiding this comment.
smol_vm collection still fails
SmolVmSandbox inherits Sandbox.exec, which raises NotImplementedError. That makes hasattr(sandbox, "exec") true, so collection still takes the streaming branch and fails instead of using exec_with_output.
Detect unsupported streaming execution, not just a missing attribute. Add a test using a sandbox that inherits the base exec method; the current fake has no such method and misses this case.
Knowledge Base Used: Provider integrations and sandbox deployment
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/task_step/task_steps/collect_artifacts.py
Line: 482
Comment:
**`smol_vm` collection still fails**
`SmolVmSandbox` inherits `Sandbox.exec`, which raises `NotImplementedError`. That makes `hasattr(sandbox, "exec")` true, so collection still takes the streaming branch and fails instead of using `exec_with_output`.
Detect unsupported streaming execution, not just a missing attribute. Add a test using a sandbox that inherits the base `exec` method; the current fake has no such method and misses this case.
**Knowledge Base Used:** [Provider integrations and sandbox deployment](https://app.greptile.com/scale-ai/-/custom-context/knowledge-base/scaleapi/agentenv-framework/-/docs/provider-integrations.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
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.
Why
collect_artifactsreads each file by streamingbase64 < filethroughsandbox.exec(). Sandboxes that only implement the bufferedexec_with_output, such assmol_vmand the ARP provider in current agentenvhub-sdk pins, fail with anAttributeError. This blocks tasks moving off the retired beta sandbox onto ARP (FDE-2526, P0).What
collect_artifacts.py_collect_file:exec(streaming)exec_with_outputAttributeError: ... no attribute 'exec'exec_with_output("bash", "-c", "base64 < f"), decoded in one pieceThe size integrity check and the upload path are unchanged for both branches.
For reviewers
The streaming branch is the same code, indented one level. The fallback holds the whole base64 text in memory, which is fine at artifact sizes. A streaming
execfor the ARP provider is in scaleapi/scaleapi#169759; this PR unblocks collection on the SDK versions already pinned.Verification
New
test_a_sandbox_without_streaming_exec_collects_over_buffered_exec(binary payload, 76-column wrapped base64). Before the change it fails with the sameAttributeErrorusers hit; after the change it passes.tst/unit/task_step/test_collect_*andtest_container_sandbox_routing: 107 passed. ruff clean.Live on ARP staging (one 1-CPU VM, deleted afterwards), on a 3 MB random file:
exec("bash","-c","base64 < f; echo to-stderr >&2; exit 3")streamedstderr=to-stderr,wait()= 3collect_artifacts._collect_filevia streamingexeccollect_artifacts._collect_fileviaexec_with_outputonly (this PR)🤖 Generated with Claude Code