Skip to content

fix(compaction): preserve hosted search metadata as text - #6746

Closed
yuanyuanlove wants to merge 2 commits into
lidge-jun:devfrom
yuanyuanlove:bugfix-20261008-hosted-search-compaction
Closed

yuanyuanlove wants to merge 2 commits into
lidge-jun:devfrom
yuanyuanlove:bugfix-20261008-hosted-search-compaction

Conversation

@yuanyuanlove

@yuanyuanlove yuanyuanlove commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Portable compaction removes tool declarations before asking another model for a summary. Replaying hosted web_search_call items without their tool declaration can then make the upstream reject the request.

This change projects remaining hosted search items into clearly labeled, untrusted historical reference text, after bridge restoration. It preserves their position and allowlisted status, query, URL, find pattern and source metadata; unknown/opaque fields are omitted. The text is explicitly not instructions or fetched page content. Existing messages, citations and real bridge-restored call/result pairs remain intact. Stored source history, ordinary generation and canonical native compaction are unchanged.

Responses Lite portable summaries also retain parallel_tool_calls=false: removing it while forwarding the Lite header causes an upstream 400 even with no callable tools. Non-Lite summaries continue omitting that field.

Related investigation: openai/codex#51962. This PR addresses OpenCodex's portable summarizer projection, not the separate native-client history compatibility case. Local Auto Fast catalog opt-in is not included in this PR.

Verification

  • Test first: nine metadata-conversion regressions failed before implementation; the separately reproduced Lite parallel flag test failed with 400 before its fix.
  • Bun 1.4.0 focused suite: bun test tests/responses/responses-compaction-override.test.ts tests/web-search/web-search-bridge-replay.test.ts — 81 pass / 0 fail.
  • Related suite: bun test tests/responses/responses-compaction-routing.test.ts tests/responses/responses-compaction-recovery.test.ts tests/ci-workflows/file-size-ratchet.test.ts — 190 pass / 0 fail.
  • Typecheck, structure SSOT, privacy scan, working/staged diff checks passed. Documentation build passed (569 pages).
  • Official Codex 0.161.0, temporary isolated client state, real upstream and this PR's Responses handlers: fixed Sol route produced hosted search/open history; manual compaction completed in 3.52s, persisted nonempty compaction and continuation recalled AZURE-KITE-731, 17. This exercised text conversion rather than the previous deletion behavior.
  • Additional isolated Lite smoke against the local integration candidate: fixed Sol and Astra routes both executed client-side web search through the real alpha/search handler, compacted through the configured Luna portable summarizer (4.42s / 4.43s), persisted nonempty compaction and recalled both facts. Incoming requests carried Lite=true, reasoning.context=all_turns and additional_tools. These are fixed-target HTTP-fallback tests, not proof of Jev policy, Fast-tier acceleration or WebSocket behavior. Original auth remained unchanged; temporary auth/history removed.
  • The larger OCX_TEST_RUNNER_BUN=<Bun 1.4.0> bun run test:changed run on the text-conversion candidate, before the final Lite flag fix, completed 15825 pass / 34 skip / 174 fail / 13 errors, 687 files. It is not green. 84 unique failure titles match the earlier run, and there are 86 different failure titles, including timeouts; the new differences have not all been baseline-classified. No compaction test failed in that run. An earlier unmodified aeebf11e5 baseline reproduced 80 prior failures; this does not establish that every current failure is inherited. The final Lite change was verified with the focused/related suites and real smoke above. No full-suite pass claim; keep Draft pending broader validation and review.
  • Base origin/dev was fetched and verified as an ancestor: aeebf11e5a2c49b5f2edb2e0d8ecafd95e872119. No unrelated local overlay or catalog changes included.

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.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.
  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • I resolved all correct Codex and CodeRabbit findings.
  • My PR is ready for review.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · 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

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ⬜ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

@yuanyuanlove yuanyuanlove changed the title fix(compaction): omit hosted search replay from portable summaries fix(compaction): preserve hosted search metadata as text Oct 8, 2026
lidge-jun added a commit that referenced this pull request Oct 9, 2026
…s in portable summaries (carry #6746) (#6799)

* fix(compaction): omit hosted search replay from portable summaries

* fix(compaction): preserve hosted search metadata as text

* fix(compaction): bound hosted search notes and keep them assistant reference text

* fix(compaction): collect only the capped search note list entries

---------

Co-authored-by: panyuanyuan <panyuanyuan@hetao101.com>
@lidge-jun

Copy link
Copy Markdown
Owner

Thank you, @yuanyuanlove! This fix landed on dev through the maintainer carry #6799 (squash commit f7d6c04), which credits you with a Co-authored-by trailer. The carry keeps hosted web_search_call history as bounded assistant reference notes in portable summaries (2048 characters per string, 20 list items, 64 KiB of notes per request), with one omission note for anything over the limit. Closing this PR as superseded by #6799.

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