Fall back to isogit store when git is absent - #576
Conversation
Harbor and minimal containers have no git binary; the optimized wrapper shells out via Bun.spawn and fails the first cycle commit.
|
Review verdict: regression risk — needs a human decision before this can merge. Flagging rather than blocking outright, since the portability need behind it is real. Detection is sound. The problem is that the fallback silently truncates history. The wrapper writes turns as rolling segments ( The reviewer verified this directly: wrote 3 turns through The scenario that hits it is exactly the one this PR exists to serve: a session dir written under wrapper mode (git present), later resumed where git is absent — the same Second, independent gap: the base store's And it is silent. No Suggested reshape, from the reviewer: keep the segmented layout and the torn-tail/orphan resilience in both modes, and swap only the commit mechanism (native git spawn vs isomorphic-git) — push the git-presence check down into Not stale: merges clean, typecheck and the 22 store tests pass on current main. Note the two added tests only read back through the same mode they wrote with, so no cross-mode test would have caught this. |
|
Closing rather than reshaping — the implementation is unsafe and the simplest fix is probably not code at all. Why it cannot merge as written: the fallback swaps the entire storage implementation, not just the commit transport. The wrapper writes turns as rolling segments ( Worse than an under-read: the base store also rewrites The requirement is real — Harbor and minimal containers, per CL-6923 — so it is filed separately rather than dropped. Three ways to satisfy it, cheapest first:
Note the two tests here only read back through the same mode they wrote with, so no cross-mode test would have caught the truncation. Whatever lands next needs a test that writes under one mode and reads under the other. |
Summary
gitis missing from PATH,createOptimizedContextStorereturns the base isomorphic-git store instead of wrapping commit/readAt withBun.spawn(["git", ...]).Verification
bun run typecheckpassesbun test src/session/optimized-context-store.test.ts— 22 pass (includes no-git fallback + native-git still wraps)