45bdb63eca
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>
53 lines
2.9 KiB
Markdown
53 lines
2.9 KiB
Markdown
# 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-20260904` 10/10;与 answer-choice / collect-stall / provisional-adopt 合计 66/66
|
||
- `tests/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。
|