feat(computer): download generated workspace files - #698
Conversation
…rated-files # Conflicts: # CHANGELOG.md
Head branch was pushed to by a user without write access
davidmckayv
left a comment
There was a problem hiding this comment.
The current head 6f0f48f matches the accepted source disposition from the refreshed triage. Required CI must pass before landing.
|
Hi @davidmckayv — thanks for the approval on One thing still blocks the merge: the CI workflow run for this head is stuck at Since this is a first-time-contributor PR, that run needs a maintainer to approve/trigger it (Actions → the run → "Approve and run"). Could you or another maintainer approve it? No code changes are needed on my side — the head is exactly the one you approved. Thanks! |
# Conflicts: # CHANGELOG.md
Head branch was pushed to by a user without write access
|
Conflict resolved by merging the latest The previous approval may now be stale because the head changed and may need to be renewed. Focused tests and typechecks pass locally, but CI still requires a maintainer to approve the workflow run for this new head. |
# Conflicts: # CHANGELOG.md
download_file was not one of the intents the switch gates, so a member could still download workspace files after an administrator turned Cloud computer use off. It now needs the same capability as reading or writing those files.
|
I pushed one commit. |
…723) #698 made agent-computer/src/index.ts import ../../shared/file-download at runtime. The computer Dockerfile copies only agent-computer/src, so the image built and then exited on start with "Cannot find module". The other shared imports there are type-only and erased, which is why this one was the first to break. The one file now goes to /shared, where the relative path resolves from /app/src. The component image job only built the Dockerfiles, and a build succeeds with a missing runtime module, so it now also starts the computer image and waits for /health.
A keep-both merge left the tail of the routine failure-count entry, with its migration sentence, stranded under the download entry; it is back where it belongs. The download entry now says the Cloud computer use switch refuses downloads, as the maintainer fix to #698 made it, and the saved group reply entry says interrupted consent cards and handoffs are still posted, as the fix to #713 made them. The README settings table gains OPENBOT_SELF_HOST_BANNER.
What this changes
Implements the download path for generated workspace files in #370.
GET /files/download?path=...toagent-computer; PDFs, images and archives are streamed intact rather than decoded through the 64 KB text-read path.GET /api/computers/:botId/files/download?path=...API.computer_download_fileacting tool whose policy intent isdownload_file. It is not folded intocomputer_read_file, so a deployment can allow reading while refusing downloads, or the reverse.resolvePath: absolute paths and..are refused, symlink escapes are refused, and directories are not downloadable.413. Files at or below the ceiling are streamed throughBun.file/sendfile, not buffered into a string.application/octet-stream,Content-Disposition: attachment,X-Content-Type-Options: nosniff,Cache-Control: private, no-store, with CRLF/quote/backslash-safe RFC 5987 filenames.Where it runs
canUseBotmiddleware and the computer is addressed through the existing provider/gateway path./api/computersingress.Boundary and audit
404.400malformed path/request,403workspace or policy refusal,404missing Bot/file,413size cap,500unexpected failure, with existing503for an unavailable computer.Changelog
UnreleasedinCHANGELOG.md.Proof
Local head:
0b75cb4.OPENBOT_FILE_DOWNLOAD_HTTP=1 bun test agent-computer/tests/file-download-http.test.ts— 9 pass, 0 fail. Covers real HTTP process, binary integrity over 64 KB, auth, missing file, directory, traversal, symlink escape, 413, and header injection.bun test agent-computer/tests— 351 pass, 34 skipped, 0 fail.bun test shared/*.test.ts— 92 pass, 0 fail.server/tests/computer-*.test.tsexcluding DB-backed*.integration.test.ts— 356 pass, 0 fail.computer-download-routes,computer-client,computer-gateway,computer-policy) — 157 pass, 0 fail.bun run typecheck— pass across app/server/worker;agent-computerbun run typecheck— pass.bun run lint— pass.bun run format:check— pass.Risks / residual verification
DEFAULT_WORKSPACE_LIMITS; making it deployment-configurable can be a follow-up if operators need a different ceiling.server/tests/computer-*.integration.test.tswere not run locally because no dedicatedTEST_DATABASE_URLis configured in this workspace. CI should run them.bun testlocally is blocked by the same pre-existingTEST_DATABASE_URLrequirement in integration files; all affected non-DB suites above are green.