Skip to content

feat(collect_artifacts): collect from framework computer envs - #601

Draft
williamloo-scale wants to merge 1 commit into
mainfrom
wloo/computer-collect-artifacts
Draft

williamloo-scale wants to merge 1 commit into
mainfrom
wloo/computer-collect-artifacts

Conversation

@williamloo-scale

@williamloo-scale williamloo-scale commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of OSWorld initialize/evaluate parity for framework computer envs: CUA tasks retargeted at a computer env need collect_artifacts to pull deliverables off the computer, and the hub's CUA regrade stages those collected files back in.

  • collect_artifacts with env_id set now accepts a deployed env whose card serves urn:agentenv:computer-exec/v1 run and carries no cua_vm_sandbox_id marker. On those envs the existing cua_bash and cua_get_file reads run inside the computer, as its session user, through agent_env.env.envs.computer.utils.inside.run.
  • Reads are sized from the card's max_output_bytes (1 MiB by default). The base64 of a range always fits, so files above that size stream in ranges. Output that computer-exec truncated or that timed out raises an error; it never becomes a partial upload.
  • CUA envs (marker present) behave as before, and any other env is still refused. The error message now names both env kinds collect accepts.
  • Base-path enumeration is portable (cd <base> && find . -type f | sed 's|^\./||' instead of GNU-only -printf). Output is the same on Linux, and it now also works on macOS computers.
  • Plugin surface: adds inside.max_output_bytes, and lists inside.run, inside.read_file, inside.max_timeout_s and inside.max_output_bytes in check_plugin_api.py USED. That gives plugins (agentenv-cua's cua_initialize/cua_evaluate guest ops) a checked, stable import.

Test plan

  • tst/unit/task_step/test_collect_artifacts.py adds TestComputerPath. A fake computer runs each command for real with /bin/sh, which covers single-shot reads, streaming in ranges under a 1 KiB cap, skipping absent files, base-path enumeration, refusing truncated output, and leaving CUA envs' read limits unchanged.
  • ruff check
  • check_plugin_api.py --base origin/main: no break to the plugin surface
  • full unit suite (tst/unit/ packages/agentenv-protocol/tests/ -n auto --timeout=90) on macOS: 14341 passed, 67 skipped, 3 failed. The 3 failures (test_disk_recipe.py::test_a_windows_install_boots_its_iso_first…, test_docker_image_github_clone.py::test_a_token_signs_the_clone_in…[secrets|secret files]) fail the same way on origin/main without this change: macOS-host timeouts, unrelated to this PR.

🤖 Generated with Claude Code

collect_artifacts with `env_id` only read from CUA desktop VMs (envs whose
deploy stamps `cua_vm_sandbox_id`) and refused every other env. An env whose
card serves computer-exec/v1 `run` (a framework `computer`) now takes the same
path: `cua_bash` and `cua_get_file` are answered by commands run inside the
computer as its session user, in ranges whose base64 fits the card's
`max_output_bytes`, and truncated or timed-out output fails rather than
uploading a partial file. CUA envs are unchanged.

Base-path enumeration now uses `cd <base> && find . -type f | sed` instead of
GNU-only `find -printf`, so it also works on macOS computers.

Adds `inside.max_output_bytes`, and puts `inside.run`, `inside.read_file`,
`inside.max_timeout_s` and `inside.max_output_bytes` on the plugin surface
(USED), so plugins such as agentenv-cua can run and read inside a computer
from a checked, stable location.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

This branch has not been deployed

No deployments
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