fix(cli): pin pi compat flags so lite pi stops sending store to Anthropic models - #40739
fix(cli): pin pi compat flags so lite pi stops sending store to Anthropic models#40739devin-ai-integration[bot] wants to merge 3 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryThis PR pins pi compatibility flags for the LiteLLM gateway so unsupported store and long-cache parameters are not sent
Confidence Score: 5/5The PR appears safe to merge, with the previous suppression-comment concern resolved The latest change replaces the weak suppression reason with a specific explanation, and no new correctness or repository-rule issues remain
|
| Filename | Overview |
|---|---|
| litellm/proxy/client/cli/commands/pi.py | Adds explicit pi compatibility flags and provides a sufficient reason for the required mutable nested JSON object |
| tests/test_litellm/proxy/client/cli/test_pi.py | Extends the provider block assertion to cover both compatibility flags |
Reviews (3): Last reviewed commit: "fix(cli): clarify pi compatibility suppr..." | Re-trigger Greptile
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
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 31fe5e4. Configure here.
TLDR
Problem this solves:
lite pifails on every Anthropic model withanthropic does not support parameters: ['store']store: falseto the gatewayprompt_cache_key/prompt_cache_retentionHow it solves it:
lite piwrites now pinscompat: {supportsStore: false, supportsLongCacheRetention: false}User Flow
Before: a developer launches
lite pi, picks an Anthropic model, and every prompt failslite piagainsthttp://localhost:4000and pi opens pinned toanthropic-haiku-4-5Reply with the single word pongand press Enter"store": falsein the bodyError: 400: litellm.UnsupportedParamsError: anthropic does not support parameters: ['store'], for model=claude-haiku-4-5After: the same session answers
lite piagainsthttp://localhost:4000and pi opens pinned toanthropic-haiku-4-5Reply with the single word pongand press Enterstoreor the prompt cache fieldspongRelevant issues
Reported by a customer in Pylon #8198
Linear ticket
Resolves LIT-7576
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Shared setup. Real pi 0.85.1 (
@earendil-works/pi-coding-agent) driven interactively in tmux, real Anthropic calls. The proxy ranlitellm/proxy/dev_config.yamlwith thedrop_params: Trueline removed, since the customer runs with the default (drop_paramsoff) and that setting hides the bugBefore (67cb34c)
PI_CODING_AGENT_DIR=/tmp/pi-before uv run lite --base-url http://localhost:4000 --api-key sk-1234 pi, then typeReply with the single word pongand press Enter'store': FalseAfter (baa6446)
PI_CODING_AGENT_DIR=/tmp/pi-after uv run lite --base-url http://localhost:4000 --api-key sk-1234 pi, then typeReply with the single word pongand press Entersed -n '/"supportsStore"/,+1p' /tmp/pi-after/models.jsonType
🐛 Bug Fix
Caveats (if any)
Low
supportsLongCacheRetention: falsealso drops pi's 24hprompt_cache_retentionfor OpenAI models behind the proxy, which only Anthropic-incompatible params made necessarylite pican add a second provider block with the compat flags until they upgradeFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/17a4cab15fca4978ab3ae1bb5d05e582
Open in Devin Desktop: https://app.devin.ai/desktop/session/17a4cab15fca4978ab3ae1bb5d05e582?variant=devin
The current tip
31fe5e4537adds only lint suppression comments to the already-proven implementation, so the live QA atbaa64463482ff874959d629c73ce78138f6fc657remains behaviorally currentNote
Low Risk
CLI-only change to generated pi
models.json; main caveat is OpenAI models behind the proxy no longer get pi’s long-cache retention hints until compat is tuned per provider.Overview
lite pinow writes explicit pi provider compat flags so the coding agent stops sending OpenAI-only request fields through the LiteLLM proxy.provider_blockaddscompat: { supportsStore: false, supportsLongCacheRetention: false }to themodels.jsonprovider entry, because pi infers capabilities from the base URL and a single gateway URL fronts heterogeneous models. That prevents chat completions from includingstore(which broke Anthropic models withUnsupportedParamsError) and related long-cache prompt fields.The unit test for the provider block shape is updated to expect the new
compatobject.Reviewed by Cursor Bugbot for commit 31fe5e4. Bugbot is set up for automated code reviews on this repo. Configure here.
baa64463482ff874959d629c73ce78138f6fc657passes /live-pr-risk