Skip to content
This repository was archived by the owner on Nov 5, 2026. It is now read-only.

[codex] Surface local Codex diagnostic risks - #1

Merged
Nicolas0315 merged 2 commits into
mainfrom
codex/doctor-windows-pwsh-alias-warning
Jun 19, 2026
Merged

Nicolas0315 merged 2 commits into
mainfrom
codex/doctor-windows-pwsh-alias-warning

Conversation

@Nicolas0315

@Nicolas0315 Nicolas0315 commented Jun 17, 2026 •

Copy link
Copy Markdown
Owner

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/codex has pull_request_creation_policy: collaborators_only for 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

  • Warn in codex doctor when Windows resolves pwsh through WindowsApps/MSIX, which can break sandboxed shell execution.
  • Warn when logs_2.sqlite / WAL / SHM exceed the diagnostic log size threshold.
  • Add explicit recovery guidance for rollout files missing from the threads state DB: stop Codex, back up state_5.sqlite plus WAL/SHM, move them aside, then let startup backfill rebuild the inventory from rollout files.

Local repair performed

  • Removed a failing notify hook from local config.toml after backup; it was producing os error 206 hook failures.
  • Normalized local plugin manifests so defaultPrompt entries satisfy Codex limits.
  • Pruned low-value TRACE/DEBUG/noisy INFO rows from local logs_2.sqlite after backup; DB shrank from ~729 MB to ~5.8 MB.
  • Left thread DB rebuild for a Codex restart window because direct SQL backfill was rejected by second-opinion review as riskier than Codex startup backfill.

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.
  • New WARN/ERROR after repair window: 0.
  • 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].

@Nicolas0315 Nicolas0315 changed the title [diagnostic] Surface local Codex diagnostic risks [codex] Surface local Codex diagnostic risks Jun 17, 2026
@Nicolas0315
Nicolas0315 marked this pull request as ready for review June 19, 2026 01:07
@Nicolas0315
Nicolas0315 merged commit c6b553e into main Jun 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +2282 to +2283
for issue in issues {
check = check.issue(issue);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant