Repository navigation
feat(server): correlate /v1 responses with request IDs - #1181
Open
Allegro-ma-non-troppo wants to merge 3 commits into
Open
Allegro-ma-non-troppo wants to merge 3 commits into
Allegro-ma-non-troppo wants to merge 3 commits into
Conversation
Generate one server-owned ID at the HTTP header boundary and join it to a content-safe response-start record. Preserve cancellation keys, stream bodies and existing origin policy. WP-53
This branch was successfully 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.
Why
A client that received a
/v1error had nothing it could give an operator to identify that particular attempt. Identical retries and concurrent requests were especially hard to distinguish.What changed
x-request-idwhen a parsed/v1response starts. This includes errors, preflights and the first headers of an SSE stream. Print one matchingflm.http_response id=… method=… route=… status=…line on stdout; it identifies the registered route orunmatchedwithout requiring prompt or body logging./apiresponses are unchanged.Benchmark: client and operator behavior
completion._request_idorexc.request_idto report the attemptstream.response.headersbefore iteration, orResponse.headersin the browserflm.http_response id=<returned ID>to find the method, route and HTTP statusTests run
http_guardanderror_modelpassed with zero compiler warnings. All four new HTTP regressions failed on main for missing IDs and passed with local, disabled and wildcard CORS. Across these runs and the existing error/connection suite: 58 passed, 0 failed, 8 configuration-specific skips (each exercised in another mode).qwen3:0.6bon NPU, raw HTTP returned 12 in-scope IDs for 12 complete matching stdout records. The real Python SDK read IDs on success, 404 and before the first SSE event. Queue-full retained its JSON 503 andRetry-After: 1; the pre-parse connection-cap 503 stayed untagged. Chrome read the ID with a permitted origin;--cors 0still blocked it.[DONE]. In paired raw captures, removing only the new headers left the stream preamble and complete chunked body byte-identical to main, both with and without an allowed Origin.Acceptance and limits
Scope follows the normalized
/v1path, not the JSON protocol. No inference, JSON/SSE payload, cancellation or retry-policy change. A client that receives no headers (including a connection refused before the target is parsed) has no server ID to report; supporting that would require a separate client-correlation design. Local validation was on Windows, not Linux/macOS or multiple devices. The post-header fault was injected in a handler, not induced on physical hardware.