Repository navigation
fix(server): preserve non-UUID request IDs - #2459
Open
original4422 wants to merge 2 commits into
Open
original4422 wants to merge 2 commits into
original4422 wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1337. Reverse proxies can supply legal non-UUID request IDs, but the default UUID validation returned 400 before API handling. A small custom request-ID plugin keeps the existing context middleware, UUID generation and response propagation while accepting those opaque IDs. API-key authentication stays in place.
Evidence
After: all nine pass with the real 19 MB stories15M GGUF on CPU, including request context, generated IDs, concurrent isolation, authentication and streaming/non-streaming completions.
[DONE].LLAMA_CPP_TEST_MODEL=<local tiny GGUF> PYTEST_ADDOPTS="tests/test_server_request_id.py tests/test_llama_chat_format.py tests/test_llama_grammar.py tests/test_llama_speculative.py" make test: 15 passed, none skipped. The nine new tests are included in that count.make lint: Ruff checks and formatting pass on 30 files. The first formatting check identified two changed files; formatting was corrected and the checks rerun.Validation used macOS arm64, Python 3.12.14, starlette-context 0.3.6, FastAPI 0.165.0 and Starlette 1.10.0, with
n_gpu_layers=0. This is the selected four-suite run, not the complete model-downloading suite. No GPU or performance benchmarks were run. Tests needing a model explicitly skip whenLLAMA_CPP_TEST_MODELis absent.AI-assisted implementation, validation and review by the account owner's authorized proxy.
Merge Danger
Door: two-way.
Blast Radius: correlation.
Client request IDs are no longer constrained to UUID syntax. Legal header values are reflected as correlation metadata; the middleware and API authentication remain enabled.