Skip to content

fix(chat): persist Reserve helper refusal request IDs - #7511

Merged
lidge-jun merged 1 commit into
lidge-jun:devfrom
luvs01:codex/propose-fix-for-correlation-integrity-issue
Oct 22, 2026
Merged

lidge-jun merged 1 commit into
lidge-jun:devfrom
luvs01:codex/propose-fix-for-correlation-integrity-issue

Conversation

@luvs01

@luvs01 luvs01 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The Chat route exposes a request ID before handling the request, but a Reserve vision-helper refusal returned HTTP 400 without saving a corresponding history row. Persist the terminal refusal before returning it so the exposed request ID resolves to one durable Chat history entry.

The endpoint regression exercises an unauthenticated loopback Reserve helper request and checks the response ID against durable history. Refusal policy and routing behavior are unchanged.

Verification

  • Original chat-request-id-endpoint.test.ts execution, TypeScript, privacy scan, and file-size ratchet passed.
  • Hosted CI completed successfully for the exact submitted head 73b81f3dfc988014670d8a38f3789f0f35e9495b.
  • Independent review traced the resolved Reserve-helper branch and the durable terminal-log boundary; no additional blocking defect was found.
  • Exact-head hosted CI is checked separately. Native Windows/macOS and real-provider calls are not claimed as tested.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Existing request-history correlation semantics are restored; no configuration change is introduced.
  • Security-sensitive logging was reviewed; this uses the existing final-log path without adding request-body or credential logging.

Review readiness

  • Required validation passed with scope documented.
  • Branch is based on the current dev commit.
  • No correct Codex or CodeRabbit findings remain outstanding at submission.
  • Ready for review, subject to upstream exact-head CI and maintainer review.

Summary by CodeRabbit

  • Bug Fixes
    • Requests rejected by the Reserve vision helper now return a durable history ID when using the OpenAI Responses provider.
    • Rejected requests on the supported OpenAI route are now recorded in request history before the existing invalid-request response is returned.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 07554183-4e4f-444a-add0-c531cbdfa57c
📥 Commits

Reviewing files that changed from the base of the PR and between bf4eb12 and 73b81f3.

📒 Files selected for processing: 2
  • src/server/chat-completions.ts
  • tests/responses/chat-request-id-endpoint.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Walkthrough

When the Codex reserve-helper check rejects a settled canonical OpenAI forward route, the handler now records a 400 request log before returning the existing error response. A new endpoint test checks that an unauthenticated OpenAI Responses request receives a durable history ID.

Changes: Reserve-helper rejection

Layer / File(s) Summary
Rejection logging and endpoint test
src/server/chat-completions.ts, tests/responses/chat-request-id-endpoint.test.ts
The handler records a 400 request log on the reserve-helper rejection path. The test helper can omit authentication and use another model. A new test checks that an unauthenticated openai/gpt-reserve vision-helper request returns 400 with a durable history ID.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: lidge-jun

Merge Risk: ⚪ Minimal · up to 73b81

The Reserve-helper refusal now has a durable history entry under the request ID returned to the caller, and the added test checks that behavior. No actionable merge risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: persisting request IDs for Reserve helper refusals. This matches the Chat route update in src/server/chat-completions.ts and the regression t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title clearly and concisely describes the main change: persisting request IDs for Reserve helper refusals. This matches the Chat route update in src/server/chat-completions.ts and the regression test in tests/responses/chat-request-id-endpoint.test.ts.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 22, 2026
@luvs01
luvs01 marked this pull request as ready for review October 22, 2026 05:47

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 73b81f3dfc988014670d8a38f3789f0f35e9495b against dev. The Reserve-helper refusal is terminal before upstream dispatch, and using the existing final-log owner restores durable correlation for the already-exposed request ID. The endpoint test checks one persisted Chat history row with the response ID and 400 status; refusal/admission behavior is unchanged. No blocking issue found.

I independently inspected the full two-file diff and surrounding terminal-log/Reserve admission flow, and completed exact-head hosted CI (run 39729944381: gates and all four selected Ubuntu test shards succeeded). No additional local suite or provider request was run for this review; skipped native Windows/macOS jobs are not passing evidence.

@lidge-jun
lidge-jun merged commit 8d6e124 into lidge-jun:dev Oct 22, 2026
37 checks passed
@github-actions
github-actions Bot deleted the codex/propose-fix-for-correlation-integrity-issue branch November 5, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants