brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
lov-fix-codex-session诊断并修复无法恢复的 Codex 会话:定位悬挂 tool call/output,并在切换模型 提供商后处理 Model provider not found 的 provider 绑定,恢复交付物与可继续路径。
Independent GitHub snapshot · Automated classification · Original documentation governs
把一条无法继续的 Codex 线程诊断清楚,并给出能继续的产物。它覆盖两种常见
故障:tool call 没有配对的 tool output,以及切换 provider / 中转站后
Model provider not found。前者可以从磁盘交付物接手或生成可恢复 rollout
副本;后者只同步 state_*.sqlite 的 provider 绑定,不改写 rollout。
custom not found”lov-open-codex-session。lov-search-chat。config.toml、不处理 thread 元数据 —— 交给 provider manager / CC Switch;
本 Skill 处理的是 thread 与配置已经不一致后的恢复。lov-fix-general;本 Skill 只处理
Codex 会话持久化状态与 provider 绑定的特定故障。lov-skill-publisher。skill.yaml 声明 user-profile/v1。每次运行开始先读共享的 user、brand、
workspace、preferences 与 skills.lov-fix-codex-session 命名空间。线程 id、
rollout 路径、转录内容、秘密或完整私有路径都不写入持久 Profile;涉及会话的
标识只在当前请求内使用。字段解析优先级:当前请求 → 项目上下文 → Skill 记录
→ 共享偏好 → 共享 user/brand Profile → 安全默认值。
When the user directly states a durable preference or brand fact, persist it
through scripts/profile_store.py and report the saved profile path. Put
Skill-specific values under records.<field>; use brand.<field> or
user.<field> for shared values. Do not persist inferred secrets or credentials.
See references/user-profile.md for the complete contract.
Read references/skill-composition.md before deciding whether to invoke or
extend any adjacent capability. The record distinguishes optional upstream and
downstream handoffs from embedded Kit modules. Do not silently depend on a
sibling Skill that is not shipped with this source.
You MUST follow these steps in order.
SKILL_DIR if the environment provides it.When running scripts manually:
export SKILL_DIR="/path/to/lov-fix-codex-session"
context.profile 按上述优先级解析。用户直接说出的、希望跨会话保留的值,用
scripts/profile_store.py record --confirm 原子写回并报告保存路径;推断值、
秘密、token、cookie 与 key 不入库。
Model provider ... not found 时,输入是当前
config.toml / state_*.sqlite;报错含 No tool output found 时,输入是
线程 id / codex:// 链接。输出始终是一份诊断结论 + 可继续的恢复路径;
不要把实现细节作为用户制品。references/skill-composition.md.references/skill-composition.md。Model provider ... not found 时走 A;否则按
B 处理悬挂 tool call。python3 "$SKILL_DIR/scripts/sync_thread_provider.py" --codex-home "$HOME/.codex" --json
确认 candidate_ids 只包含真正过期的 provider(默认 stale-only,不会
动 built-in 的 openai)。然后退出 Codex Desktop,运行:
python3 "$SKILL_DIR/scripts/sync_thread_provider.py" --codex-home "$HOME/.codex" --apply
脚本会先做 SQLite 一致备份再写 threads.model_provider。不要重写
sessions/ 下的 JSONL:paginated 会话的 end_byte_offset 会因此失效。codex://threads/<uuid>、
线程 id 提取 thread_id;若给的是链接,只取 UUID。state_5.sqlite 的 threads.rollout_path;拿不到
就在 ~/.codex/sessions 下按线程 id 搜索 rollout-*.jsonl。python3 "$SKILL_DIR/scripts/fix_codex_session.py" "$thread_id" --json
核对报告中的 dangling_calls 与 last_turn_error;poisoned=true 即为毒点。python3 "$SKILL_DIR/scripts/fix_codex_session.py" "$thread_id" --fix
生成 <rollout>.repaired.jsonl(不覆盖原文件,宿主未运行线程时才用
--write,且会留 .bak 备份)。告知用户:部分宿主需重启或重新加载后
修复才生效。threads.model_provider 分布并确认无过期 provider;
tool-call 场景确认修复副本仍是合法 JSONL、dangling_calls 已清空、交付物可打开。
报告具体文件与恢复结论,不要回读被丢弃的私密内容。skill-card.yaml, cases/cases.json, and pricing-card.yaml as the
standard trust bundle for this Skill.fix_codex_session.py 与 sync_thread_provider.py
都不需要第三方包)。~/.codex/sessions);线程 id 用于定位。config.toml 与 state_*.sqlite;provider 同步只写 SQLite 索引。read_thread / list_threads 等能力,可用于确认线程当前状态。lov-open-codex-session(导航)、
lov-fix-general(通用修复)、lov-search-chat(会话检索)。