Repository navigation
fix(claude,codex): stop the sweep from skipping transcripts - #25
Merged
Merged
Conversation
… 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>
This was referenced Oct 30, 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.
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:swept.new. A run could publish a later run's stamp, so a session written between their two stamps was converted by neither.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 addandfunes updateboth runsetup 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