Skip to content

Hold the journey's boundary answer by the page's record, not the command's text - #7454

Merged
max-sixty merged 1 commit into
mainfrom
boundary-wake-timeout
Nov 27, 2026
Merged

max-sixty merged 1 commit into
mainfrom
boundary-wake-timeout

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The claude-code journey's boundary step needs its comment admitted after the wake's turn answers first-wake and before the tool boundary after that answer. Its PreToolUse hook found the answer by reading the shell command's text, a rule #6556 added (naming then that an answer posted another way would slip past) and #7436 patched once the agent chained its progress line, edit and answer in one command. This replaces the text rule with the page's own record: a PostToolUse hook holds every tool call while the step runs, each in a file of its own, and the step lets a call go unless the page has first-wake answered. The call that answered makes its file after the answer is admitted, so it waits until boundary is admitted however the agent writes or batches its calls. The jq read, the --ephemeral count, the second marker file and the past-the-hold check go.

To weigh: it relies on Claude Code starting PostToolBatch only after every PostToolUse hook of the batch has ended, which 2.1.332 does (two parallel calls, a 3 s PostToolUse hook, PostToolBatch after both). Holding every call costs the step about a second in all.

Max asked for a broad simplification that would end this kind of bug, after #7436; nobody has read this yet. A full leaf-dev journey run claude-code passed every step, boundary in 47 s; dev/tests/model/test_journey.py passes.

This was written by Claude Code on behalf of max-sixty

…and's text

The claude-code journey's `boundary` step needs its comment admitted after the wake's turn answers `first-wake` and before the tool boundary that follows. Its PreToolUse hook found the answer by reading the shell command's text: #6556 held a `thread reply` without `--ephemeral`, naming then that an answer posted another way would slip past, and #7436 patched the rule once the agent chained its progress line, edit and answer in one command. Each patch guessed the agent's command shape again.

A PostToolUse hook now holds every tool call while the step runs, each in a file of its own, and the step lets a call go unless the page has `first-wake` answered (`deployment_answer`, the fact the step already waits on). The call that answered makes its file after the answer's admission, so it waits until `boundary` is admitted, however the agent wrote the command or batched its calls. That deletes the text rule, its jq read, the second marker file and the check that the answer went past the hold.

Claude Code 2.1.332 starts PostToolBatch only after every PostToolUse hook of the batch ends (checked with two parallel `echo` calls and a 3 s PostToolUse hook), so Leaf's PostToolBatch hook reads the comment the step admitted during the hold.

A full `leaf-dev journey run claude-code` passed every step, `boundary` in 47 s: the wake's turn ran a progress line, a Grep, an Edit and its answer as four calls, the first three held 0.1 to 0.6 s each and the answer's 0.3 s, until `boundary` was admitted. All 62 PostToolUse runs exited 0. The 146 `thread reply` commands in 49 recorded journey runs all classify correctly under #7436's rule, so no second failing case was seen; the change rests on the condition's two patches and on reading the fact where Leaf records it.
@max-sixty
max-sixty merged commit dc179b8 into main Nov 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the boundary-wake-timeout branch November 27, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants