Skip to content

fix(sidecar): re-register a missing origin remote instead of crashing on attach - #52

Merged
ExtraToast merged 2 commits into
mainfrom
fix/sidecar-recover-missing-origin
Sep 10, 2026
Merged

ExtraToast merged 2 commits into
mainfrom
fix/sidecar-recover-missing-origin

Conversation

@ExtraToast

Copy link
Copy Markdown
Contributor

fix(sidecar): re-register a missing origin remote instead of crashing on attach

A prior crashed boot can leave the vault dir as a real git repo (Repo.init
persisted) but without the origin remote registered (create_remote/fetch
never completed). On the next boot attach() hit
self._repo.remotes.origin.fetch() and GitPython raised
AttributeError: 'IterableList' object has no attribute 'origin',
crash-looping the pod.

Look origin up by name via a defensive _origin() helper; if it is None
re-create the remote and fetch, so attach() converges instead of crashing.
Also use the same lookup in the init_adopted path.

Verified: 14 tests pass (including the new
test_attach_readds_origin_when_missing which reproduces the crash), ruff +
mypy clean.

… on attach

A prior crashed boot can leave the vault dir as a real git repo (Repo.init
persisted) but without the origin remote registered (create_remote/fetch
never completed). On the next boot attach() hit
`self._repo.remotes.origin.fetch()` and GitPython raised
`AttributeError: 'IterableList' object has no attribute 'origin'`,
crash-looping the pod.

Look origin up by name via a defensive `_origin()` helper; if it is None
re-create the remote and fetch, so attach() converges instead of crashing.
Also use the same lookup in the init_adopted path.

Verified: 14 tests pass (including the new
test_attach_readds_origin_when_missing which reproduces the crash), ruff +
mypy clean.
@ExtraToast ExtraToast added type: bug Something is broken or behaving incorrectly. area: knowledge Knowledge base, recall, capture, or curation. component: api HTTP API, OpenAPI contract, or API client concern. priority: P1 High; important and should be handled in the current iteration. labels Sep 10, 2026
A bare Repo.init leaves the repo on the git default branch (often master),
so after re-registering a missing origin we must check out the tracked
branch (main) to converge. Fixes the CI failure where the re-add-origin
attach left the checkout on master.
@ExtraToast
ExtraToast merged commit 31bb2ae into main Sep 10, 2026
13 checks passed
@ExtraToast
ExtraToast deleted the fix/sidecar-recover-missing-origin branch September 10, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: knowledge Knowledge base, recall, capture, or curation. component: api HTTP API, OpenAPI contract, or API client concern. priority: P1 High; important and should be handled in the current iteration. type: bug Something is broken or behaving incorrectly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant