Reproduce first
Before asking for a fix, make the bug observable: failing test, broken screen, log trace, or exact reproduction steps.
Module 03.3
Codex debugging and review
Codex becomes dangerous when you confuse fluency with correctness. This lesson trains the debugging and review loop: reproduce first, ask for changes against real evidence, validate with commands, and read the diff before you approve anything.
模块 03.3
Codex 调试与审查
当你把流畅输出误认为正确性时,Codex 就会变危险。这个子模块训练的是调试与 review 循环: 先复现、再基于证据提出修改、用命令验证,最后在审批前读完 diff。
Outcomes
Before asking for a fix, make the bug observable: failing test, broken screen, log trace, or exact reproduction steps.
Ask Codex to run or specify checks, then inspect whether those checks actually prove the problem is resolved.
Use `/review` or a review-oriented pass when you need a bug finder, regression detector, or second look at risky code.
学习结果
在要求修复之前,先让 bug 可观察:失败测试、坏掉的界面、日志轨迹,或明确复现步骤。
要求 Codex 运行或说明检查方式,再判断这些检查是否真的证明问题已经解决。
当你需要找 bug、看回归风险或对高风险代码做第二视角时,再进入 `/review` 或 review 工作流。
Workflow
Collect the failing command, stack trace, screenshot, or reproduction steps so the problem is not abstract.
Point Codex at the most likely files or subsystems instead of inviting it to guess across the whole codebase.
Do not ask only for code changes. Ask what should be run or checked after the patch.
Read what changed, especially around assumptions, deleted code, and any new edge cases.
If the change touches sensitive logic or broad surfaces, use review mode as an explicit second pass instead of trusting the first patch.
工作流程
先收集失败命令、堆栈、截图或复现步骤,让问题不再抽象。
把最可能相关的文件或子系统指给 Codex,而不是让它在整个代码库里乱猜。
不要只要代码改动;同时要求它说明修复后应该运行或检查什么。
读清楚改了什么,尤其留意隐含假设、删掉的代码以及新增边界情况。
如果改动触及敏感逻辑或大范围表面,就显式使用 review 作为第二遍,而不是直接相信第一轮补丁。
Templates
I can reproduce this issue with: - Command: pnpm test src/foo.test.ts - Failure: timeout after the loading spinner never clears Please inspect the likely files first, explain the probable cause, propose a fix, and tell me exactly which checks should pass afterward.
/review Focus on: - behavioral regressions - missing tests - risky assumptions - performance or security concerns Treat findings as the primary output.
模板
我可以这样复现这个问题: - 命令:pnpm test src/foo.test.ts - 失败现象:loading spinner 一直不消失,最后超时 请先检查最可能相关的文件,说明可能原因,提出修复方案,并告诉我修复后哪些检查必须通过。
/review 重点关注: - 行为回归 - 缺失测试 - 风险假设 - 性能或安全问题 把 findings 作为最主要输出。
Practice
练习
If Codex cannot see or infer the failure clearly, it is guessing from symptoms rather than solving the real problem.
Absence of obvious failure is weaker than explicit confirmation that the intended behavior is restored.
如果 Codex 不能清楚看见失败方式,它就是在凭症状猜测,而不是在解决真正的问题。
没有明显失败,远弱于明确证明目标行为已经恢复。