Repository navigation
[codex] Surface local Codex diagnostic risks - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b3c6a5161
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for issue in issues { | ||
| check = check.issue(issue); |
There was a problem hiding this comment.
Keep integrity failures visible when logs are large
When any runtime DB fails the integrity check and the logs DB also exceeds the new size threshold, this still builds a failing state.paths check but attaches only the log-size warning issues. The human renderer summarizes any non-ok check with issues using issue_summary, so the fail row/note is described as diagnostic log size rather than the database integrity failure, sending users toward log rotation while the corrupt DB still needs recovery.
Useful? React with 👍 / 👎.
| .expected("every rollout file has a matching threads row"), | ||
| .expected("every rollout file has a matching threads row") | ||
| .remedy( | ||
| "Stop Codex, back up state_5.sqlite plus its WAL/SHM files, move them aside, then start Codex so startup backfill can rebuild the thread inventory from rollout files.", |
There was a problem hiding this comment.
Don't reset unrelated state for thread drift
When the threads table is only missing rollout rows, this remedy tells users to move the entire state_5.sqlite aside. That database also stores non-rollout state such as agent jobs, remote-control enrollments, and external-agent import history, while startup backfill only recreates thread rows from rollout files, so following this guidance can make those records disappear from the new runtime DB; prefer a targeted thread backfill/reset or explicitly warn that non-thread state must be restored from the backup.
Useful? React with 👍 / 👎.
Why
This branch packages the local Codex diagnostic issues observed on Windows into reviewable doctor improvements. The affected installation had repeated Windows sandbox/shell failures, oversized SQLite diagnostic logs, and thread rollout inventory drift that was hard to act on from the existing report.
Upstream PR creation remains blocked because
openai/codexhaspull_request_creation_policy: collaborators_onlyfor this account. This fork PR is the review artifact; upstream compare is available here:https://github.com/openai/codex/compare/main...Nicolas0315:codex/doctor-windows-pwsh-alias-warning?expand=1
What changed
codex doctorwhen Windows resolvespwshthrough WindowsApps/MSIX, which can break sandboxed shell execution.logs_2.sqlite/ WAL / SHM exceed the diagnostic log size threshold.threadsstate DB: stop Codex, back upstate_5.sqliteplus WAL/SHM, move them aside, then let startup backfill rebuild the inventory from rollout files.Local repair performed
notifyhook from localconfig.tomlafter backup; it was producingos error 206hook failures.defaultPromptentries satisfy Codex limits.logs_2.sqliteafter backup; DB shrank from ~729 MB to ~5.8 MB.Validation
codex doctor --summary --no-color --ascii: 16 ok, 1 idle, 3 notes, 1 warn, 0 fail. Remaining warn is the thread inventory drift that now has explicit doctor recovery guidance in this branch.cargo test -p codex-cli --bin codex windows_shell_check: passed 2 tests.cargo test -p codex-cli --bin codex large_sqlite_log_issue: passed 1 test.cargo test -p codex-cli --bin codex thread_inventory_check_warns_for_missing_stale_and_mismatched_rows: passed 1 test.git diff --check: passed.just fmt: Rust/Python formatting completed; Bazel/Starlark buildifier still fails on this Windows host with[WinError 2].