协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
codex-session-restore【开发与工程】Use when Codex Desktop sidebar sessions disappear, fail with systemError, or cannot continue after a model_provider switch. Diagnoses and repairs active, non-archived sessions without changing authentication or provider configuration.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use the bundled script first. It is dry-run by default and writes nothing unless
--apply is present.
Set --provider to the provider that Codex Desktop should recognize now, not
automatically to the provider that originally created the sessions.
--provider openai.--provider krill.config.toml, auth.json, or cc-switch's current provider just
to restore sidebar visibility. Changing current auth/provider is a separate
user request.Resolve <skill-dir> to the directory containing this SKILL.md; do not
assume a particular global skills installation root.
Restore old krill sessions into the current official/OAuth sidebar:
python "<skill-dir>/scripts/restore_codex_sessions.py" scan --provider openai
python "<skill-dir>/scripts/restore_codex_sessions.py" repair-active --provider openai
python "<skill-dir>/scripts/restore_codex_sessions.py" repair-active --provider openai --apply --yes
python "<skill-dir>/scripts/restore_codex_sessions.py" verify --provider openai
Repair one thread:
python "<skill-dir>/scripts/restore_codex_sessions.py" scan-thread --thread-id THREAD_ID --provider openai
python "<skill-dir>/scripts/restore_codex_sessions.py" repair-thread --thread-id THREAD_ID --provider openai
python "<skill-dir>/scripts/restore_codex_sessions.py" repair-thread --thread-id THREAD_ID --provider openai --apply
python "<skill-dir>/scripts/restore_codex_sessions.py" verify --thread-id THREAD_ID --provider openai
Use repair-active --provider PROVIDER --apply --yes only after a dry run
confirms the active non-archived session set is correct. Open turns newer than
30 minutes are treated as possibly active and are not closed unless
--close-recent-open-turns is explicitly present. Archived sessions stay
untouched unless --include-archived is explicitly present.
scan to find active non-archived
threads with provider mismatch, parse errors, open turns, open child spawn
edges, or stale goals.openai; current krill means krill.scan-thread --thread-id ID before single-thread repair. Read
references/recovery-checklist.md when the report shows multiple issue
types or Codex Desktop still shows systemError.repair-thread --thread-id ID --provider PROVIDER or
repair-active --provider PROVIDER without --apply to preview actions.--apply only after the preview is acceptable.verify --provider PROVIDER or verify --thread-id ID --provider PROVIDER.When the user says, "I am logged in with official Codex now, but my krill
sessions disappeared," keep official OAuth as-is and migrate active session
metadata to openai:
python "<skill-dir>/scripts/restore_codex_sessions.py" scan --provider openai
python "<skill-dir>/scripts/restore_codex_sessions.py" repair-active --provider openai
python "<skill-dir>/scripts/restore_codex_sessions.py" repair-active --provider openai --apply --yes
python "<skill-dir>/scripts/restore_codex_sessions.py" verify --provider openai
When the user explicitly wants to use krill as the current provider, repair
active session metadata to krill:
python "<skill-dir>/scripts/restore_codex_sessions.py" repair-active --provider krill
python "<skill-dir>/scripts/restore_codex_sessions.py" repair-active --provider krill --apply --yes
python "<skill-dir>/scripts/restore_codex_sessions.py" verify --provider krill
archived_sessions or archived rows unless the user explicitly
asks and the command includes --include-archived.task_complete to close an interrupted or damaged turn. Use
turn_aborted.turn_aborted.--close-recent-open-turns only for known failed continuations.session-restore-backup-YYYYMMDD-HHMMSS under CODEX_HOME.threads.model_provider and rollout session_meta provider metadata.turn_context entries by unique turn_id; ignore legacy
no-turn_id contexts for mutation.turn_aborted event per stale open turn.thread_spawn_edges after making child rollouts internally closed.thread_goals; optionally complete them only when an
explicit repair flag is used.Read references/recovery-checklist.md when deciding whether to repair provider
metadata only, repair rollout structure, close child edges, complete stale goals,
or ask the user to restart Codex Desktop.