Repository navigation
fix(codex): preserve sync edits with canonical sandbox checks - #7659
Conversation
Injection (run by ocx sync, start, and settings changes) removed every root model_context_window even though OpenCodex never writes that key, and it rewrote a marker-owned [agents] default_subagent_* value whenever the marker comment survived, including after the user edited the value. Root model_context_window is now left alone. The journal records the exact managed sub-agent default values each injection writes; a marked value that no longer matches that record is adopted as user-owned (its marker is dropped) on both sync and restore. Without a record the marker alone still decides. Refs #7425
Compare native realpaths and the exact expected config file while retaining separator-bounded containment and isolated child environments. Clarify that the parent-home fingerprint observes the test harness home. Register the carried test in the existing codex shard without growing layout.json. Supersedes #7553; carries its original three commits with authorship intact. Co-authored-by: chlwnsgurg <97290748+chlwnsgurg@users.noreply.github.com>
|
Caution Review failedThe pull request is closed. Finishing Touches
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 |
|
✅ Deterministic PR hygiene checks passed. |
Seed the existing runtime cache seam for the missing/null version equality case, and pin the Desktop process fixture's user-owned native catalog. An installed Codex must not select a real runtime or change model order while these fixtures exercise cache equality and remote authority. The unmodified dev sources reproduce both failures (59 pass, 2 fail). These nine fixture-only lines give 61 pass, 0 fail. A scratch mutation removing null normalization still fails the unchanged persisted-byte assertion, so the target regression remains effective. This is a minimal L5 write-scope exception needed for its required macOS gates; no production code, timeout or assertion was changed.
Resolve the runtime fixture overlap by retaining dev's complete #7552 isolation and assertions. Its version-equivalence coverage supersedes the lane's redundant fallback cache seed. Preserve the lane's config ownership changes and isolated Desktop catalog fixture. Includes dev commits 43f872f (#7552) and bd5c2ea (#7598).
The first injected hash must stay pinned to protect unrelated user edits. Before replaying that snapshot, compare native-default cleanup using the latest recorded values against marker-only cleanup. Conflicting ownership keeps restoration on the existing field-level path instead of deleting a user edit that happens to recreate earlier injected bytes. Reuse the same known-key parser on the already-read journal. Missing records retain legacy behavior; profile and hash policies are unchanged. Regression-first proof on unfixed sources: 9 pass, 4 fail. Model and effort edits are preserved by both native restore APIs after the fix; legitimate managed A-to-B-to-A cycles still restore the exact snapshot. The affected journal/default suite passes 89 tests.
|
Integration evidence for exact head 17961b6 (lane L5; supersedes #7553, carrying its three commits with authorship):
Static merge simulation on current dev 71be051 (this Mac): dev=71be051990145357578c61a2f2b258db57654b9f base=47316142fe06171a94de02d63f1727dbed4c0382 pr_files= 15 overlap=[scripts/test-layout/layout-codex-collision.json tests/fixtures/test-layout-expected.json ]; 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 52 pass 0 fail ; Merged by the triage manager as maintainer integration (MAINTAINERS.md, dev only) under the owner's static-judgment rule while GitHub Actions is degraded; dev push CI will be checked when Actions recovers. |
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. |
Summary
Supersedes #7553. Carries c6862ad, b4f6445, and 436bbbf with their original authorship, then fixes the new regression test's macOS/Windows path comparison.
Sync and restore retain a user-owned root
model_context_window. Native subagent defaults record their written model/effort strings in the injection journal; a later string edit is adopted as user-owned even when the old marker survives. Untouched managed defaults still follow OpenCodex settings, and multiline string edits are supported. Native snapshot restore also checks the latest default ownership before trusting an older whole-file hash, preserving edits that recreate earlier injected bytes.The child-process regression now compares native canonical paths, requires the exact expected config file, and retains separator-bounded containment, isolated home variables and the parent test-home fingerprint. Runtime path canonicalization is unchanged. The test is registered in the existing codex shard and expected oracle, with no net layout.json change. structure/config.md stays at 600 lines.
Refs #7425 (partial scope only; do not close).
Decisions
defaultEffortin the OpenCodex JSON config remain outside this PR. Journals without the new default-value record keep legacy marker-only behavior on their first sync; this PR does not infer ownership without evidence.tests/claude-integration/claude-desktop-remote-hub.test.tspin a fixture-owned custom native catalog, keeping exact hub-authority/restart assertions independent of asynchronous host catalog order. The earlier runtime fixture workaround is now superseded by dev test: make codex-runtime, client-connect and loopback-listener tests deterministic #7552: the mergedcodex-runtime.test.tsis byte-identical to current dev, with all of its stronger isolation/assertions retained. No lane changes to production runtime.ts or test timeouts. Unmodified old dev reproduced both host-dependent failures (59 pass / 2 fail), and their isolation passed 61 / 0; the scratch null-version mutation still triggered the unchanged persisted-byte assertion.Verification
Current head:
9bdf314a6bfcf826fcd2a608170269119117e3f5; includes devbd5c2ea906741a4201c6f35bb180e7a9a112a4fd. Repository-pinned Bun 1.4.3. Heavy commands are serialized with the host-wide test lock and run outside Git hooks.Current-head results:
bun test --isolate <18 focused files>, exit 0; 703 pass / 4 skip / 0 fail.bun run test:changed --parallel=2: exit 0; 27,642 pass / 36 skip / 0 fail, all 1,219 selected files / 27,678 tests, 539.9 seconds. Supported concurrency changes only scheduling; no assertions, files or timeouts are removed.bun run typecheck,bun run privacy:scan,bun run structure:check: each exit 0 (non-test gates; test counts not applicable).bun run --cwd docs-site build: exit 0; 593 pages / 84,861 internal links.git diff --checkexit 0. The earlier High native-restore ownership finding is closed; execution/CI evidence is assessed separately.bun run test: exit 0, 52,155 pass / 163 skip / 0 fail, all 2,598 files / 22 batches, 541.91 seconds. The generated receipt binds this clean exact head and current check epoch.lane=all, has matching headSha9bdf314a6bfcf826fcd2a608170269119117e3f5and is queued. No platform success is claimed. The PR remains draft.Regression-first evidence:
3f5d6211sources with current regressions: 9 pass / 4 fail, exit 1. Fixed journal/default suites: 89 pass / 0 fail, exit 0. Positive managed A→B→A controls still require exact snapshot restoration.Earlier validation failures are retained as history, not current passing evidence. The old-dev full suite failed two ambient-installation fixtures (52,146 pass / 162 skip / 2 fail); an unchanged dev archive reproduced both (59 / 2). Fixture isolation passed 61 / 0, and a scratch null-version mutation still failed the unchanged persisted-byte assertion. Dev #7552 subsequently superseded the lane runtime fixture change. At prior head
7a536aef, full tests passed 52,148 / 162 skip / 0 fail. Its default-concurrency changed cohort hit one unchanged Copilot test's 5,000ms limit; serial execution hit the existing 900-second suite deadline. The supported two-worker run retained the complete cohort and passed 27,695 / 36 skip / 0 fail. No test or timeout was weakened. Obsolete validation was interrupted when the native-restore High was accepted; neither interrupted run nor old-head CI certifies the current fix.The host-local pre-push hook was bypassed with manager-approved
git push --no-verify; it is not repository policy. One hook attempt failed on missing GUI oxlint (exit 127); a later hook suite was stopped when inherited Git variables let fixtures alter the lane HEAD/index and shared core.bare. Neither is passing evidence. All 12,887 tracked files matched the intended commit. After manager approval, only sharedcore.barechanged from true to false; other keys were unchanged. Intended HEAD and clean status were verified before pushing. Required validation runs outside the hook.Checklist
Co-authored-by: chlwnsgurg 97290748+chlwnsgurg@users.noreply.github.com