Repository navigation
Conversation
A nested repository is staged into the snapshot store as a gitlink to
its HEAD. When its branch has no commit yet, git add cannot record the
gitlink and fails the whole batch ("'<dir>/' does not have a commit
checked out ... fatal: adding files failed"), so every snapshot in that
project stays stale: no session diffs, patches or reverts.
add() now checks each candidate directory that holds a .git entry with
`git --git-dir <dir>/.git rev-parse --verify --quiet HEAD` and leaves
out the ones without a HEAD until their first commit. Nested
repositories with a commit are still recorded as gitlinks, and plain
directories are untouched, since only paths with their own .git are
checked. An explicit --git-dir avoids discovery climbing into the
parent repository and the safe.directory ownership check.
Fixes the failure reported in anomalyco#23105. The earlier attempts anomalyco#44259 and
anomalyco#44250 skipped every directory entry, which also drops the gitlinks of
nested repositories that do have commits.
AI-Model: anthropic/claude-opus-5-5
AI-Variant: high
AI-Tool: opencode 1.19.5-vt-464-006d837c50
AI-Platform: linux
AI-Harness: Vibeterm df0af2c9bb7
AI-Session-ID: ses_e284adde6ffe1ycvQIhjknnH3s
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Nov 17, 2026
Add pr-queue/00-open-slots.md as the daily drain's record of the three open author PRs (anomalyco#63062, anomalyco#63063, anomalyco#63897), their checks, next nudges and a log of every nudge, starting with the 2026-11-17 pings on anomalyco#63062 and anomalyco#63063. Mark entry 06 filed as anomalyco#63897; it still read "not filed" after anomalyco#54578 closed and freed its slot. The cap stays full and entry 10 is next in line. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.18.34-vt-101-907b3bc518 AI-Platform: linux AI-Harness: Vibeterm 3c3f1fadd21 AI-Session-ID: ses_eeda1d251ffel81U5Y42j4kb33
This branch has not been deployed
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.
Issue for this PR
Fixes the snapshot failure reported in #23105.
Type of change
What does this PR do?
The snapshot store records an untracked nested repository as a gitlink to its HEAD. When that repository's branch has no commit yet,
git addcannot record the gitlink and fails the whole batch:Every later snapshot in that project fails the same way, so the session gets no diffs, patches or reverts until the nested repository gets a commit.
add()now checks each candidate directory that holds a.gitentry withgit --git-dir <dir>/.git rev-parse --verify --quiet HEADand leaves out only the ones without a HEAD. Nested repositories with a commit are still recorded as gitlinks, and ordinary directories are untouched. The explicit--git-dirkeeps git from climbing into the parent repository and skips thesafe.directoryownership check.#44259 and #44250 skipped every directory entry instead, which also drops the gitlinks of nested repositories that do have commits.
How did you verify your code works?
From
packages/opencode:bun run test test/snapshot/snapshot.test.ts- 56 pass, 1 skip, 0 fail. The new test "nested repository without a commit does not block the snapshot" creates a nested repository with no commit, then a nested repository with a commit and a modified tracked file. It asserts that the patch lists the modified file and the committed repository's gitlink and nothing under the empty one. Without the source change the patch is empty and the test fails.bun typecheck- passed. Prettier is clean on both files.Screenshots / recordings
Not a UI change.
Checklist
This PR is AI generated, but under direct supervision and on request of @Nowaker.
)