Repository navigation
fix(runner): read a publication's files in one process - #330
Merged
Merged
Conversation
Quest-Claim: 11dc9a241c7f36ad
A snapshot spawned one `git cat-file blob` per changed path, and the checkpoint before a continuation read every file's content only to count the changes. The 60-path conflicted-continuation test spawned 126 git processes for this; on a loaded host each spawn costs tens of milliseconds, which pushed the test past vitest's 5s limit in the land gate. Publishing now reads every blob through one `git cat-file --batch`, and the checkpoint uses the diff without reading any file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
October 31, 2026 21:01
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
kixelated
enabled auto-merge (squash)
November 1, 2026 21:01
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.
Finishes quest/m0/kix/runner-timeout.md and deletes it, along with its link in the kix epic.
Summary
The test
test/runner.test.ts> "pauses a large conflicted continuation with a bounded question and intact checkout" ran past vitest's 5s limit in the host land gate (5038ms and 5170ms on 2026-10-31). That ejected moq-dev/quest#320 and moq-dev/quest#329.Cause. I wrapped
gitin a logging shim and found that 126 of the test's 181 git processes weregit cat-file blob <oid>, one per changed path:Each spawn costs tens of milliseconds on a loaded host. With the shim's extra overhead, the 60 checkpoint reads alone took 2s, and the test timed out at 5045ms.
Fix (
src/runner/workspace.ts):#pending()computes the tree, the merged commit, and each changed path's blob id without reading any file. The checkpoint before a continuation uses only this.snapshot()builds on#pending()and reads every blob with onegit cat-file --batch. This is the same patternsrc/cli/tree.tsalready uses.The test now spawns 2 blob-reading processes instead of 126. This also speeds up real publications with many files. The timeout and the test itself are unchanged.
Measurements
The single test ran pinned to 2 CPUs (
taskset -c 0,1), with 8 busy loops competing for those CPUs:The remaining time goes to about 60 git calls that the continuation flow needs (fetch, worktree, merge, read-tree/add/write-tree) and to starting the fake
claude/nixbun processes.Choices made without asking
LIMITS.bytesincloudflare/src/jobs/publish.ts), so the total cap only affects publications kix would reject anyway. Past 64 MiB, the error now comes from git'smaxBufferinstead of kix's "Publication too large".Checks
just check: passenv -u CLAUDE_CONFIG_DIR just test: pass (726 passed, 2 skipped; worker 426 passed)Suggested follow-ups
conflicts()(git diff --diff-filter=U) twice in a row while pausing a conflicted continuation: once inWorkspace.prepareand again when it builds the question. This is minor, so I'm not planning a quest for it unless the runner's spawn count matters elsewhere.Review
gpt-6.1-sol, medium effort, viaquest review --base origin/main(session01a193c3-9de8-7160-a35d-114d9e3c1f8f, round 1)🤖 Generated with Claude Code
(Written by Claude Opus 5.5)