Skip to content

fix(cli): pin pi compat flags so lite pi stops sending store to Anthropic models - #40739

Open
devin-ai-integration[bot] wants to merge 3 commits into
litellm_internal_stagingfrom
litellm_lite_pi_compat_store
Open

fix(cli): pin pi compat flags so lite pi stops sending store to Anthropic models#40739
devin-ai-integration[bot] wants to merge 3 commits into
litellm_internal_stagingfrom
litellm_lite_pi_compat_store

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • lite pi fails on every Anthropic model with anthropic does not support parameters: ['store']
  • pi guesses compat from the base URL and sends store: false to the gateway
  • With long cache retention it also sends prompt_cache_key / prompt_cache_retention

How it solves it:

  • The provider entry lite pi writes now pins compat: {supportsStore: false, supportsLongCacheRetention: false}
  • One gateway URL fronts models with different capabilities, so URL sniffing cannot be right

User Flow

Before: a developer launches lite pi, picks an Anthropic model, and every prompt fails

  1. They run lite pi against http://localhost:4000 and pi opens pinned to anthropic-haiku-4-5
  2. They type Reply with the single word pong and press Enter
  3. pi sends POST http://localhost:4000/v1/chat/completions with "store": false in the body
  4. The TUI shows Error: 400: litellm.UnsupportedParamsError: anthropic does not support parameters: ['store'], for model=claude-haiku-4-5

After: the same session answers

  1. They run lite pi against http://localhost:4000 and pi opens pinned to anthropic-haiku-4-5
  2. They type Reply with the single word pong and press Enter
  3. pi sends POST http://localhost:4000/v1/chat/completions without store or the prompt cache fields
  4. The TUI shows pong

Relevant 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

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. 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
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to 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 ran litellm/proxy/dev_config.yaml with the drop_params: True line removed, since the customer runs with the default (drop_params off) and that setting hides the bug

cp litellm/proxy/dev_config.yaml /tmp/pi_repro_config.yaml
sed -i '/drop_params: True/d' /tmp/pi_repro_config.yaml
uv run litellm --config /tmp/pi_repro_config.yaml --detailed_debug --port 4000
export LITELLM_PROXY_API_KEY=sk-1234

Before (67cb34c)

  1. PI_CODING_AGENT_DIR=/tmp/pi-before uv run lite --base-url http://localhost:4000 --api-key sk-1234 pi, then type Reply with the single word pong and press Enter
  2. TUI pane:
 Reply with the single word pong
 Error: 400: {"message":"litellm.UnsupportedParamsError: anthropic does not
 support parameters: ['store'], for model=claude-haiku-4-5. To drop these, set
 `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params:
 true`\n. \n If you want to use these params dynamically send
 allowed_openai_params=['store'] in your request.. Received Model
 Group=anthropic-haiku-4-5\nAvailable Model Group
 Fallbacks=None","type":"invalid_request_error","param":null,"code":"400"}
                                                   (litellm) anthropic-haiku-4-5
  1. Proxy log for that request shows the client body carried 'store': False

After (baa6446)

  1. PI_CODING_AGENT_DIR=/tmp/pi-after uv run lite --base-url http://localhost:4000 --api-key sk-1234 pi, then type Reply with the single word pong and press Enter
  2. TUI pane:
 Reply with the single word pong
 pong
↑2.1k ↓5 1.0%/200k (auto)                          (litellm) anthropic-haiku-4-5
  1. sed -n '/"supportsStore"/,+1p' /tmp/pi-after/models.json
        "supportsStore": false,
        "supportsLongCacheRetention": false

Type

🐛 Bug Fix

Caveats (if any)

Low

  • supportsLongCacheRetention: false also drops pi's 24h prompt_cache_retention for OpenAI models behind the proxy, which only Anthropic-incompatible params made necessary
  • Users on a released lite pi can add a second provider block with the compat flags until they upgrade

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

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 31fe5e4537 adds only lint suppression comments to the already-proven implementation, so the live QA at baa64463482ff874959d629c73ce78138f6fc657 remains behaviorally current


Note

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 pi now writes explicit pi provider compat flags so the coding agent stops sending OpenAI-only request fields through the LiteLLM proxy.

provider_block adds compat: { supportsStore: false, supportsLongCacheRetention: false } to the models.json provider entry, because pi infers capabilities from the base URL and a single gateway URL fronts heterogeneous models. That prevents chat completions from including store (which broke Anthropic models with UnsupportedParamsError) and related long-cache prompt fields.

The unit test for the provider block shape is updated to expect the new compat object.

Reviewed by Cursor Bugbot for commit 31fe5e4. Bugbot is set up for automated code reviews on this repo. Configure here.

  • baa64463482ff874959d629c73ce78138f6fc657 passes /live-pr-risk

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot requested a review from a team September 11, 2026 15:33
@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR pins pi compatibility flags for the LiteLLM gateway so unsupported store and long-cache parameters are not sent

  • Adds provider-level compatibility flags
  • Updates the provider block regression test
  • Strengthens the lint suppression reason added before this review

Confidence Score: 5/5

The 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

Important Files Changed

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

@codspeed-hq

codspeed-hq Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_lite_pi_compat_store (31fe5e4) with litellm_internal_staging (67cb34c)

Open in CodSpeed

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

Comment thread litellm/proxy/client/cli/commands/pi.py Outdated
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

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>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

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