Skip to content

fix(query): keep tool turns active until final stop#10

Merged
BunsDev merged 2 commits into
mainfrom
fix/session-turn-complete-tools
May 31, 2026
Merged

fix(query): keep tool turns active until final stop#10
BunsDev merged 2 commits into
mainfrom
fix/session-turn-complete-tools

Conversation

@BunsDev
Copy link
Copy Markdown
Member

@BunsDev BunsDev commented May 30, 2026

Summary

Two focused changes:

  • 2add182 fix(query): keep tool turns active until final stop — extracts should_emit_turn_complete(stop, max_tokens_recovery_count) so QueryEvent::TurnComplete no longer fires on intermediate tool_use turns or on max_tokens while we're still inside the recovery window. Adds 3 unit tests covering the predicate.
  • eb05e68 feat(tui): color-coded diffs in Claude Code style — diff viewer renders full-row red/green tints for removed/added lines (gutter + marker + content), brighter saturated bg on inline word-level changes, soft brand-consistent fg colors, and a single-line slate hunk header that no longer doubles the @@ prefix.

Net diff: 2 files, +186/−49.

Test plan

  • cargo test -p claurst-tui — diff viewer unit + integration tests green locally
  • should_emit_turn_complete unit tests cover tool_use, max_tokens (under + at recovery limit), and terminal stop reasons
  • Open /changes in the TUI on a branch with mixed adds/removes and confirm:
    • removed lines show a dim red row tint across the full panel width
    • added lines show a dim green row tint
    • adjacent removed→added pairs show brighter word-level highlights on the changed words
    • hunk headers render once as @@ -X,Y +A,B @@ on a full-width slate band
    • context lines stay neutral; scrollbar still clips cleanly
  • Verify the 2add182 query/turn fix against the original session-turn-complete repro

🤖 Generated with Claude Code

BunsDev and others added 2 commits May 29, 2026 20:48
Full-row red/green tint for removed/added lines (gutter, marker, and
content), brighter saturated bg on inline word-level changes, soft
brand-consistent fg colors, and a single-line slate hunk header that no
longer doubles the @@ prefix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 30, 2026 21:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@BunsDev BunsDev merged commit 26a98c5 into main May 31, 2026
1 check failed
@BunsDev BunsDev deleted the fix/session-turn-complete-tools branch May 31, 2026 02:47
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.

2 participants