Skip to content

fix(codex): re-land TUI settings promotion with anchored baseline - #10213

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/sta-2403-codex-tui-baseline
Jul 23, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/sta-2403-codex-tui-baseline

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

  • re-land Preserve Codex [tui] settings across managed CODEX_HOME remirrors #9475 so Codex TUI preferences survive managed CODEX_HOME remirrors
  • upgrade legacy baselines to v2 with per-key, content-anchored conflict records
  • preserve only ambiguous runtime values while unrelated config continues to mirror
  • avoid timestamps and global mirror suspension, including on WSL/SSH paths

Migration behavior

When a legacy baseline does not know a newly promoted key and runtime/system values differ, Orca records the exact raw pair instead of guessing which is newer. A later content change on one side resolves the conflict: a runtime choice promotes, a system edit wins, and simultaneous divergent edits re-anchor. If the system TOML shape cannot safely accept the key, the system value wins without stranding the migration.

Validation

  • pnpm exec vitest run src/main/codex src/main/codex-accounts — 61 files passed; 846 passed, 5 skipped
  • focused migration/removal suite — 74 passed
  • Node and CLI typechecks
  • full pnpm run lint
  • current-source Electron smoke: legacy v1 divergence preserved, runtime choice promoted and conflict cleared, third launch byte-stable, protected primary home untouched

Linear: STA-2403

Context: #9475, #10085

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b22fe0d5-ddc5-4d21-95b6-3fc067f9c360

📥 Commits

Reviewing files that changed from the base of the PR and between e55e15d and 5f9dc8f.

📒 Files selected for processing (12)
  • config/tsconfig.cli.json
  • src/main/codex/codex-config-mirror.ts
  • src/main/codex/codex-config-settings-preservation.ts
  • src/main/codex/codex-config-settings-removal.test.ts
  • src/main/codex/codex-config-settings-removal.ts
  • src/main/codex/codex-config-settings-upsert.ts
  • src/main/codex/config-settings-baseline-upgrade.test.ts
  • src/main/codex/config-settings-baseline.ts
  • src/main/codex/config-settings-conflict-resolution.ts
  • src/main/codex/config-settings-promotion.test.ts
  • src/main/codex/config-settings-promotion.ts
  • src/main/codex/config-toml-key-path.ts

📝 Walkthrough

Walkthrough

Codex configuration handling now parses structured TOML key paths and promotes both top-level and selected [tui] settings. New helpers upsert, remove, and preserve promoted settings while retaining TOML structure and line endings. Versioned baseline files and conflict-resolution logic track runtime/system values. Promotion now returns conflict-aware plans, and mirroring preserves selected runtime conflicts before updating baselines. Tests cover baseline migration, conflict transitions, TOML rewriting, [tui] promotion, and formatting behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, migration behavior, and validation, but omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, including Screenshots, AI Review Report, Security Audit, and Notes, and keep the testing list in the required checklist form.
Docstring Coverage ⚠️ Warning Docstring coverage is 26.83% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the Codex TUI settings promotion re-land with an anchored baseline.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@brennanb2025
brennanb2025 merged commit ef985ed into main Jul 23, 2026
2 checks passed
nwparker added a commit that referenced this pull request Jul 24, 2026
This reverts commit 8f40ddf (#10179).

Rebased on current main. The revert applied cleanly across the vast majority
of the 1,626-file PR; the remaining work was preserving PRs that had been built
on top of #10179 after it merged. All are preserved:

- #9990  perf(terminal): cold-restore replay
- #10213 fix(codex): TUI settings promotion
- #10135 fix(mobile): images in native chat
- #9387  fix(status-bar): Resource Manager badge + concurrent listSessions
- #9853  fix(app): bound wake/quit paths (phone-session-ended freeze)
- #10237 fix(claude-accounts): quote claude path for Windows (kept shell:false)

Because those PRs were written against helper modules/APIs that #10179
introduced, the minimal, typecheck-verified closure they depend on is kept so
the tree builds and every later-PR test passes:

- bounded file/JSON readers used by #10213/#9990 (agent-state-file-reader,
  node-bounded-file-reader, json-text-structure-limit, terminal-history limits)
- claimed-agent-pty-owner cap API + pty:listSessions admission (#9990/#9387)
- the mobile-E2EE outbound-memory-budget subsystem #9853 builds on
  (e2ee-channel, mobile-e2ee-*, ws-outbound-backpressure-queue,
  remote-runtime-request-frames/-memory-limits, map-with-concurrency, e2ee-crypto)

Everything else #10179 added (~555 files) is deleted; every file it modified
elsewhere is restored to its pre-#10179 state.

Verified: root typecheck (node+cli+web), mobile typecheck, full root test suite,
full mobile test suite, oxlint, localization catalog + coverage, reliability
gates, max-lines ratchet, and the CLI emit build all pass. Two checks fail only
locally and fail identically on clean origin/main (this clone's git-tag
namespace for verify:skill-bundle-manifest; an inherited GIT_CONFIG_* env for
one relay test) — both pass on a clean CI environment.

Co-authored-by: Orca <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ablyai#10213)

* Reapply "Preserve Codex [tui] settings across managed CODEX_HOME remirrors (stablyai#9475)" (stablyai#10085)

This reverts commit f86e28f.

* fix(codex): anchor settings baseline migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant