Repository navigation
fix(hook): resolve the async gate when an absorbed notification leaves the queue - #99
Closed
charan-rathore wants to merge 3 commits into
Closed
charan-rathore wants to merge 3 commits into
charan-rathore wants to merge 3 commits into
Conversation
Refine handling of queued commands and removals in langfuse_hook.
|
|
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.
Summary
Fixes #96. Claude Code 2.1.281 can absorb a background Bash completion into a running turn, then write a
queue-operationremoverow with the notification content. The hook treated that row as another enqueue, so the async gate stayed closed atStop. The final turn could be left untraced if no later prompt arrived.Treat a content-bearing
removeas resolution of that notification. A remove without content still cannot be matched and keeps the existing conservative behavior.Tests
Added offline Python hook regressions for a mid-turn absorbed notification and a contentless remove. An integration fixture uses the issue's Claude Code row shapes and checks that the final turn exports at its own
Stopwithout a later prompt orSessionEnd, and does not duplicate on another idle invocation.uv run --offline --group dev -m pytest -q: 282 passed. The two touched test files also passed (11 tests).python3 -m compileallandgit diff --checkpassed. Dependencies were installed from the package index once to set up the test environment; test runs were offline. No live Langfuse or Claude CLI was used.Instinct assisted with the change and tests.