Skip to content

fix: only warn about truncation when the stop reason is max_tokens - #102

Closed
vitali87 wants to merge 3 commits into
fix/openai-failed-statusfrom
fix/truncation-warning-scope
Closed

vitali87 wants to merge 3 commits into
fix/openai-failed-statusfrom
fix/truncation-warning-scope

Conversation

@vitali87

Copy link
Copy Markdown
Owner

Summary

_call_anthropic logged the LLM_OUTPUT_TRUNCATED warning for every stop reason other than tool_use, including end_turn and stop_sequence, so a plain "no tool_use block" failure was misreported as truncation. This narrows the warning to stop_reason == "max_tokens" and emits a debug-level LLM_UNEXPECTED_STOP line for the other stop reasons.

Stacked on #100 (fix/openai-failed-status).

Test plan

  • new test_client.py case: end_turn with no tool block raises the "no tool_use block" error and does not log the truncation warning (fails on base, passes here)
  • 451 tests pass, ruff clean
  • Local review: 5/5

Every non-tool_use stop reason was logged as 'LLM output truncated',
mislabelling end_turn/stop_sequence responses that carried a complete
tool block.
@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 72f41bb0-bcec-4e62-81ba-3a2cdec48e75

📥 Commits

Reviewing files that changed from the base of the PR and between f4524d6 and 2d04179.

📒 Files selected for processing (3)
  • pr_split/logs.py
  • pr_split/planner/client.py
  • tests/test_client.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015rnEEjXWDBdePRhKMmZr1w
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015rnEEjXWDBdePRhKMmZr1w

# Conflicts:
#	tests/test_client.py

Copy link
Copy Markdown
Owner Author

This change is already in main: it landed via the merge train #243, which includes this PR's head commit. GitHub can't mark a stacked PR merged when it lands that way, so I'm closing it as done.


Generated by Claude Code

@vitali87 vitali87 closed this Sep 27, 2026
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