Skip to content

fix(responses): preserve gateway citations during native compact - #7682

Merged
lidge-jun merged 12 commits into
lidge-jun:devfrom
luvs01:codex/fix-citation-rewrite-for-third-party-gateways
Oct 25, 2026
Merged

lidge-jun merged 12 commits into
lidge-jun:devfrom
luvs01:codex/fix-citation-rewrite-for-third-party-gateways

Conversation

@luvs01

@luvs01 luvs01 commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Native compact currently repairs URL citations before the final destination is known. This changes annotations owned by custom gateways and can apply the wrong policy if key admission refreshes the provider before sending.

  • Keep metadata stripping separate from citation repair. Preserve gateway citation titles, indices, and extension fields exactly.
  • Build each native compact request from the original input and repair citations only when its final destination is OpenAI-operated. Ordinary HTTP and WebSocket requests retain the same destination boundary.
  • Cover provider refresh in both directions, helper independence, gateway preservation, and input immutability; document the contract.

Verification

Candidate beec3e4342c077a595ddd94b93d45b7f2a2eb69a normally merges dev@0aeaf0cb6b0a7c2f117d8c75f8fa396cf2ea6e39 and shared #7627 (f011a94be1b468b7b785cb54976d4cb4a9b6a563). Runtime and testRunnerBun are both pinned to 1.4.4. The PR remains based on dev.

Current candidate validation: Official native Windows Bun 1.4.4, CI=true bun test --isolate --timeout 60000, fresh processes for the four focused citation/compact files: 40 passed / 0 failed / 0 skipped / 401 assertions. Reference TypeScript, official Structure and skill-surface checks, and all 23 changed-file privacy/size/diff checks passed. All eight units returned native exit 0 and complete child output; matching installed dependencies were reused without reinstalling.

The source refresh preserves the 12-file citation change and adds the shared 11-file Bun baseline. Runtime and regression-test blobs are preserved; Structure metadata also retains current dev's provider documentation. No GUI change.

Previously reported at 51e214ebbe8d347b17eb6c39b9f028e91f40f34a: official Bun 1.4.4 on Windows passed 40 tests / 0 failures / 401 assertions across compact key selection, native-item extensions for compact and ordinary requests, and URL-citation repair. These used pure builders and injected fetch fixtures, with no live provider calls. Root TypeScript, Structure, changed-file privacy/size and diff checks also passed at that earlier head; they do not validate this refreshed candidate.

The full local suite was not run under the shared-worktree resource exception. Broader coverage and the updated hosted documentation build remain pending for the final head. Keep this PR draft until the required validation is complete.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Apply citation repair in the native compact send builder after queued provider refresh. Preserve original gateway annotations while retaining repair for official OpenAI API and ChatGPT sends.

Cover both destination transitions, exact annotation preservation, independent metadata stripping, and native positive controls. Document the destination boundary in the public adapter reference and structure contracts.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

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 24, 2026
@lidge-jun
lidge-jun marked this pull request as ready for review October 25, 2026 07:50
@lidge-jun

Copy link
Copy Markdown
Owner

Integration evidence (owner decision decision:b607a677, approved): independent gpt-6.1-sol review PASS at 2c15cdc; the current head efe32b5 only adds a merge of origin/dev (after #7666 touched the structure index). Exact-head PR CI run 40170366546 and exact-head ci.yml lane=all run 40170382657 both succeeded.

Static merge simulation on current dev a589dde (this Mac): dev=a589dde00e438d27c881d018fe926dfda3f81a33 base=6672cfb4a2b9a1dc72e26ed159c1d70368fe0ca7 pr_files= 12 overlap=[]; merge clean; install exit=0; gui install exit=0; tsc exit=0; tsc doctor exit=0; structure:check exit=0; privacy:scan exit=0; layout+ratchet guards exit=0 54 pass 0 fail ;

Merged by the triage manager as maintainer integration (MAINTAINERS.md, dev only) with green exact-head PR CI, an independent review PASS, and the owner's approval of this bundle.

@lidge-jun
lidge-jun merged commit 4049f40 into lidge-jun:dev Oct 25, 2026
64 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-25T07:52:24.749710Z
We couldn’t complete this review. Comment @codex review to try again.
efe32b5 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

2 participants