fix(daemon): stop logging vanished clone/init target as an error - #60
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
After a successful clone or init, finalize_root_exit resolves the new repo's family key. When the target directory is already gone (an expected race for agent staging clones and throwaway test repos), common_dir_for_repo_path finds no repo and the branch logged via observability::log_error, which the telemetry bridge turns into a user-facing $exception. The code already keeps the best worktree hint and continues, so attribution is never affected. Treat the vanished target as a benign outcome: log it at warn level (a Message envelope, not an Error), mirroring the vanished-working-dir and missing-reflog guards in the same function. Move the absolute path out of the message and into structured context so occurrences group into one issue instead of fragmenting one per directory. paths: src/daemon/trace_normalizer.rs Generated-By: PostHog Desktop Task-Id: 8656b2be-b314-4b57-ae05-63890fc0b543
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 clone/git init,finalize_root_exitresolves the new repo's family key. When the target directory is already gone,common_dir_for_repo_pathfinds no repo and the branch calledobservability::log_error, which the telemetry bridge turns into a user-facing$exception.Changes
Messageenvelope, which the telemetry worker never turns into an$exception) instead oflog_error. This mirrors the two existing benign-race guards in the same function (vanished working dir, missing reflog end cut).Option<(PathBuf, AutterError)>toOption<PathBuf>now that no error object is built.Testing
clone_target_vanished_before_finalize_keeps_worktree_hint_and_does_not_error: the target never materializes on disk; finalize still succeeds, keeps the worktree hint, and falls back toGlobalscope.cargo test --lib daemon::trace_normalizer— 21 passed.cargo check --locked --all-targetsandrustfmt --checkclean.Agent context
telemetry_worker.rsthat onlyTelemetryEnvelope::Errorreaches the error buffer (→$exception);Messageenvelopes go to a separate buffer, so warn-level logging removes the exception without losing the signal.Created with PostHog Desktop from this inbox report.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.