Remove early return in get_llm_provider_logic.py that prevented
the 'openrouter/' prefix from being stripped. The early return was
intended for 'native OpenRouter models' like 'openrouter/free',
but no such models exist in the model registry — all OpenRouter
models are multi-segment (e.g. 'openrouter/anthropic/claude-3.5-sonnet')
and need the prefix stripped before being sent to the OpenRouter API.
This regression was introduced in v1.82.3 and caused 400 Bad Request
errors for all OpenRouter models.
The special name check (all_team_servers, all_proxy_servers) was an elif
after the server_id-is-not-None check, making it unreachable since special
names are non-None strings. Split into separate if blocks so the special
name guard runs before the duplicate-ID check.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The team MCP manager feature was reverted in PR #24255, so the test
needs to go back to the original single auth failure test that expects
a 403 for non-admin users.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test_create_mcp_server_auth_failure test expected a 403 for non-admin
users, but the team MCP manager feature changed the auth flow to first
check for team_id (400) before checking permissions. Split into two tests:
one for missing team_id (400) and one for non-manager rejection (403).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes CI failure in test_api_docs.py which validates that all Pydantic
model fields are documented in endpoint docstrings.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add pytest.importorskip("mcp") at module level so tests skip cleanly
in CI environments without the mcp package (instead of ImportError)
- Import LiteLLM_TeamTableCachedObj into MCP_AVAILABLE block so type
annotations resolve for static analysis and get_type_hints()
- Remove string quotes from type annotations now that the import exists
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Addresses Greptile feedback about missing integration tests for PUT/DELETE
when invoked by mcp_server_manager role. Adds tests for edit success/403,
delete success with team cleanup/403, and the _remove_mcp_server_from_team
helper directly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace raw prisma_client.db.litellm_teamtable.update with
handle_update_object_permission from team_endpoints (follows
established helper-function pattern)
- Extract _auto_assign_mcp_server_to_team and
_remove_mcp_server_from_team helpers for reuse and testability
- Update tests to mock at the correct boundaries
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AntD v5 static message API doesn't render without an App wrapper or
useMessage() context holder. Mirrors the existing notification pattern
by adding message.useMessage() to AntdGlobalProvider and routing all
calls through a new MessageManager module.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove dead get_team_object mock in test (now reuses team_obj from _assert)
- Add test for existing_permission_id=None branch (team linkage)
- Remaining P1s are by-design per spec (admin blocked from MCP, team_id
ignored for proxy admin)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- P0: Separate try/except for auto-assign so server creation succeeds
even if team permission update fails
- P1: Clean up team permission entry on MCP server delete
- P1: Add MCP_AVAILABLE skip guard to tests
- P2: Return team_obj from _assert_can_manage_team_mcp_server to
eliminate redundant get_team_object call in create endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cached team objects may have stale object_permission data. Bypassing
cache ensures the server-in-team check uses fresh data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a team has no object_permission_id yet, the auto-assign logic creates
an ObjectPermissionTable row but never linked it to the team. Now updates
the team's object_permission_id after creation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
team_id is a request-level field, not a DB column. Excluding it prevents
Prisma from rejecting the create call.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a control plane capability that enables a central admin instance
to manage multiple regional worker proxies from a single UI.
Backend:
- Worker registry loaded from YAML config (worker_id, name, url)
- /.well-known/litellm-ui-config exposes is_control_plane and workers list
- /v3/login + /v3/login/exchange: opaque code exchange for cross-origin
username/password auth (JWT never in URL/logs, single-use 60s TTL)
- SSO cookie handoff with return_to → opaque code → exchange
- _validate_return_to: full origin validation (scheme+hostname+port)
- Startup warning when control_plane_url set without Redis
- Both /v3 endpoints gated behind control_plane_url config
Frontend:
- Worker selector dropdown on login page (gated behind is_control_plane)
- Cross-origin SSO code exchange handling on callback
- switchToWorkerUrl: localStorage-persisted worker URL for API calls
- useWorker hook: shared worker state management
- WorkerDropdown in navbar for switching workers
- Logout/switch clears worker state from localStorage
Tests:
- 7 tests for /v3/login + /v3/login/exchange
- 10 tests for _validate_return_to
- 2 tests for control plane discovery endpoint
Migrate the OldTeams table from Tremor to Ant Design components, matching the
Access Groups page pattern. Switch from /team/list to /v2/team/list for
server-side pagination, filtering, and sorting.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- clearChatHistory: use functional setChatHistory updater so blob URL
revocation operates on the latest snapshot, not a stale closure capture.
- Simplified mode: skip sessionStorage hydration and persistence for
messageTraceId, responsesSessionId, and useApiSessionManagement so
embedded widgets don't cross-contaminate the full playground session.
- Debounce race: skip re-writing empty chatHistory to sessionStorage
after clearChatHistory already removed the key.
- Added 5 new tests covering these fixes (39 total).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Removes 17 console.log statements that fired on every streaming chunk
in updateTextUI, updateTimingData, updateUsageData, and other hot-path
functions. The console.error for sessionStorage parse failures is kept.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>