Skip to content

Hand the journey's boundary comment over after the wake's answer, and ask for the release on the page - #6556

Merged
max-sixty merged 3 commits into
mainfrom
agent-ad21784d6d498d7ea
Nov 20, 2026
Merged

max-sixty merged 3 commits into
mainfrom
agent-ad21784d6d498d7ea

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Two steps of the claude-code journey stopped on what the agent chose rather than on what Leaf did.

boundary stopped in 2 of the 9 runs recorded since #6463 made each delivery comment a rewording, which the wake's turn answers with an Edit and then a leaf thread reply. Where the light fork handed boundary over between the Edit and the reply, Escape left first-wake edited but unanswered, and the woken agent asked whether to finish both rather than finishing. The session's settings now add a PreToolUse hook beside the slow one, which holds a leaf thread reply that isn't --ephemeral while the step asks. The step holds the wake's answer, sends boundary, waits for its line fork's hand_over, then releases the answer with the slow hooks armed, so the handover lands after the answer however the agent batches its calls and however long the fork takes. The step also checks directly that a prompt after Escape names boundary as owed.

release asked the agent to record a release "on the board", whose columns hold only defects. Agents put it in a status tile beside the board in 73 of the 74 earlier runs on this machine, but two sandboxed runs of this branch in a row asked where it belonged, which the step counts as a failure. The ask now says "on the page"; where the page shows it stays the agent's call.

To weigh: the hook matches thread reply in the command text, so an answer posted some other way wouldn't be held and the old race would return for it.

Found in #6554's journey runs; nobody has read it yet beyond Leaf's review of the first commit. leaf-dev journey run claude-code passed all 17 steps, once plain (answer held 3.8 s while the fork handed boundary over) and once with --sandbox after the release change; dev/tests/model/test_journey.py and pre-commit pass.

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

…Escape leaves no comment half done

The claude-code journey's `boundary` step stopped in 2 of the 9 runs recorded since #6463 made each delivery comment a rewording. The wake's turn answers `first-wake` with an Edit and then a `leaf thread reply`. In 4 of the 9 runs the agent put the Edit alone in its tool batch, so the PostToolBatch after the Edit handed `boundary` over, and Escape left `first-wake` edited but unanswered. The woken prompt then named both comments as owed. In 2 of those 4 the agent said it had stopped because the user interrupted and asked whether to finish both, a reasonable answer to an interrupt mid-work, so neither comment got an answer within 150 s. Where the Edit and the reply shared a batch (4 of 4), the woken turn answered the one comment owed.

The session's settings now add a PreToolUse hook beside the slow prompt and tool-batch hook. While the step's hold file exists, it holds a `leaf thread reply` that isn't `--ephemeral`, and marks that it holds one. The step holds the wake's answer to `first-wake`, sends `boundary`, waits for its line fork's `hand_over`, and releases the answer with the slow hooks armed. The handover therefore lands at the tool boundary after the answer, however the agent batches its calls and however long the fork takes. The step also checks directly that a prompt after Escape names `boundary` as owed, which it inferred before from one handover and an answer.

Later steps rely only on what `between` already requires after `boundary`; the step removes the hold files in a `finally`, and the hook passes every command without them.

Checks: `leaf-dev journey run claude-code` passed all 17 steps. In `boundary` the hook held the agent's answer for 3.8 s while the line fork handed `boundary` over, and the PostToolBatch after the answer carried it. `dev/tests/model/test_journey.py` and pre-commit pass.
leaf-agent
leaf-agent previously approved these changes Nov 20, 2026
…oard

The release triage board holds defects in four columns, none of them for a
release, so "Record that on the board" asked for something the board has no
place for. Agents put it in a status tile beside the board in 73 of the 74 runs
recorded on this machine before 19 Nov's evening, but two sandboxed runs of this
branch in a row asked where it belonged instead, which the `release` step counts
as a failure. Where the page records it stays the agent's call.
@max-sixty max-sixty changed the title Hand the journey's boundary comment over after the wake's answer, so Escape leaves no comment half done Hand the journey's boundary comment over after the wake's answer, and ask for the release on the page Nov 20, 2026
max-sixty added a commit that referenced this pull request Nov 20, 2026
After a compaction, each fork's diagnostic `request` named the main
thread's request from before it, its rows and message count, while
`$.model.fork` resent the compacted conversation, so a replay cut at
those rows reproduced a context the fork never read. The hooks module
learned rows only from `session.append` on doors that leave out the
compaction's, and no `turn.step` follows a compaction between turns.

The module now reads rows from Claude Code (`$.session.messages`,
`after` the row read before) at each main-thread step and each fork, and
drops its six `session.append` handlers. Where a compaction or rewind
dropped that row, Claude Code denies the read, and the fork's `request`
holds the model, the effort and `rewritten: true`, with no rows; a
replay then cuts at the fork's time. A probe in Claude Code 2.1.329
matched each named row against the transcript before and after a
compaction.

For the reviewer:

- A hook on `session.compact` or on the `compaction` door would hear
each compaction, but 2.1.329's builtin `cc-plugin-sec-default` passes
both past a person's plugins on a machine with managed settings, and
Claude Code then tells the user the hook was skipped. That is read in
its source; this Mac has no managed settings to measure it on.
- Claude Code before 2.1.326 refuses these reads: the step's hook fails
in the debug log and forks carry no `request` there. The CI pin
(2.1.325) shows the two type errors as warnings until it moves past
2.1.326.
- `notes/fork-replies.md` no longer says `$.model.fork` has nothing to
fork after a compaction or an away summary, which held on 2.1.318; it
keeps the one unexplained case. It now also records how Claude Code
shows each kind of fork on screen, including that its agent list names a
spawned fork `fork`.

Max asked for the fix and the note. Tests: the module's process tests,
with a new one for a fork after a compaction that fails without the fix.
The claude-code journey passed its first 12 steps twice, each fork
naming the newest row stored before it, and both runs stopped at
`boundary`, from a race in that step this change doesn't touch: the
boundary comment was handed over between the agent's edit and its reply
to the first comment, and the turn Escape left woke asking whether to
finish both. #6556 removes the race.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit 208f8a0 into main Nov 20, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-ad21784d6d498d7ea branch November 20, 2026 03:42
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