fix(daemon): skip carryover capture for non-repository worktrees - #57
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
Carryover snapshot capture ran repo discovery on the traced command's worktree hint. When that hint is a temporary, non-repository directory, discovery returns a Generic "no repository found" error that the daemon logged as an exception, filing self-inflicted noise into error tracking. Treat "no repository found" as a benign no-snapshot case: return Ok(None) instead of reporting. Real discovery faults still surface. Add is_no_repository_discovered_error to classify the discovery outcome, and reuse the message via a shared prefix constant. Generated-By: PostHog Desktop Task-Id: 83371094-8d8a-4a81-8bdc-6f06020f7127
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
capture_carryover_snapshot_for_commandresolves a repo from the traced command's worktree hint. When that hint is a temporary, non-repository directory (e.g. a skills-publish scratch dir under/private/tmp), discovery returnsAutterError::Generic("No git repository found for path without exec").Genericerror is logged as atracing::error!→ one$exceptionper occurrence. The benign-race guardis_missing_working_dir_erroronly matchesGitCliErrorexit 128 andIoErrornot-found, so theGenericerror slips past it.stage=repo_discoveryshape recurs across several git subcommands (ls-remote,add,commit,credential,config,git-remote-https,worktree), and each new subcommand opens a fresh error-tracking issue for someone to triage.Changes
Ok(None)instead of reporting an error.is_no_repository_discovered_erroringit/repository.rsto classify the discovery outcome, backed by a shared message-prefix constant so the producer and the classifier cannot drift.Tests
carryover_capture_in_non_repository_worktree_returns_no_snapshot— acommittraced in a temp non-repo dir returnsOk(None), not an error.discovery_in_non_repository_path_is_recognised_as_benign— discovery on a non-repo dir is classified benign.other_errors_are_not_recognised_as_no_repository— a differentGenericfault and anIoErrorare not misclassified.Why
Repo discovery over a temporary, non-repository directory is a normal, expected outcome — there is simply no carryover state to snapshot. Reporting it as an exception pollutes error tracking and spawns a new issue for each git subcommand, without any user-facing failure to fix.
Created with PostHog Desktop from this inbox report.