Widen vanished-working-dir guard to silence self-check race noise - #52
Merged
sagnik11 merged 1 commit intoAug 19, 2026
Conversation
The daemon guard `is_missing_working_dir_error` only matched exit-128 git errors whose stderr contained "No such file or directory". When `autter doctor` deletes its diagnostic scratch repo while a daemon side effect is still in flight, git often reports "not a git repository" instead, and on Windows the read fails first as an IoError with a not-found kind. Both slipped through and were reported as async side-effect exceptions, which is self-inflicted error-tracking noise from a throwaway repo we created and deleted ourselves. Widen the guard to also treat exit-128 "not a git repository" and any IoError with `ErrorKind::NotFound` as the same benign vanished-directory race. Generated-By: PostHog Desktop Task-Id: 47985953-a2e0-4ee9-be0f-7060ed7ab133
sagnik11
marked this pull request as ready for review
August 19, 2026 18:01
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
autter doctor's self-check emits self-inflicted error-tracking noise: it deletes its diagnostic scratch repo while daemon side effects can still be in flight, and the guard meant to swallow that race missed two of its shapes.~/.autter/internal/debug-self-checks/, so no user data or attribution is at risk. The cost is signal quality — everyautter doctorrun can add another false exception that buries the real daemon side-effect failures we want to see.is_missing_working_dir_error(src/daemon.rs) only matched exit-128 git errors whose stderr containedNo such file or directory. The vanished directory surfaces in three shapes, not one.fatal: cannot change to '...': No such file or directoryfatal: not a git repository (or any of the parent directories)IO error: The system cannot find the path specified. (os error 3)IoError, notGitCliError(Windows)Changes
not a git repositoryand anyIoErrorwithErrorKind::NotFoundas the same vanished-directory race, so the daemon skips the side effect quietly instead of reporting an exception.IoErrorwithPermissionDeniedis still a real fault).Scope note
This addresses the reported symptom (the guard misses two of the three ways the vanished-dir race appears). The report also mentions two optional hardenings — waiting for the daemon family to go quiet before
remove_dir_all, or suppressing telemetry fordebug_self_check_root()paths. Those are not included; the guard widening is the root-cause fix the report identifies as sufficient.Testing
task test/task lint/task fmtwere not run. Please run them in CI. The added tests aremissing_working_dir_error_detects_exit_128_not_a_git_repository,missing_working_dir_error_detects_io_not_found, and the extendedmissing_working_dir_error_ignores_other_git_failures.Created with PostHog Desktop from this inbox report.