Repository navigation
Put every artifact of a run in Download all - #436
Open
officialasishkumar wants to merge 1 commit into
Open
officialasishkumar wants to merge 1 commit into
officialasishkumar wants to merge 1 commit into
Conversation
The run archive route listed artifacts through listArtifactsForOrg, which caps a page at 100 rows, and passed ARCHIVE_MAX_ARTIFACTS = 100. A run with more artifacts got a normal 200 ZIP of its newest 100, with nothing to tell the viewer that older files were missing. The archive is already built in memory under a 100 MiB total size limit, and that limit is what keeps the build safe. So the count cap goes: - listRunArtifactFilesForOrg in artifacts/repo.ts returns every artifact of one run in the org, newest first, selecting only the name, size and storage key the archive reads (no workpiece state, since the list is no longer capped); - the archive route uses it, so a ZIP holds every artifact of the run, or the request is refused with the existing 413 when the run's files add up to more than the size limit. It never returns a partial ZIP. The API reference now says the archive includes every artifact up to 100 MiB in total, instead of describing the old 100 artifact cap. Fixes useagenthq#401
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.
By opening this pull request you agree to the Contributor License Agreement. On your first pull request a bot asks you to sign it with a one-line comment.
Fixes #401
GET /api/artifacts/runs/:runId/archivelisted a run's artifacts throughlistArtifactsForOrgwithARCHIVE_MAX_ARTIFACTS = 100. A run with 101 artifacts got a normal200ZIP of its newest 100, and nothing told the viewer that the oldest file was missing.The issue gives two choices: include every file within the size limit, or refuse with a clear error. This takes the first. The ZIP is already built in memory under a 100 MiB total size limit, and that limit is what keeps the build safe, so the count cap was only cutting files out.
What changed
listRunArtifactFilesForOrginbackend/src/artifacts/repo.ts: every artifact of one run in the org, newest first. It selects onlyname,sizeBytesandstorageKey, the columns the archive reads, so an uncapped list never loads workpiece state.ARCHIVE_MAX_ARTIFACTSis gone. The ZIP now holds every artifact of the run. If the run's files add up to more than 100 MiB, the route refuses with the existing413before reading any bytes. It never returns a partial ZIP.listArtifactsForOrgand the Artifacts page list are unchanged (that list is Let the Artifacts page list files past the newest 100 #210).docs-site/docs/api/artifacts.mdxnow describes this behaviour instead of the old 100 artifact cap.The Download all link in the UI needs no change: whatever it gets is now either every file or an error.
Tests
Two new cases in
backend/test/artifacts.test.ts, through the real archive route:file-0.txt, the oldest one, which the old cap dropped413 run artifacts exceed the archive size limitinstead of a ZIP of the newest 100Both fail on
main(Expected length: 101, Received length: 100andExpected: 413, Received: 200).This change has no visible UI, so the tests above are the before and after. The Download all button itself was not clicked in a browser.
Checks with Bun 1.3.14, against
pgvector/pgvector:0.8.6-pg16-bookworm:cd backend && bunx -p typescript@5.9.3 tsc --noEmit: passescd backend && bun test test/artifacts.test.ts: 42 pass, 0 failcd backend && bun test test/ratchet.test.ts: 6 passbun test scripts/agent-docs.test.ts: 5 passcd backend && bun run test: 3562 pass, 28 fail. The 28 failures are all in engine runtime and sandbox config tests (src/engines/runtime-provider-bridge.test.ts,src/provider-gateway/sandbox-config.test.ts,src/engines/codex-subscription-runtime.test.tsand four others) that run the native runtime tooling on this machine. Running those seven files on unchangedmaingives the same 28 failures, so they come from the machine, not from this change.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.