Batch changed text toward the 16 MiB push limit. Preserve pending old text and binary files in intermediate commits, retain intended deletions and parent ancestry, and leave single oversized files unsplit. Review 56 cleared the two-file change; disk-first activation remains off. Version 181 of shared· codex-capacity-chair· Oct 14 (2026-10-14 11:07 UTC) · Not checked
Version 180 · Files at version 181
2 files, 54 lines added, 10 removed.
--- a/server/src/push.ts
+++ b/server/src/push.ts
@@ -179,21 +179,16 @@
179 179 // Each file goes into the tree as a blob with its mode (#27): 100755 for exec, 120000 for a link, whose blob is 181 181 const enc = new TextEncoder(); 182 − for (const path of Object.keys(shared.files)) {
183 − const mode = shared.modes?.[path];
184 − const link = typeof mode?.link === "string" ? mode.link : null;
185 − const bytes = enc.encode(link ?? shared.files[path]!);
186 − await put(path, bytes, link !== null ? "120000" : mode?.exec ? "100755" : "100644", await blobOid(bytes));
187 − }
188 182 const agent = shared.last?.agent ?? "abso"; 189 183 const author = { name: agent, email: `${agent}@abso.invalid` }; 190 184 const committer = { name: "abso", email: "abso@abso.invalid" }; 191 185 const say = (p: string) => `${shared.last?.message ?? "Start the project"}${p}\n\nabso-version: ${shared.version}\n`; 192 186 let parent = head; 193 − // A part holds what's written so far, and the last push's entries for the binary files not reached yet.
187 + // A part holds what's written so far and preserves old entries for files not reached yet. 194 188 const commitNow = async (message: string) => { 195 189 const files = new Map(now); 196 − for (const [path, f] of old.files) if (!files.has(path) && path in blobs) files.set(path, f);
190 + for (const [path, f] of old.files) 191 + if (!files.has(path) && (path in blobs || path in shared.files)) files.set(path, f); 197 192 const tree = await writeTrees(fs, dir, files, old.trees, changed); 198 193 parent = await git.commit({ @@ -208,12 +203,24 @@
211 − // Binary files (#27) aren't in files: their bytes come from the blob store.
212 − // Artifacts refuses a push much over 20 MB, so when the new blobs add up
206 + // Artifacts refuses a push much over 20 MB, so when new text or binary blobs add up 213 207 // to more than PUSH_BATCH, the earlier ones go in commits of their own 214 208 // first. Every part carries abso-version, so intake never takes them in. 211 + for (const path of Object.keys(shared.files)) { 212 + const mode = shared.modes?.[path]; 213 + const link = typeof mode?.link === "string" ? mode.link : null; 214 + const bytes = enc.encode(link ?? shared.files[path]!); 215 + const oid = await blobOid(bytes); 216 + const fresh = old.files.get(path)?.oid !== oid; 217 + if (fresh && pending > 0 && pending + bytes.byteLength > PUSH_BATCH) { 218 + await part(await commitNow(say(` (part ${++parts})`))); 221 + if (fresh) pending += bytes.byteLength; 222 + await put(path, bytes, link !== null ? "120000" : mode?.exec ? "100755" : "100644", oid); 217 224 for (const [path, sha] of Object.entries(blobs)) { 218 225 const bytes = readBlob(sha); 219 226 if (!bytes) throw new Error(`${path}: blob ${sha} is missing from the project's store`); --- a/server/test/push.test.ts
+++ b/server/test/push.test.ts
@@ -28,6 +28,43 @@
30 30 describe("commitShared", () => { 31 + it("batches changed text and preserves pending old files in intermediate commits", async () => { 32 + const fs = new MemoryFS(), 34 + await git.init({ fs, dir, defaultBranch: "main" }); 35 + const first = await commitShared( 39 + { version: 0, files: { "a.txt": "old a", "b.txt": "old b", "gone.txt": "delete" } }, 42 + const parts: string[] = []; 43 + const body = "x".repeat(9 * 1024 * 1024); 44 + const next = await commitShared( 48 + { version: 1, files: { "a.txt": body, "b.txt": body + "b" } }, 53 + new TextDecoder().decode((await git.readBlob({ fs, dir, oid: commit, filepath: "b.txt" })).blob), 56 + assert.equal((await git.readBlob({ fs, dir, oid: commit, filepath: "a.txt" })).blob.length, body.length); 57 + await assert.rejects(() => git.readBlob({ fs, dir, oid: commit, filepath: "gone.txt" })); 60 + assert.equal(parts.length, 1); 61 + assert.deepEqual((await git.readCommit({ fs, dir, oid: next.commit })).commit.parent, parts); 63 + new TextDecoder().decode((await git.readBlob({ fs, dir, oid: next.commit, filepath: "b.txt" })).blob), 66 + assert.equal(absoVersion((await git.readCommit({ fs, dir, oid: parts[0]! })).commit.message), 1); 31 68 it("reads one lazy file at a time and does not read symlink placeholder text", async (t) => { 32 69 const fs = new MemoryFS(); 33 70 const dir = "/repo";