Repository navigation
feat(responses): configure native reasoning retention across model and account switches - #6758
yuanyuanlove wants to merge 14 commits into
Conversation
…d account switches
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
|
⏳ DRAFT
What to do
Review readiness checklist
2/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
|
Follow-up to the UI screenshot gate and hygiene finding:
@lidge-jun @Ingwannu, could a maintainer review the management API security surface and apply |
…ownership Preserve both native retention policy and Claude per-blob replay/mint initialization. Keep both test-layout registrations and shared transport documentation. Add seven local regression cases for strict replay ownership versus opt-in retention.
|
Integrated The conflict resolution preserves both retention-policy initialization and upstream Claude replay/mint metadata, both test-layout registrations, and the transport docs. Upstream hosted-search portable-compaction behavior is retained. Added 7 local regression cases proving that strict Claude per-blob tag/account/generation ownership still overrides both retention opt-ins, already-stripped ciphertext is never restored, and search metadata remains assistant reference data. Validation on the merged tree, using Bun 1.4.0 in the isolated cloud checkout:
Exact backend commands: bun test --isolate tests/config/config-native-reasoning-retention.test.ts tests/server/server-native-reasoning-retention.test.ts tests/server/server-combo-reasoning-replay-eligibility.test.ts tests/adapters/reasoning-replay-identity.test.ts tests/responses/responses-account-change-scrub.test.ts tests/responses/responses-core-modules.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/claude-integration/claude-native-reasoning-continuity.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/repo-hygiene.test.ts
bun test --isolate tests/server/server-native-reasoning-retention-merge.test.tsIn This is scoped validation. The full backend/GUI suites and changed-mode suite were not run. The network-mocked compaction/opaque-blob suites were not rerun because of the previously observed inherited-proxy fixture limitation in this cloud environment; no proxy or security settings were changed. No live-account ciphertext-acceptance or reasoning-reuse result is claimed. Exact-head Cross-platform CI and React Doctor still require maintainer approval ( |
…ication Preserve the native retention degradation warning alongside Codex WS reuse configuration. Keep both test registration sets and regenerate the structure index. Add four local regression cases for independent retention and WS opt-ins. Keep the layout mapping unchanged while staying within its existing line limit.
|
Acknowledging the review/CI request against the current head Current-head Cross-platform CI |
There was a problem hiding this comment.
Correctness/coverage follow-up at c88bc61. I inspected the retention runtime delta, partial/null management update and publication/rollback handling, replay identity and recovery precedence, and selected backend/GUI regression fixtures. The current structure/docs correctly distinguish forwarding permission from demonstrated upstream acceptance; I am not treating synthetic ciphertext success as live cross-account acceptance.
The Verification section still names 1a22965. Later merges add seven cases in tests/server/server-native-reasoning-retention-merge.test.ts (including a source-oracle wiring assertion, not seven equivalent end-to-end proofs) and four invalid retention still warns while WS reuse honors ... cases in tests/config/config-native-reasoning-retention.test.ts. Those are relevant to the intervening Claude per-blob ownership and WS config merges and are not covered merely by quoting the old 204-pass receipt.
Please record validation for these post-1a229 cases against the current candidate, plus the affected retention/replay and GUI scope, with commands/results and any carried unchanged-tree evidence clearly separated. The 818-pass/23-fail baseline comparison remains attribution, not a green suite. I did not execute these files because another project's Cargo builds are active under the shared host's serial-workload rule, and I am not substituting source assertions for execution.
Current Cross-platform run 38093698634, Catalog 38093698643 and React Doctor 38093698635 are action_required. The current target/hygiene failure annotations both say unsponsored_surface; this is not a request to weaken them or repeat an already-addressed runtime fix. Draft, required independent review and sponsorship remain separate. No scan, fork-workflow authorization, sponsorship or approval was performed.
Update after the author's current-candidate receipt (2026-10-11): the requested Verification update is now supplied. I independently checked that published head c88bc61 has tree aa36b10e28532ecabb03634d5122067f75a08a39, the stated ordered parents 77189cf / 433764e, and 12,015 recursive tree entries. The revised description records the author's 287 backend / 30 GUI test passes, named commands and the post-1a229 cases, with helper/source-oracle scope and historical receipts separated. These are author-reported executions, not tests I ran or an independent verification of their runtime results. The earlier request to document this current-candidate evidence is addressed; it should not remain an outstanding stale-head-documentation objection.
The excluded opaque-blob recovery and compaction-override files still leave the current-candidate opt-in/rejection matrix unverified here. Full suites, current browser rendering and live cross-account acceptance/reuse remain unverified. I did not run a scan or alter proxy settings. Draft, independent boundary review, unsponsored-surface and workflow-authorization requirements are unchanged; this update is not approval or sponsorship.
|
Updated the Verification section for this review against The 2026-10-10 cloud run executed 287 backend tests (16 files), 0 failures, 2,332 assertions, and 30 GUI/locale tests, 0 failures, 4,234 assertions, using Bun 1.4.0. The full executed commands are now recorded in Verification. Typecheck, privacy scan, structure check, i18n lint, GUI build, and the diff check against integrated dev also passed.
The old macOS 204-pass/122-pass receipts, the 818-pass/23-fail failure-attribution comparison, and the simulated screenshots are now explicitly historical. The full backend/GUI and changed-mode suites were not run on the current candidate; the blocked inherited-proxy mocked-network paths were not retried, and no proxy/security settings were changed. No current browser rendering, live cross-account ciphertext acceptance, or reasoning reuse is claimed. Current-head Cross-platform CI, Catalog async contracts, and React Doctor still require maintainer approval. The |
|
Integrated Fetch verification confirms the published complete tree The only textual conflict was Fresh validation on this merged candidate in the isolated cloud checkout with Bun 1.4.0:
Exact backend commands: bun test --isolate tests/config/config-native-reasoning-retention.test.ts tests/config/config-load-degrade.test.ts tests/server/server-native-reasoning-retention.test.ts tests/server/server-native-reasoning-retention-merge.test.ts tests/server/server-combo-reasoning-replay-eligibility.test.ts tests/adapters/reasoning-replay-identity.test.ts tests/responses/responses-account-change-scrub.test.ts tests/responses/responses-core-modules.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/claude-integration/claude-native-reasoning-continuity.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/repo-hygiene.test.ts tests/cli/cli-headless-parity.test.ts tests/providers/deepseek-reasoning-replay.test.ts tests/responses/responses-compaction-recovery-policy.test.ts
bun test --isolate tests/config/hub-disable-live-save.test.ts tests/service/service-health-sentinel-policy.test.ts
bun run typecheck
bun run privacy:scan
bun run structure:check
git diff --cached origin/dev --checkIn bun test tests/native-reasoning-retention-panel.test.tsx tests/i18n-locales.test.ts tests/locale-parity.test.ts
bun run lint:i18n
bun run buildThe seven merge cases and four WS/config-warning cases were executed again within the 287-pass run. Their documented helper/source-oracle and process-local scope is unchanged; this does not prove end-to-end socket reuse. The prior This is scoped validation. Full backend/GUI suites and changed-mode validation were not run. The previously blocked inherited-proxy mocked-network opaque-blob/compaction-override and SOCKS-sensitive WS paths were not retried, and no proxy/security settings were changed. The comprehensive opt-in/rejection matrix, current browser rendering, and live cross-account ciphertext acceptance/reuse remain unverified. Exact-head Cross-platform CI, Catalog async contracts, and React Doctor remain |
|
Integrated the subsequent Fetch verification confirms the complete published tree The only textual conflict was Validation in the isolated cloud checkout with Bun 1.4.0:
Initial backend command: bun test --isolate tests/config/config-native-reasoning-retention.test.ts tests/config/config-load-degrade.test.ts tests/server/server-native-reasoning-retention.test.ts tests/server/server-native-reasoning-retention-merge.test.ts tests/server/server-combo-reasoning-replay-eligibility.test.ts tests/adapters/reasoning-replay-identity.test.ts tests/responses/responses-account-change-scrub.test.ts tests/responses/responses-core-modules.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/claude-integration/claude-native-reasoning-continuity.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/repo-hygiene.test.ts tests/cli/cli-headless-parity.test.ts tests/providers/deepseek-reasoning-replay.test.ts tests/responses/responses-compaction-recovery-policy.test.ts tests/config/hub-disable-live-save.test.ts tests/service/service-health-sentinel-policy.test.ts tests/adapters/anthropic/anthropic-billing-refusal.test.tsFinal affected-file rerun and gates: bun test --isolate tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts
bun run typecheck
bun run privacy:scan
bun run structure:check
git diff --cached origin/dev --checkThe typecheck/privacy/structure commands ran before the final formatting-only edit; the affected tests and diff check ran afterward. Carried GUI evidence: the complete This remains scoped validation. Full backend/GUI and changed-mode suites, broader network-mocked Anthropic billing integration, current browser rendering, and live cross-account ciphertext acceptance/reuse were not run. The blocked opaque-blob/compaction-override/mock-network/SOCKS-sensitive WS paths were not retried or bypassed, and no proxy/security settings were changed. The safe refusal tests use local Response bodies and do not establish live account behavior. Exact-head Cross-platform CI, Catalog async contracts, and React Doctor remain |
Ingwannu
left a comment
There was a problem hiding this comment.
Freshness follow-up at ef4645f716cfd974d1d3212f33bed6f424924db0: fetched and verified the two merge parents are 2dba4d53 and current dev 3e58c2ce. The conflict-resolution diff preserves the three retention registrations and the six incoming billing registrations in both layout/oracle; the grouped layout formatting is not a raised size baseline.
Your latest receipt correctly distinguishes the initial 324/1 invocation from the final 28/0 affected-gate rerun and carries unchanged GUI inputs rather than claiming a fresh GUI execution. Those remain author-reported results here; I did not rerun that 19-file suite or complete the outstanding management-boundary review.
Keep Draft. Exact-head executable CI remains action_required, and the existing unsponsored-surface/independent-boundary hold is not waived by integrating dev or a focused fixture receipt. No scan, workflow approval, sponsorship, technical approval or merge was performed.
Resolve conflicts with desktopCompatibility config, the Antigravity direct request decode (retention snapshot is applied after decode), the compaction-request scrub argument, locale additions, test-layout shards and the rewrapped responses transport doc.
…rtext Native reasoning retention deliberately forwards ciphertext minted under another model or account. ChatGPT can refuse it inside a 200 stream (a Codex WebSocket error frame or response.failed) instead of an HTTP 4xx, which bypassed the single sanitized rebuild. For requests whose ciphertext was actually retained across a change, the passthrough now inspects the zero-output prelude for a self-identified ciphertext refusal and routes it through the existing one-shot opaque-blob recovery and rejection memo. Also update the ingress source-oracle test for the direct-request decode that now precedes the retention snapshot, register the new test file, and document the streamed recovery in the retention structure doc.
A spent ambiguous replacement forbids the sanitized rebuild, so the retained-reasoning stream preflight must not consume and project the refusal into a synthetic 400. Arm it only while the resend is still available, set the retained marker only while stripping is off, and clear it once stripping becomes authoritative.
|
Thanks @yuanyuanlove! I merged current dev into your branch and pushed two follow-up fixes (streamed refusal recovery for retained ciphertext, and keeping a withheld refusal unprojected); details and validation are in the updated description. |
Keep the retention snapshot right after the direct-request decode and dev's client tool-catalog capture (lidge-jun#7058) after it; union the layout registries; let the source-order test allow code between the snapshot and the Anthropic replay block.
# Conflicts: # scripts/test-layout/layout.json
# Conflicts: # src/config/diagnostics.ts
# Conflicts: # structure/INDEX.md
|
Being carried into #7217 with your authorship preserved; this PR will be closed when the bundle lands. |
#6759, #6930, #6603, #6758) (#7217) Carried from #6759, #6930, #6603, #6758 (one commit per source PR, original authors preserved). Retention across account/model switches is opt-in and defaults off. Remote validation (hosted GitHub Actions unreliable; local tests not run by maintainer rule): union candidate codex/prr-integ-8 = dev c03eafd + #7224 + #7223 + #7225 + #7217 + #6454 + #6594 plus a Gentle Shell import-cycle fix (integ-9 e1f289c: typecheck + full suite on mini (Windows) and lidge (Linux), compared with the same host's dev runs) and a test-only Windows path-escaping fix for the reasoning-retention routing test (integ-10 0d4cba7, tree a2b309a: that file re-run on both hosts). Co-authored-by: fliaping <269832017@qq.com> Co-authored-by: panyuanyuan <panyuanyuan@hetao101.com> Co-authored-by: yuanyuanlove <yuanyuanlove@users.noreply.github.com>
Summary
Adds two independent, default-off opt-ins,
nativeReasoningRetention.modelSwitchandnativeReasoningRetention.accountSwitch. They let reasoningencrypted_contentbe replayed when the serving model or account changes on the canonical ChatGPT forward destination (same provider, adapter and durable endpoint), including concrete Combo candidates and account-pool retries. A simultaneous model and account change needs both switches. Everything else is unchanged: native compaction blobs are still stripped on any serving-identity change through a separate internal flag, continuation ids and uploaded-file refusals stay account-bound, and an upstream rejection still strips and rebuilds once. The settings are exposed in the dashboard (overview panel),GET/PUT /api/native-reasoning-retention, and docs (EN/zh-CN), with dashboard strings in every locale.Original work by @yuanyuanlove (head
ef4645f71). Maintainer follow-up on this branch:devintegrated at7640a942bwith a regular merge commit (no rebase or force push). The retention snapshot is now applied after the Antigravity direct-request decode, which replacesparsed. The newdesktopCompatibilityconfig, the compaction-request scrub argument, locales, test-layout shards and the rewrapped responses transport doc were resolved alongside it.errorframe orresponse.failed) instead of an HTTP 4xx, and that path skipped the single sanitized rebuild. For requests whose ciphertext was actually kept across a change, the passthrough now inspects the zero-output prelude for a self-identified ciphertext refusal and routes it through the existing one-shot opaque-blob recovery and rejection memo. The preflight is armed only while the rebuild is still allowed, so after a spent ambiguous replacement the original stream reaches the client unchanged. Ordinary turns keep the existing path.rs_*id the new account cannot resolve; it never forwards more.Before (
origin/dev7640a942b) and after (8a7bceb7c), real GUI builds served by sandboxed proxies; both switches default off:Verification
All results below are from head
8a7bceb7c(macOS, Bun 1.4.3), run with throwawayOPENCODEX_HOME/CODEX_HOME.bun scripts/test.ts --parallel=1on 20 files: 492 pass, 0 fail (3,673 assertions). Files:tests/config/config-native-reasoning-retention,config-load-degrade,tests/server/server-native-reasoning-retention,server-native-reasoning-retention-merge,server-combo-reasoning-replay-eligibility,tests/adapters/reasoning-replay-identity,tests/responses/responses-account-change-scrub,responses-core-modules,responses-opaque-blob-recovery,responses-retained-reasoning-stream-recovery(new),responses-compaction-override,responses-compaction-recovery-policy,tests/claude-integration/claude-native-reasoning-continuity,tests/providers/deepseek-reasoning-replay,tests/cli/cli-headless-parity,tests/test-layout,tests/test-layout-tooling,tests/ci-workflows/file-size-ratchet,repo-hygiene,structure-ssot.responses-retained-reasoning-stream-recovery.test.ts(4 cases) covers both stream shapes recovering once, a repeated refusal surfacing after one rebuild, and a spent ambiguous replacement leaving the stream untouched. Each case failed without its source change.cd gui && bun test tests/native-reasoning-retention-panel.test.tsx tests/i18n-locales.test.ts tests/locale-parity.test.ts: 30 pass, 0 fail.bun run lint:i18nandbun run build:guipassed (existing large-chunk warning only).bun run typecheck,bun run structure:check,bun run privacy:scan,git diff origin/dev --check: passed.{"modelSwitch":true}keepsaccountSwitchfalse; an unknown key returns 400; an unauthenticated request returns 401;nullresets to defaults and removes the block fromconfig.json.bun run testandtest:changedsuites (about 20 concurrent worktrees on the host). Cross-platform CI is dispatched on the exact head: https://github.com/lidge-jun/opencodex/actions/runs/38715681961. Whether the backend accepts or reuses another account's reasoning has not been tested live; the account switch only permits forwarding.Checklist
maintainer-sponsoreddecision forsrc/server/management-api.tsis still open.Review readiness checklist