Repository navigation
Studio: keep the base URL query string on connection requests - #16951
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…ain (#17040) ## Summary Two tests have been red on main since this morning's merges. Every PR based on main now inherits them: #17010, which changes only the Windows bash tool, fails both. Both reproduce on main locally: ``` (Python 3.13, a-f) studio/backend/tests/test_custom_provider_api_type.py::test_base_url_query_survives_native_provider_calls At index 0 diff: ('/v1/models/claude-sonnet-4-5', 'tenant=a') != ('/v1/messages', 'tenant=a') Repo tests (CPU, studio) tests/studio/test_model_picker_contracts.py::test_batch_sizes_reach_an_api_load_through_the_server_mirror assert 'strip_batch = "n_batch" in kwargs,' in '...openai_auto_switch_settings.py...' ``` In both cases the product change is correct and the test is out of date. - **#16951 and #16953.** #16951 (keep the base URL query string on provider calls) added a test that lists every request the three native providers make. #16953 merged four minutes later. It looks up the model's output cap with `GET /v1/models/<model>` before a Messages API stream that sets no `max_tokens`, so that provider now makes one more request. That request goes through `_append_provider_path`, so it keeps `?tenant=a`, which is the invariant #16951 cares about. The test simply predates it. Each PR was green on its own. - **#16927.** It moved the llama.cpp flag stripping into `strip_args_shadowed_by(args, fields)`, so the line now reads `strip_batch = "n_batch" in fields,` and is called with the same kwargs. What gets stripped is unchanged. The contract test grepped for the old source line. ## Change Tests only: - `test_base_url_query_survives_native_provider_calls` expects the output-cap lookup first, with its query string kept. It also empties `_anthropic_output_caps` first, so the lookup happens whatever ran earlier in the worker. That cache is module-global, and with an entry already cached the request list would change with test order. - `test_batch_sizes_reach_an_api_load_through_the_server_mirror` stops grepping that line. It calls the real `model_override_load_kwargs`, imported the same way as the lookup-ladder helper already in that file: - a stored `-b` is dropped when the override has `n_batch`; - a stored `-ub` is dropped when the override has `n_ubatch`; - both stay when neither field is set. ## Testing | | main | this branch | |---|---|---| | `test_custom_provider_api_type.py` + `test_anthropic_default_max_tokens.py` | 1 failed | 29 passed, in either file order | | `tests/studio/test_model_picker_contracts.py` | 1 failed | 203 passed | | the batch test with `strip_batch = False` planted in `strip_args_shadowed_by` | | fails |
A connection whose base URL carries a query string, such as an Azure OpenAI endpoint ending in
?api-version=preview, could be saved but did not work. Loading its models said there was no /models endpoint, the connection check failed with a 404, and every chat message came back as "Not found". The endpoint path was appended after the query string, so the server received/v1?api-version=preview/chat/completionsinstead of/v1/chat/completions?api-version=preview.Chat, the connection check, the model list and audio transcription now put the endpoint path before the query string, the same way Read Aloud, image generation and the Responses API already did. Base URLs without a query string send exactly the same requests as before.