Repository navigation
fix(daemon): stop reporting rewrite synthesis failures for a deleted worktree - #117
Merged
sagnik11 merged 1 commit intoNov 20, 2026
Conversation
…worktree An agent can delete a temporary worktree before the daemon handles the git command. Rewrite synthesis then fails in find_repository, and the error-level log sent the benign race to error tracking with the temporary path in the message. The outer vanished-repo guard already skipped the side effect, but the inner log ran first. Now the rewrite synthesis error arm checks is_vanished_repo_error first. When it is true, the daemon logs at debug level and returns the error as before, so the outer guard still runs. Other rewrite synthesis failures still log at error level. Add a unit test that runs find_repository on a deleted worktree. Generated-By: PostHog Desktop Task-Id: 272e438d-f425-4b6f-bda6-6a9b8eb02ab8
Contributor
|
Found 6 test failures on Blacksmith runners: Failures
|
sagnik11
marked this pull request as ready for review
November 20, 2026 03:46
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.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Problem
rewrite_events_from_semantic_eventsthen fails infind_repositorywithnot a git repository. The innertracing::error!("strict rewrite synthesis failed")runs before the outeris_vanished_repo_errorguard, andsentry_layer.rssends every ERROR-level log to error tracking.Origin
c2b5f87Changes
Errarm checksis_vanished_repo_error(&error, cmd.worktree.as_deref())first. When it is true, the daemon logs at debug level and returns the error as before, so the outer guard inmaybe_apply_side_effects_for_applied_commandstill skips the side effect.vanished_repo_error_detects_find_repository_on_deleted_worktreerunsfind_repositoryon a deleted worktree and also checks the Windowsnot a git repositoryshape.Why
Checks
cargo test --locked --lib vanished_repo: 2 passed.cargo clippy --locked --lib --tests -- -D warnings: clean (Rust 1.93.0).rustfmt --check --edition 2024 src/daemon.rs: clean.task testintegration suite andtask lint/task fmt(taskis not installed in the sandbox). The change is one log-level branch and one unit test, and CI runs the full suite.Success measure
strict rewrite synthesis failedand containsnot a git repositorygo to 0. The volume is too low for a quiet period to prove the fix, so the unit test is the main check.Agent context
find_repositoryerror on a deleted worktree instead.Created with PostHog Desktop from this inbox report.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.