The dry-run script lived under frontend/scripts and read a test fixture, so the web image build would type-check a file the image does not copy. Move it to frontend/tests with a non-test filename. The switch default is unchanged. Checked: guard plus answer-effort tests 5 pass, 0 fail, 0 cancelled; probe --dry-run exit 0; tsc exit 0; lint 0 errors and 123 warnings. Co-Authored-By: Grok (agent loop)
3.3 KiB
3.3 KiB
PROGRESS · 答题推理强度开关修复(2026-10-15)
- 分支:
codex/answer-effort-ab-20261013 - 被打回的提交:
ab7f66be14d93a5ccbc3433f3c44e134a65b1e21 - 修复单:
docs/tasks/TASK-answer-effort-ab-fix-20261015.md - 已合并
origin/staging71f7fac3a13f817f91755ff01b25b8706380ae19,合并提交0d73cd332bf4efae2b8ec9389d5853384f4616f4。没有改写已推送的历史。
做了什么
- 把
frontend/scripts/research/answer-effort-probe.mts挪到frontend/tests/answer-effort-probe.mts。文件名不是.test.ts,也不是.test.tsx,全量测试不会把它收成一条用例。 - 相对路径改过:源码从
../src/...引入,夹具改成./fixtures/answer-effort-switch-20261013.json。本单测试改为从同目录引入。已经保存的夹具文件没有重写。 - 命令同步进
docs/tasks/PROGRESS-answer-effort-ab-20261013.md和docs/testing/answer-effort-ab-20261013.md。 - 业务代码没改。开关默认值没改。任务书里留到拍板的默认强度,以及没人调用的旧嵌套设置,都没做。
- 合并时,本分支原来的调查记录占用了 BUG-1351,和数据层的 BUG-1351 撞号。保留 staging 上的 BUG-1351、BUG-1352、BUG-1353。这条调查记录改为 BUG-1354。BUG-1140 补记了这次同一形状的挪动。
自测
| 检查 | 命令 | 结果 |
|---|---|---|
| 镜像守卫和本单测试 | 在 frontend 下 node node_modules/tsx/dist/cli.mjs --test tests/runtime-sources-no-test-imports.test.ts tests/answer-effort-switch-20261013.test.ts |
5 pass,0 fail,0 cancelled |
| 请求体拦截 | 在 frontend 下 node node_modules/tsx/dist/cli.mjs tests/answer-effort-probe.mts --dry-run |
退出码 0 |
| 类型检查 | 在 frontend 下 .\node_modules\.bin\tsc --noEmit -p . |
退出码 0 |
| lint | 在 frontend 下 npm run lint |
退出码 0,0 error,123 warning |
| 隐私标记与 bug 记录格式 | 在工作树根 .venv\Scripts\python.exe -m pytest tests/test_repo_privacy_markers.py tests/test_bug_history_workflow.py -q |
64 pass,0 fail,退出码 0 |
守卫的两条都在上面 5 条里面:镜像目录不再引用测试目录,并且仍认得当初弄坏构建的那几种写法。
prepareStep 会不会盖掉原有选项
不会整份换掉。开关打开时,答题步返回的供应商选项来自 agentGenerationSettings,Mastra 按步做深合并,并进这一步已有的选项。思考仍是打开。输出长度上限在基础流的模型设置里,这一步没有返回它,所以上限还在。缓存标记写在消息上,不在这份流选项里。因此没有往 BLOCKED.md 新写一条「被覆盖」。
偏离
- 没有跑前端全量
npm test。这一侧的约定是不跑全量,留给验收。本机只跑了打回指出的那条守卫,以及本单测试。 - 修复单写的
git diff ab7f66be..<新提交> -- frontend/src不是空的。原因是按修复单先合并了最新 staging,staging 自己改过星盘页和数据层。本轮修复相对合并提交0d73cd33,frontend/src没有差异。业务代码和开关默认值没动。 - A/B 未跑:缺模型 key。没有把请求体拦截写成对照已通过。
环境缺口
A/B 未跑:缺模型 key。BLOCKED.md 里原有的这一条保留,没有新增。