Support both legacy (⏺) and current (●) assistant markers#4
Open
sahrizvi wants to merge 1 commit into
Open
Conversation
claude 2.1+ renders the leading bullet on assistant messages as
U+25CF ("●"); earlier builds used U+23FA ("⏺"). The wrapper's
extract_assistant_snapshot was hardcoded to the legacy marker
only, so against current claude CLI it never found one and
classify_failure flagged the run as assistant_output_timeout
even though the TUI had produced a perfectly valid response.
Extend the snapshot extractor to accept either marker and keep
the most recent one when both appear in the transcript (the
right-most marker is always the latest assistant turn).
Tests cover the legacy-only, current-only, mixed (both orders),
and no-marker cases.
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.
Fixes #3.
Why
claude2.1+ renders the leading bullet on assistant messages asU+25CF(●).extract_assistant_snapshotwas hardcoded to findU+23FA(⏺) only, so against current claude the wrapper neverextracts the response. Every run hits the
assistant_output_timeoutclassification branch even when the TUI produced a perfectly valid
answer.
See issue #3 for the raw-log evidence (zero
⏺, two●, intendedresponse text present).
What changed
ASSISTANT_MARKERStuple ((⏺, ●)).extract_assistant_snapshotnow picks the right-most markeracross both variants — preserving the existing semantic ("latest
assistant turn wins") while becoming forward + backward
compatible.
ASSISTANT_MARKERSwhich variant appears later (both orderings)
""Test
Original 10 tests + 5 new tests all green.
Why not just replace ⏺ with ●
A blanket replacement breaks the wrapper for anyone still pinned to
a pre-2.1 claude CLI. Supporting both markers keeps the wrapper
working across the version boundary and protects against future
glyph rotations.