Repository navigation
Conversation
This was referenced Nov 19, 2026
xeophon
marked this pull request as ready for review
November 19, 2026 01:13
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This change lets Claude replay matching ignore standalone blank text blocks without ignoring whitespace inside meaningful blocks. Its effects are confined to parsing metadata and trace matching, with regression coverage for both cases. You can add or adjust custom eligibility rules. Learn more. |
This branch has not been deployed
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.
Claude Code drops an independently blank Anthropic text block when replaying a tool turn. Preserve the original block boundaries so replay matching ignores just that block. A newline inside a nonblank block remains significant. The regression test exercises both inputs. The original live failure recorded only the branch count. The block behavior was reproduced with the real CLI and scripted responses.
Local unit suite on this commit reported 298 passed, 19 skipped. Full-stack CI
Layer 1 of 13. Targets
main. Stack indexNote
Drop only standalone blank text blocks in Claude replay matching
AssistantMessagein types.py, omitted from serialization when unset.parse_messagesandresponse_from_wirein anthropic.py now record character offsets between consecutive text blocks via a new_text_block_offsetshelper.drop_blank_text_blocksutility in replay.py splits assistant content at those offsets and removes each whitespace-only block, preserving whitespace inside nonblank blocks. It falls back to whole-messagedrop_blank_textwhen offsets are missing or non-monotonic.ClaudeCodeHarness.replay_viewin harness.py now uses this utility, matching Claude Code 2.1.327's replay filtering.text_block_offsetsfield, and replay normalization drops individual blank blocks instead of only fully blank messages.Macroscope summarized 14c169a.
Note
Low Risk
Replay normalization and graph-matching metadata only; no auth, persistence, or wire-format contract changes beyond optional internal offsets.
Overview
Fixes trace prefix matching when Claude Code replays Anthropic assistant turns that split text across multiple blocks and drop only whitespace-only blocks, while keeping newlines that sit inside non-blank blocks.
AssistantMessagenow carries optionaltext_block_offsetsso the Anthropic dialect can remember where native text blocks were joined intocontent.drop_blank_text_blocksuses those offsets to remove standalone blank segments (with a fallback to whole-messagedrop_blank_text), andClaudeCodeHarness.replay_viewswitches to that helper. A unit test covers the three-block vs single-block newline cases.Reviewed by Cursor Bugbot for commit 14c169a. Bugbot is set up for automated code reviews on this repo. Configure here.