Repository navigation
fix(chat): return gateway request-history IDs - #7261
Conversation
Return the existing gateway request ID on Chat replies owned by a handler or logged admission refusal, preserving unlogged rejection behavior. Co-authored-by: daemons2000 <1758467+daemons2000@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
✅ Deterministic PR hygiene checks passed. |
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. |
|
Maintainer integration into Exact head |
Summary
Chat Completions records gateway usage history but omitted the ID needed to join a reply to its exact row. Return
x-opencodex-request-idthrough the existing Responses helper when the Chat handler or a logged pre-handler refusal owns that row, including JSON/SSE replies and handler errors. Auth, origin, drain and active-turn refusals without a log owner keep no receipt header. Caller/upstream IDs cannot override the gateway ID; CORS exposes it without changing the response body.Adds real-listener regressions for both listener policies, concurrent calls, usage correlation, cancellation and logged/unlogged refusals. Documents the header contract. Reuses the reporter's proposed fix with attribution.
Closes #7257
Verification
bun install— passed.Regression before fix: 3 passed / 9 failed (the nine expected Chat header cases failed on absent IDs).
bun test tests/responses/chat-request-id-endpoint.test.ts— 13 passed / 0 failed.Pinned Bun 1.4.3:
bun test --isolate tests/responses/chat-request-id-endpoint.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/claude-integration/messages-request-id-endpoint.test.ts tests/claude-integration/messages-request-id-headers.test.ts— 71 passed / 0 failed. Initial Bun 1.4.0 invocation failed the tooling test's required-runner check; rerunning under the repository pin passed.bun run typecheck— passed, including after the source-oracle update.bun run structure:check— passed.bun test tests/ci-workflows/file-size-ratchet.test.tsunder pinned Bun — 9 passed / 0 failed.Pinned Bun:
bun test --isolate tests/server/loopback-listener-admission.test.ts tests/responses/chat-request-id-endpoint.test.ts— 44 passed / 0 failed. The first CI head exposed an indentation-specific source-oracle assertion; it now matches the Chat handler’s actual CORS arguments and bounds its scan to the Chat route.bun run privacy:scan— passed.Docs:
bun install --frozen-lockfileandbun run build— passed; 577 pages and 81,420 internal links checked.bun run test:changed— passed: 3,419 passed / 30 skipped / 0 failed across 159 files, exit 0. Acquired the shared runner after a 930-second queue wait; suite execution took 64.8 seconds.Full local suite not run: concurrent release-train worktrees contend for the shared test runner; focused regressions cover the changed HTTP boundary and unchanged sibling header contracts. Broader Ubuntu validation is left to PR CI.
Hosted PR CI on head
8fddf05b77b4f238465eb20928f63e5f95528f11: run 38992364720 succeeded, including all four Ubuntu test shards and aggregateci. Checkout used merge commit48715ecb4ecd14fad06b391b16fbc5769b3f10d7againstdevatf190fc40906323a93a16729209d00414f8b602fe. macOS/Windows jobs were skipped under the repository PR policy. Initial run 38991666022 failed on the CORS source-oracle assertion described above; the corrected head passed its replacement run.Checklist
Co-authored-by: daemons2000 1758467+daemons2000@users.noreply.github.com