Repository navigation
Count prepared API prompts before GGUF admission - #15294
Conversation
|
The guard counts the route call sites that reserve through the async (off the loop) form. This PR moves four of them behind the new
|
…ct tests [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
Codex Review SummaryThis 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: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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". |
The lifted _anthropic_recost now builds its counted body through the route's _anthropic_admission_body (main #15294), so the test supplies that builder. Main's frontend changes put the merged build at 2,051.7 KB transfer, 0.2 KB over; the transfer limit is set to the measured build plus about 1.2 KB.
Main #15294 counts the prepared request body before admission, and the passthroughs now reserve through _reserve_counted_gguf_passthrough: - the passthrough reservation tests give their fake backend the reasoning kwargs the body builder reads; - the passthrough Stop test mocks the reservation the route now enters; - the Anthropic finalized-prompt test counts with a counter that sees the messages, and expects the counted prompt's margin rather than the estimate's.
…n logout redirect aborts it (#15398) ## Problem `Chat UI Tests (extra)` fails intermittently in `tests/studio/playwright_multi_account.py`, always at the same step: the `/login` navigation right after the test logs the owner out. ``` File "tests/studio/playwright_multi_account.py", line 119, in run page.goto(f"{BASE_URL}/login") playwright._impl._errors.Error: Page.goto: net::ERR_ABORTED at http://127.0.0.1:18894/login ``` Seen on #15294 (job 121303172631) and #15369 (job 121656269753). Neither PR touches auth, and other runs of the same job pass. ## Why `log_out()` revokes the token and clears it from `localStorage` while the chat page is still open. The page's pending and polling requests then get 401, and `redirectToAuth` in `features/auth/api.ts` sends the page to `/login` itself, at the same moment the test starts its own `/login` navigation. Whichever navigation loses is aborted, so the test fails with `ERR_ABORTED` even though the page ends up on `/login`. A small local reproduction with independent timings did not hit the race, so I am not claiming the exact interleaving. The failing line and the error match this path. The product is right to redirect a logged-out page to `/login`. What the test needs is to be on the login page; how it gets there doesn't matter. ## Fix A small `open_login(page)` helper is used for the two `/login` navigations that follow a log-out: the one at line 119 and the one inside `login()`. - On `ERR_ABORTED` only, it waits for the page to settle and navigates once more. - Any other error, or a second abort, still fails. The assertions that follow (the username field, the setup code login and the account isolation checks) are unchanged, so this cannot pass a page that did not reach the login screen. ## Verification Against a local page with Playwright's own `route.abort("aborted")`, which produces exactly `net::ERR_ABORTED`: | | result | |---|---| | plain `page.goto`, 1 abort | raises `net::ERR_ABORTED` (the CI failure) | | `open_login`, 1 abort | reaches `/login` | | `open_login`, 2 aborts | raises `net::ERR_ABORTED` | | `open_login`, no abort | reaches `/login` | The Playwright driver guards (`test_playwright_suites_run_in_ci.py`, `test_playwright_server_lifecycle.py`, `test_click_forced.py`, `test_playwright_brand_labels.py`): 94 passed. ruff format and check are clean.
…xt (#15457) `test_anthropic_admission.py::test_fifo_fairness_across_many_waiters` starts 8 requests against a 1-slot backend, sleeps 0.2 s and asserts all 8 are queued. Since #15294, admission first awaits prompt preparation, so on a loaded runner not every waiter has reached the queue after 0.2 s. It failed on the `(Python 3.13, a-f)` backend job with `assert 7 == 8` (`queued=7`). The same delay also means the arrival order no longer has to match the task order, which the FIFO assertion relies on. The test now starts each waiter and waits (up to 5 s) until it is queued before starting the next. The arrival order is then the task order, and the FIFO check is deterministic. Test-only change. Same test, pinned to one CPU core shared with 6 busy loops: | arm | result | |---|---| | main | 3 / 3 failed | | this PR | 3 / 3 passed | Without contention, the whole file passes 39 / 39 three times.
The OpenAI passthrough, Responses, and Anthropic paths can admit local GGUF requests using character-based estimates rather than the prompt llama-server will render. Numeric text and tool schemas can therefore overcommit the shared KV pool.
Count prepared messages with their tools and rendering options before admission, and reuse the prepared OpenAI body for dispatch. Anthropic counts use resolved native thinking settings and the same normalized forced-tool/schema options as generation, including tool-loop recosting. Prepared top-level images receive one media allowance rather than two. Failed counts continue to reserve the pool conservatively.
Related: #10671. This addresses request accounting; the native speculative sub-batch failure is handled separately in llama.cpp.
Validation:
These fresh API checks use controlled token-count/HTTP backends, not the reporter's original 27B/GPU workload.