Skip to content

Support both legacy (⏺) and current (●) assistant markers#4

Open
sahrizvi wants to merge 1 commit into
Equality-Machine:mainfrom
sahrizvi:fix/assistant-marker-claude-2.1
Open

Support both legacy (⏺) and current (●) assistant markers#4
sahrizvi wants to merge 1 commit into
Equality-Machine:mainfrom
sahrizvi:fix/assistant-marker-claude-2.1

Conversation

@sahrizvi
Copy link
Copy Markdown

Fixes #3.

Why

claude 2.1+ renders the leading bullet on assistant messages as
U+25CF (). extract_assistant_snapshot was hardcoded to find
U+23FA () only, so against current claude the wrapper never
extracts the response. Every run hits the assistant_output_timeout
classification branch even when the TUI produced a perfectly valid
answer.

See issue #3 for the raw-log evidence (zero , two , intended
response text present).

What changed

  • New module-level ASSISTANT_MARKERS tuple ((⏺, ●)).
  • extract_assistant_snapshot now picks the right-most marker
    across both variants — preserving the existing semantic ("latest
    assistant turn wins") while becoming forward + backward
    compatible.
  • Five new tests:
    • both markers present in ASSISTANT_MARKERS
    • legacy-only transcript extracts correctly
    • current-only transcript extracts correctly
    • mixed transcripts use the right-most marker regardless of
      which variant appears later (both orderings)
    • no-marker transcripts still return ""

Test

uv run pytest tests/ -v
...
15 passed in 0.04s

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.

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.
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.

stream-json / text modes return assistant_output_timeout against claude 2.1+ (marker character changed)

1 participant