Repository navigation
fix(auto-router): omit Claude Code system text from classifier - #40655
Conversation
|
@greptileai can you reply here with a score and why that score? |
|
bugbot run |
|
Score: 4/5 I found no blocking correctness issue. The change is narrowly scoped to classifier input: The tests provide good coverage for metadata placement, encrypted tasks, first-turn requests with context disabled, generic-client behavior, and near-match user agents. The existing Buildkite status is also successful. I’m giving 4 rather than 5 because the behavior intentionally removes task constraints that exist only in Claude Code system text, and the browser routing preview cannot reproduce the client-identity path. Both limitations are documented in |
Greptile SummaryThis PR removes caller system text from LLM-classifier input when request metadata identifies Claude Code, while preserving conversation context and the routed request
Confidence Score: 4/5The PR should not merge until Claude Code system-context omission is configurable and the provider-specific branch is moved behind the provider boundary Recognized Claude Code requests always lose system-only classification constraints, which can select an incapable tier and changes existing behavior without an operator-controlled compatibility path Files Needing Attention: litellm/router_strategy/complexity_router/complexity_router.py
|
| Filename | Overview |
|---|---|
| litellm/router_strategy/complexity_router/complexity_router.py | Adds unconditional Claude Code system-context omission and introduces provider-specific branching in the generic router strategy |
| litellm/router_strategy/complexity_router/config.py | Updates classifier-context descriptions to document the new exception but exposes no compatibility override |
| tests/test_litellm/router_strategy/test_complexity_router.py | Adds focused mocked regression coverage for recognized and generic clients without weakening existing tests |
| litellm/router_strategy/complexity_router/README.md | Accurately documents classifier-only omission, preserved routed system text, and the system-only constraint caveat |
Reviews (1): Last reviewed commit: "fix(auto-router): omit Claude Code syste..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Code <noreply@anthropic.com>
81f7890 to
63ef777
Compare
|
@greptileai both findings are withdrawn; final SHA adds precise system and trajectory assertions. Can you reply here with a score and why that score? |
|
bugbot run |
|
Score: 5/5. The final SHA addresses the withdrawn findings with precise regression coverage: recognized |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 63ef777. Configure here.
…nged in #40655 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…tion and emit tool output tokens (#40666) * fix(datadog_llm_obs): keep tool call and result structure under redaction and emit tool output tokens Under datadog_llm_observability_params.turn_off_message_logging the span kept only one role plus "redacted-by-litellm" per message, so Datadog showed Tool Call 0, Tool Result 0 and no tool output token data. The shared CustomLogger hook collapsed the messages before the callback ran, and the Datadog redaction then dropped tool_calls and tool_results. The Datadog callback now opts out of the shared message collapse (redacts_messages_itself) and redacts its own normalized messages, keeping roles, tool names, ids and types while replacing content, arguments and results. Tool result tokens are counted with litellm.token_counter before redaction and shipped as the tool_output_tokens metric. Other callbacks keep the inherited behavior. Resolves LIT-7545 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(datadog_llm_obs): drop explanatory docstrings from the redaction change Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * chore(ui): regenerate schema.d.ts for the classifier descriptions changed in #40655 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: yucheng <yucheng@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a developer sends a small Claude Code task, but harness instructions dominate the classifier input
POST http://127.0.0.1:4488/v1/messagesthrough Claude Code 2.1.268 with modelclaude-opus-5After: the same Claude Code task is classified from task-bearing conversation text
POST http://127.0.0.1:4488/v1/messagesthrough Claude Code 2.1.268Relevant issues
Linear ticket
Resolves LIT-7491
Pre-Submission checklist
Screenshots / Proof of Fix
Same commands in fresh HOME directories against each revision:
Shared setup: a Postgres-backed proxy used a real Haiku 4.5 classifier and real Claude tier models through the sandbox gateway. Claude Code 2.1.268 ran a three-turn session with one delegated subagent. A capture proxy recorded the classifier and routed-model requests without modifying them
Before (
8a4fae0e17)claude -p 'Explain binary search in one sentence.' --output-format json, then continue twice; the third turn delegates the same task to an explainer subagent# Environment,Available agent types, the skill catalog, and<total_tokens><total_tokens>system reminder but retains the prior user turnAfter (
63ef777454)Conversation so fartrajectory200; Claude Code controls omit extracted system text, while generic-client controls retain it. Native Anthropic top-levelsystemstays outside classifier input on both revisionsType
Bug fix, regression tests, and documentation
Caveats
Severe
Medium
Verification
make checkand all four delta gates passed locallyFinal Attestation
🤖 Generated with Claude Code