AbortSignal.timeout() is unref'd, so a hanging generateText drained the test event loop and cancelled the rest of the file. Clear the timer after the model returns. Co-authored-by: Cursor <cursoragent@cursor.com>
2.9 KiB
PROGRESS · 采用旁白点选入口修复(2026-09-04)
工作树:.worktrees/rectification-adopt-narration-fix-20260904
分支:codex/rectification-adopt-narration-fix-20260904
基线:任务书写 0aaa0d70;本工作树从当时 origin/staging e18bd25b(修复单提交)拉出。
任务书:docs/tasks/TASK-rectification-adopt-narration-fix-20260904.md
未改 Python、未 bump Skill、未放宽采用门。未提交、未 push。
| 任务 | 状态 | BUG |
|---|---|---|
| 5.1 早退分支用本轮决策 | 完成 | BUG-521 |
| 5.2 提示词同口径、诊断字段、8s 超时 | 完成 | BUG-522 |
5.3 stopFactsFromDropped 婚恋标签 |
推迟 | — |
实现要点
persistNextInterviewAfterChoice新增可选decision。persistApplied/applyCollectFocusDenial/persistNextInterviewIfIdle都传入本轮决策。未传时走decideAfterInferenceChange。函数体内不再出现decideFromDossier(。adoptDeliveryFacts与模板兜底用dossierWithCurrentInference合成后的 receipt,活跃分数来自本轮decisionState。deliverAdoptNarration返回adopt_narration枚举并打console.info(无模型原文)。AbortSignal.any([request.signal, AbortSignal.timeout(8000)]);超时 / 抛错走template:model_error。- 提示词改为「不要出现『确认』『精确』这两个词」。校验器仍打回「这不是确认的分钟」。
偏离 / 推迟
- 5.3 按让步顺序推迟:
not_renderable仍可能被标成「婚恋题只覆盖窗口两端」。 - 意图分类器没有超时:既有缺口,本单不修,记在此处,不改
BLOCKED.md。
测试
tsc --noEmit:0 错npm run lint:0 error,74 warning(既有)rectification-adopt-narration-2026090410/10;与 answer-choice / collect-stall / provisional-adopt 合计 66/66tests/rectification-*.test.ts tests/agentic-rectification-*.test.ts tests/birth-time-rectification-contract.test.ts:871 pass / 0 fail(基线 869 + 本单 2 条诊断/超时测试)
更正(2026-09-04 · 修复单 2)
上面「10/10、871 pass / 0 fail」与实测不符。AbortSignal.timeout() 的计时器是 unref 的;超时用例把 generateText 挂死后事件循环排空,运行器把该条及同文件后三条标成 cancelledByParent。
任务书在 Node 20.19 / CI Node 22 上的实测(完整六行):
# tests 10
# pass 6
# fail 0
# cancelled 4
# skipped 0
# todo 0
exit=1
定向套件 rectification-* / agentic-rectification-* / birth-time-*:tests 871,pass 858,fail 0,cancelled 4,exit=1。
本机 Node 24.15.0 用 tsx --test 时 tsx IPC 会撑住事件循环,看起来像 10/10;独立脚本 AbortSignal.timeout(30) + 永不 settle 的 Promise.race 仍以退出码 13 结束,abort 从未触发。根因与修复见 TASK-rectification-adopt-narration-fix2-20260904.md / BUG-523。