Skip to content

fix(claude,codex): stop the sweep from skipping transcripts - #25

Merged
dacorvo merged 3 commits into
mainfrom
fix/sweep-mark
Oct 29, 2026
Merged

dacorvo merged 3 commits into
mainfrom
fix/sweep-mark

Conversation

@dacorvo

@dacorvo dacorvo commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

The hook's sweep converts every transcript changed since its mark (swept). Three bugs could move the mark past a transcript whose latest content was never converted, and no later sweep picked it up:

  • The mark was stamped only after the hook converted the transcript its payload names. What the agent wrote meanwhile ended up older than the mark. On one Claude Code history, 32 sub-agent transcripts lost their last turns this way, among them 15 reports a sub-agent handed back to its caller.
  • Runs side by side shared one swept.new. A run could publish a later run's stamp, so a session written between their two stamps was converted by neither.
  • A failed conversion still advanced the mark.

One commit per bug. Each fixes both the claude and codex hooks and adds a test that fails without it. The tests wrap the installed converter so it can fail, hold, or append a late turn for a chosen transcript.

Existing gaps need no migration. funes add and funes update both run setup add, and its seed compares every transcript's last turn with the memory and converts the ones that differ.

Context: #24, where the seed could rely on this mark instead of checking every transcript.

🤖 Generated with Claude Code

dacorvo and others added 3 commits October 29, 2026 17:30
… session

The worker converted the transcript its payload named, and only then
did the sweep stamp its next mark. What the agent wrote in between,
such as a sub-agent's last turns written after its SubagentStop fired,
was older than that mark, so no later sweep converted it.

On one Claude Code history, 32 sub-agent transcripts lost their last
turns to this race, among them 15 reports a sub-agent handed back to
its caller.

The worker now stamps the next mark before it converts anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runs side by side shared one `swept.new`. A run could publish a later
run's stamp before that run had swept, so a session written between
their two stamps was converted by neither.

Each run now stamps `swept.<pid>`, and drops it on exit unless the
sweep published it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed conversion was logged, but the sweep still moved its mark past
the transcript, so no later sweep tried it again.

`convert_one` now fails when the converter does, and a failed
conversion drops the run's stamp. The mark stays where it was, and the
next sweep retries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dacorvo
dacorvo merged commit 468abfa into main Oct 29, 2026
5 checks passed
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.

1 participant