Public: anyone can read this; the crew can change it.
git-upload-pack for a runner job no longer holds the serving thread #17839
Merged 11h 1m ago, live in production
A runner's fetch through /api/v1/runner/jobs/:id/git/git-upload-pack no longer blocks the serving thread while the forge checks what the runner is asking for (#17821). What blocked, before.
-
Reviews
ApprovedClean. The gzip inflate moves to zlib's worker with the same FETCH_MAX cap, and the held-negotiation read and output build run in sliced() slices. The filter rule is unchanged: a have/shallow id passes only if allowed or verdicted true, and the job-token check still runs before any spawn. out.subarray(0, w) is the right length. No new dependency, no secrets, and no page or tool changed, so no door is needed. The test sends the largest negotiation and fails on the old path (about 900 ms against a 150 ms bound), and the helper is shared with boot-no-stall. Box 1 was measured locally rather than from the [loop] log, which is honest and gives a before count.
-
Checks
shipped production is serving it deploy 9d6fa9d
-
History
- worstBlock waits on the timer's next wake, not a fixed delay (#17821) af7f3de
- One worstBlock for the loop tests; the runner fetch test uses it (#17821) 5d225f4
- A runner's fetch no longer holds the serving thread (#17821) 112c901
- Talk's Stop stays for the whole answer, with words in the box too (#17819) b51ab2e
- The changelog credits a model only when a run backs it (#17807) e780a4e
- The decider can be compared with SubQ Snap in the background, off by default, and decides nothing (#17795) c0cee92
- small: the '+ New forge' page has one primary next action, with phone and desktop looks on the pull (#17818) 6cc8e61
- GET pulls/:number runs an uncapped diff and renders it on the serving thread (#17812) 153cbb3
- Full suite red: 2 files in check run 01m8wzswcz0vr3fz25ryd619jz (#17814) 8f7dfc4
- A Talk build's version strip is in sight when its preview opens, on a phone and at 1000 px (#17810) bdc702e
- Talk says what a long turn is doing and how long since its last step, across every stream (#17808) dcfa7ed
- A Talk build starts no crew run and no review, and only a person publishes it (#17803) cd1d5b7
- Only a check writes a retry decision's outcome, and it says which one (#17796) c2d976e
- A crew run that hits the turn limit wraps up, and says so in its run and its pull (#17809) b35dca2
- app-home-batched boots one forge for the file, and each test has its own account and repositories (#17805) 4763617
- A follow-up in Talk always carries what the person asked; tool steps are what gets cut (#17804) 7af0ffd
- A crew run can spend a granted OpenAI-type account, on the OpenAI runner, per run (#17787) b43bdad
- Talk: the model is a button beside Send, with a list you can type in, and plain names (#17794) 191cbc2
- A release asks scripts/return-check.ts before it promotes (#17793) 7618050
- A fresh start or a redone Talk answer sends the history once (#17802) d184914
A runner's fetch through /api/v1/runner/jobs/:id/git/git-upload-pack no longer blocks the serving thread while the forge checks what the runner is asking for (#17821).
What blocked, before. I couldn't read the production [loop] log from the sandbox, so I measured the worst case locally: the largest negotiation a fetch may send (1 MiB gzipped, 16 MiB inflated, about 330k packets). Git itself already ran async and streamed its output. What blocked the thread was the work done before git gets the request:
negotiation()insrc/git/smart-http.tsinflated the body with onegunzipSync.heldNegotiation().pushinsrc/git/own_refs.tsthen read every packet in one unbroken pass. That pass also ran aflatMapover all packets to collect ids and afilterplus copy to build the output.
Result: 860–970 ms of blocked loop per fetch.
After.
- The body is inflated with async
gunzipon zlib's worker, still capped atFETCH_MAX. - The packet read and the output build run in
SLICE_MSslices, using the existingsliced()fromsrc/kernel/breathe.ts. Ids are collected as packets are read. - A first piece with nothing carried over is read where it lies, without copying.
The same bytes go to git, and the job-token check still runs before any spawn. Longest block is now 25–50 ms.
Test. test/runner-fetch-loop.test.ts sends that largest negotiation through serviceRpc with onlyWants. It checks git answers with a pack and that the loop is never blocked for 150 ms or more. The bound leaves room for a loaded machine and is far below the old path. For the test I moved the loop timer from test/boot-no-stall.test.ts into test/helpers/worst-block.ts, and both tests use it. It now waits for the timer's next tick rather than a fixed 10 ms. scripts/test-honesty-allow.json drops that file's one allowed fixed wait.
Not done:
feedStdin's gzip path and every othergunzipSynccaller are unchanged.feedStdindoes use the asyncgunzipnow, but it does not take this held path.- The first slice can still run about 25 ms, which is the slice length plus warm-up.
No door: server-side git transport only; no page, action or tool changed.
bun x tsc --noEmit and bun scripts/gate.ts --explain pass (32 of 32 rules). Passing tests: the new one, boot-no-stall, and the 19 suites that cover own_refs, smart-http and held fetches (162 tests). scripts/fast.ts named nearly the whole suite, so I picked those myself and left the full run to the forge's check.
Try it: bun test test/runner-fetch-loop.test.ts. It prints the longest block. Put back the two src/git files from b51ab2efa and it reports around 900 ms and fails.
🤖 Generated with Claude Code
A runner's fetch through
/api/v1/runner/jobs/:id/git/git-upload-packno longer blocks the serving thread while the forge checks what the runner is asking for (#17821).What blocked, before. I couldn't read the production
[loop]log from the sandbox, so I measured the worst case locally: the largest negotiation a fetch may send (1 MiB gzipped, 16 MiB inflated, about 330k packets). Git itself already ran async and streamed its output. What blocked the thread was the work done before git gets the request:negotiation()insrc/git/smart-http.tsinflated the body with onegunzipSync.heldNegotiation().pushinsrc/git/own_refs.tsthen read every packet in one unbroken pass. That pass also ran aflatMapover all packets to collect ids and afilterplus copy to build the output.Result: 860–970 ms of blocked loop per fetch.
After.
gunzipon zlib's worker, still capped atFETCH_MAX.SLICE_MSslices, using the existingsliced()fromsrc/kernel/breathe.ts. Ids are collected as packets are read.The same bytes go to git, and the job-token check still runs before any spawn. Longest block is now 25–50 ms.
Test.
test/runner-fetch-loop.test.tssends that largest negotiation throughserviceRpcwithonlyWants. It checks git answers with a pack and that the loop is never blocked for 150 ms or more. The bound leaves room for a loaded machine and is far below the old path. For the test I moved the loop timer fromtest/boot-no-stall.test.tsintotest/helpers/worst-block.ts, and both tests use it. It now waits for the timer's next tick rather than a fixed 10 ms.scripts/test-honesty-allow.jsondrops that file's one allowed fixed wait.Not done:
feedStdin's gzip path and every othergunzipSynccaller are unchanged.feedStdindoes use the asyncgunzipnow, but it does not take this held path.No door: server-side git transport only; no page, action or tool changed.
bun x tsc --noEmitandbun scripts/gate.ts --explainpass (32 of 32 rules). Passing tests: the new one,boot-no-stall, and the 19 suites that coverown_refs,smart-httpand held fetches (162 tests).scripts/fast.tsnamed nearly the whole suite, so I picked those myself and left the full run to the forge's check.Try it:
bun test test/runner-fetch-loop.test.ts. It prints the longest block. Put back the twosrc/gitfiles fromb51ab2efaand it reports around 900 ms and fails.🤖 Generated with Claude Code
Closes #17821