Unify follow-up fixes for Opus 4.6 pricing and routing metadata into
a single changeset.
Set long-context-capable Opus 4.6 entries to 1M input tokens where
>200K pricing is defined, align alias and dated capability metadata,
and add Bedrock Converse v1 IDs with and without :0 suffixes.
Keep regional endpoint pricing at a 10% premium over global entries
and mirror all cost-map changes in the backup file used for local
loading and offline fallback behavior.
Extend Opus 4.6 regression tests to verify metadata parity, Bedrock
regional pricing parity across :0 and non-:0 IDs, and converse model
registration in constants and runtime model sets.
Add Claude Opus 4.6 entries for Anthropic, Bedrock Converse, and Vertex AI.
Align pricing and capability metadata with Anthropic docs, including
long-context rates, above-200k prompt-caching rates, prefill removal,
and tool-use system prompt token counts.
Register the Bedrock Converse model ID in constants and add targeted
tests to validate model map values and converse registration.
The daily spend tables store dates in UTC, but the UI sends dates in the
user's local timezone. This causes a mismatch where records from the
user's evening (stored as the next UTC day) don't appear when filtering
by "today".
Changes:
- Add `_adjust_dates_for_timezone()` helper to expand date range based
on timezone offset
- Add `timezone` query parameter to `/user/daily/activity` and
`/user/daily/activity/aggregated` endpoints
- Frontend sends `timezone` using `Date.getTimezoneOffset()`
For users west of UTC (e.g., PST), end_date is extended by 1 day.
For users east of UTC (e.g., IST), start_date is extended by 1 day earlier.
This ensures all records within the user's local date range are captured.
This PR:Fixes a frontend regression where the
PublicModelHub
page would crash with TypeError: e.filter is not a function when the API returned an error object (e.g. { "detail": "..." }) instead of the expected data array.
Changes:
Added defensive Array.isArray() checks in
src/components/public_model_hub.tsx
for:
modelHubData
agentHubData
mcpHubData
Updated useMemo hooks and helper functions to handle invalid data gracefully.
Added a regression test in
src/components/public_model_hub.test.tsx
that mocks a non-array API response to ensure the component renders without crashing.
The cast(Any, message) pattern was used to suppress typed-dict mutation
warnings, but the parameter has no type annotation so it's unnecessary.
Direct assignment works and eliminates the F401 unused-import lint error.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* _translate_openai_content_to_anthropic
* test_response_format_consistency
* test fixes unit tests
* test fix
* fix: use dict access for anthropic content blocks in tests (#20447)
The translate_openai_response_to_anthropic method returns dicts, not objects.
Changed .type/.text/.thinking attribute access to dict ['key'] access.
---------
Co-authored-by: shin-bot-litellm <shin-bot-litellm@berri.ai>
* fix(a2a): use text/event-stream SSE format for message/stream endpoint
The A2A gateway's streaming response was using application/x-ndjson
Content-Type and raw NDJSON body format. The A2A protocol spec requires
text/event-stream with SSE framing (data: ...\n\n).
The official a2a-sdk client validates the Content-Type header and raises
SSEError when it doesn't contain text/event-stream.
Changes:
- Changed media_type from application/x-ndjson to text/event-stream
- Updated response body to use SSE framing (data: prefix + \n\n suffix)
- Added tests validating Content-Type and SSE body format
Fixes#20278
* Potential fix for code scanning alert no. 4045: Information exposure through an exception
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* test(a2a): add manual SSE format validation script
Adds a manual test script that:
1. Starts a real A2A agent on port 10001
2. Starts LiteLLM proxy with the agent registered
3. Makes a streaming request to the proxy's A2A gateway
4. Validates Content-Type header is text/event-stream
5. Validates body uses SSE framing (data: ...\n\n)
Run: python tests/a2a_manual/test_a2a_sse_manual.py
---------
Co-authored-by: shin-bot-litellm <shin-bot-litellm@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>