Repository navigation
fix(daemon): skip a stash event with no target oid instead of failing the side effect - #116
Merged
sagnik11 merged 1 commit intoNov 18, 2026
Conversation
… the side effect A stash pop, apply, branch, or drop with no resolvable target oid returned a hard error from rewrite synthesis. That failed the whole side effect and logged an error-level event with the sid in the message. A failed pop on an empty stack always hit this. Now the daemon skips only that stash event. A failed command logs at debug level, because git changed nothing. A successful command logs a warning. Add an integration test that pops an empty stack in daemon mode. Generated-By: PostHog Desktop Task-Id: e014bc24-9ad8-451b-8113-247b76d4543b
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
pop,apply,branch, ordrophas no resolvable target oid, the daemon fails the whole side effect. That stash's AI attribution is not carried over.main, a failedgit stash popon an empty stack always hits this. The terminal resolver correctly returns no target, and rewrite synthesis then returns a hard error. Git did nothing, but autter reports an error.Origin
fd62862Changes
test_stash_pop_empty_stack_does_not_fail_daemon_side_effects: pops an empty stack before any stash, and again after a stash and pop, then commits AI lines and checks the attribution.Note
A successful stash command with no target still loses that stash's attribution. This PR makes the failure contained and quiet. It does not recover the target.
Testing
mainwith the exact report error (stash Pop missing resolvable target oid) and passes with this change.cargo test --test integration stashin daemon mode: 105 passed.cargo test --lib stash: 21 passed.rustfmt --checkon the changed files andcargo clippy --all-targets -- -D warnings: clean.task testsuite or thewrapper-daemonmode.Agent context
resolve_stash_sha_for_event. For a failed top-of-stack pop it can still pick a stale sha from rewrite history. That is a separate edge case and it does not cause this error.resolve_stash_target_oid_for_terminal_payloadandresolve_stash_target_oid_for_command) as they are. They log a different error, and the report does not cover them.Created with PostHog Desktop from this inbox report.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.