Repository navigation
fix(daemon): skip side-effect errors when the repo was deleted mid-operation - #67
Draft
posthog[bot] wants to merge 2 commits into
Draft
posthog[bot] wants to merge 2 commits into
posthog[bot] wants to merge 2 commits into
Conversation
…eration The vanished-repo guard matched only exit-128 stderr text and NotFound IO errors. git also reports the race in other shapes, for example `git diff` exits 1 with "Could not access <oid>" after the objects are gone, so those errors still reached error tracking. The guard now also treats any git or IO error as benign when the command's worktree, its git dir HEAD, or its objects dir no longer exists. The daemon now reports in-flight side effects per family in the family status, and the `autter doctor` attribution self-check waits for them before it deletes its repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 509cd030-ac58-4e8e-84a3-7f359e5a5d9c
…_for_worktree Move the repo-state check into a separate is_vanished_repo_error wrapper, so is_missing_working_dir_error and its tests stay as they were. Resolve the git dir with git_dir_for_worktree instead of a hand-written ladder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 509cd030-ac58-4e8e-84a3-7f359e5a5d9c
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.
Problem
git diffbetween the commit and its parent. When the repo is deleted first, git exits 1 withCould not access <oid>.is_missing_working_dir_errormatches only exit-128 stderr text andNotFoundIO errors. So this shape gets to both log sites (command side effect failed,async side-effect error).autter doctorattribution self-check deletes its repo without waiting for daemon side effects, and developer tests delete temp repos right after they commit.Changes
is_vanished_repo_errortreats anyGitCliErrororIoErroras benign when the command's worktree, its git dirHEAD, or itsobjectsdir no longer exists. The existingis_missing_working_dir_errortext match is unchanged and stays as a fallback.repository_is_goneresolves the git dir with the existinggit_dir_for_worktree, so a subdirectory of a live repo resolves to that repo and still reports real errors.FamilyStatusgetsinflight_effects(with#[serde(default)], so older daemons read as 0). The self-check polls it until the value is 0, within its current deadline, beforeremove_dir_all.No such file or directory/not a git repositoryIoErrorNotFoundCould not access <oid>, repo deletednot a tree object/bad object, objects deletedNote
Draft #64 adds more exit-128 strings to
is_missing_working_dir_error. When the objects dir is gone, this PR also covers those shapes. This PR does not edit that function, so both can merge. Draft #66 changes the two log sites, which this PR does not touch.Testing
cargo test --lib -- missing_working_dir repository_is_gone: 6 passed (2 new tests: exit-1Could not accesswith a live, objects-deleted, and fully deleted repo; and a subdirectory of a live repo).cargo test --lib daemon: 139 passed.cargo test --lib diagnostics: 9 passed.cargo clippy --all-targets -- -D warningsandcargo fmt --check: clean.doctor_validates_checkpoint_round_trip_end_to_endfails in the sandbox withgit commit ... (status=1). It fails the same way on unchangedmain, so the cause is the sandbox environment. CI must confirm it.Agent context
checkpoint side effect failedlog site has no vanished-repo guard, andinflight_effectsdoes not count commands still queued in the family sequencer. Both are possible follow-ups.Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.