Skip to content

Hold the journey's boundary answer when one command also posts the progress line - #7436

Merged
max-sixty merged 2 commits into
mainfrom
boundary-wake-timeout
Nov 27, 2026
Merged

max-sixty merged 2 commits into
mainfrom
boundary-wake-timeout

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The claude-code journey's boundary step timed out after 300 s with "the wake's turn did not answer its comment", though the turn had answered. Its PreToolUse hook, which holds the wake's answer so the boundary comment arrives at the tool boundary after it, passed any command containing --ephemeral. The agent chains the progress line, the edit and the answer in one command (leaf thread reply … --ephemeral; <edit>; leaf thread reply … --done), as conversation-loop.md suggests, so the answer went out unheld and the driver waited for a hold that never came.

The hook now holds a command that runs thread reply more often than it passes --ephemeral, and the step stops waiting once first-wake is answered, so a missed hold fails at once and says so.

Replaying the failed run's last four reply commands, the old hook passed the three chained ones and the new hook held all four. A full uv run leaf-dev journey run claude-code on this branch passed every step, boundary in 31 s, though in that run the agent sent its answers without a progress line. dev/tests/model/test_journey.py passes.

Max asked for this fix by dispatching it from a session that saw the failure.

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

…ogress line

The claude-code journey's `boundary` step holds the wake's answer to `first-wake` in a PreToolUse hook, so the `boundary` comment arrives at the tool boundary after that answer. The hook passed any command containing `--ephemeral`, on the premise that a command posts either a progress line or an answer. The agent may chain both, as `conversation-loop.md` suggests: `leaf thread reply … --ephemeral; <edit>; leaf thread reply … --done`. The hook passed that command, the answer posted unheld, `answer-held` never appeared, and the step waited out its 300 s with "the wake's turn did not answer its comment", though the turn had answered.

The hook now holds a command that runs `thread reply` more often than it passes `--ephemeral`, reading the command through jq. And the step stops waiting once `first-wake` is answered, so a hold that misses fails at once, saying the answer went past the hold.

Evidence: in run-20261127-102742-3avblaqe (branch mod-line-missing), the last four reply commands of the session were all chained; replayed through both hooks, the old one passed three of them and the new one held all four. A full `leaf-dev journey run claude-code` on this branch passed every step, `boundary` in 31 s; in that run the agent posted each answer without a progress line, so the old hook would have held it too.
@max-sixty
max-sixty merged commit 8d174b0 into main Nov 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the boundary-wake-timeout branch November 27, 2026 20:47
max-sixty added a commit that referenced this pull request Nov 27, 2026
…and's text (#7454)

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_
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