Repository navigation
Expect the claude-code journey's woken comment from the watch after Escape - #3283
Merged
Merged
Conversation
…scape `leaf-dev journey claude-code --hooks-module` failed its `woken` step on main with "the command ended before Escape". The step waited for the hooks module to hand the comment to the running turn while its shell command still ran, then pressed Escape. #3169 removed that mid-turn append, so pending input now waits for the next PostToolBatch, which comes only when the command ends: the comment arrived at 23:40:13 and was picked up at 23:40:38, 25 s later, when the sleep finished. The module behaves as designed: the turn never read the comment, so the watch the module starts after Escape wakes for it, Claude Code drops the prompt, and the page nudges the session, whose new turn answers it. The step now requires that, rather than the old append and the "Carry on" prompt that answered it. - `woken` requires that the turn has not read the comment when Escape lands; with the module, that a turn after Escape answers it without the user typing; and in both modes that the comment sent afterwards is answered too. - `after_escape` takes the stopped turn, and accepts a later turn in place of a closed one or a running watch, since the watch after Escape may already have woken that turn. - The module's suite test now leaves an unread comment pending at Escape, the journey's case, where it used to post one after the watch started. Journey on this branch: every step passed with `--hooks-module` (`woken` nudged, "turn closed, no watch running, the page reads working") and without it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 20, 2026
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.
uv run leaf-dev journey claude-code --hooks-modulefailed itswokenstep on main with "woken: the command ended before Escape". The step waited for the hooks module to hand the comment to the running turn while its shell command still ran, and only then pressed Escape. #3169 removed that mid-turn append, so pending input now waits for the next PostToolBatch, which fires only when the command ends. In the failing run on main, the comment arrived at 23:40:13 and was picked up at 23:40:38, when the 25 s sleep finished.The module itself behaves as its header describes. The turn never read the comment, so the watch the module starts after Escape wakes for it, Claude Code drops the prompt, and the page nudges the session, whose new turn answers it. The step now requires that outcome, and no longer relies on the old append or the "Carry on" prompt that answered it.
wokenrequires that the turn has not read the comment when Escape lands. With the module, a turn after Escape must answer it without the user typing. In both modes, the comment sent afterwards must be answered too.after_escapetakes the stopped turn. It accepts a later turn in place of a closed one or a running watch, because the watch after Escape may already have woken that turn.test_the_module_hands_input_to_a_running_turn_and_closes_an_interrupted_one) now leaves an unread comment pending at Escape, the journey's case. Before, it posted the comment after the watch had started.Journey results: on main,
--hooks-modulefailed atwokenafterescapepassed. On this branch, every step passed in two runs with--hooks-module, wherewokenread "turn closed, no watch running, the page reads working; nudged", and in one run without it.