Install
openclaw skills install codex-history-visibility-repairUse when Codex Desktop history, migrated sessions, restored rollout JSONL files, or old projects exist on disk but do not appear in the sidebar, especially after editing .codex sessions, session_index.jsonl, history.jsonl, state_5.sqlite, archived_sessions, or .codex-global-state.json.
openclaw skills install codex-history-visibility-repairUse the bundled Python script to repair Codex Desktop's local history indexes after migrations. The common root cause is not missing JSONL files: thread/list filters by exact model_provider, source metadata, state database rows, and project assignments.
Run a dry run first:
python "$env:USERPROFILE\.codex\skills\codex-history-visibility-repair\scripts\repair_codex_history_visibility.py" --dry-run --scan-project-parent D:\object
Apply the repair and verify via app-server thread/list:
python "$env:USERPROFILE\.codex\skills\codex-history-visibility-repair\scripts\repair_codex_history_visibility.py" --scan-project-parent D:\object --verify-app-server
If restored sessions are still archived, include them explicitly:
python "$env:USERPROFILE\.codex\skills\codex-history-visibility-repair\scripts\repair_codex_history_visibility.py" --target all --unarchive --scan-project-parent D:\object --verify-app-server
thread/list or the sidebar returns too few rows.--dry-run; check selectedThreads, visibleThreads, providerDistribution, and projectMappings.--dry-run; the script creates ~/.codex/history_sync_backups/visibility-repair.*.--verify-app-server; success means both threadListStateDbOnly.returned and threadListScanMode.returned match visible thread count.| File or store | Repair |
|---|---|
state_5.sqlite | normalizes \\?\ prefixes, sets source, thread_source, exact model_provider, and millisecond timestamps |
| rollout JSONL | syncs first session_meta.payload so scans do not restore stale metadata |
session_index.jsonl | rebuilds visible thread index |
history.jsonl | rebuilds prompt history entries used by desktop history surfaces |
.codex-global-state.json | rewrites project roots, root hints, and complete project assignments |
Default provider is OpenAI because recent Codex Desktop builds filter by that exact value. Override with --provider only after verifying the active build expects another string.
sessions/; the sidebar also depends on SQLite and global state.openai unless thread/list proves the current app expects it.state_5.sqlite; app-server scans rollout JSONL and can reintroduce stale provider/source metadata.Before sharing or publishing the skill, include only:
SKILL.mdagents/openai.yamlscripts/repair_codex_history_visibility.pyNever include .codex backups, SQLite databases, history.jsonl, session_index.jsonl, logs, auth files, or user-specific rollout contents.