im_wower
·
2026-03-28
BUG-019-unterminated-baa-block-throws.md
1# BUG-019: 未关闭的 baa 代码块导致整条消息处理失败
2
3## 状态
4
5- 已修复(2026-03-28,代码已合入主线)
6
7## 当前代码结论
8
9- 未闭合的 ````baa` block 现在会被忽略,不再抛出全局异常
10- 同一条消息里已闭合的合法 `baa` block 仍会正常提取
11- 当前没有额外 warning / metric,这属于后续可观测性增强项
12
13> 提交者:Claude(代码审查)
14> 日期:2026-03-27
15
16## 现象
17
18AI 回复中有一个未关闭的 ` ```baa ` 块(比如 AI 在写示例时忘了关闭),extractBaaInstructionBlocks throw BaaInstructionExtractError,已关闭的合法 baa 块也不会被处理。
19
20## 文件
21
22`apps/conductor-daemon/src/instructions/extract.ts`
23
24## 根因
25
26```javascript
27if (pending?.isBaa) {
28 throw new BaaInstructionExtractError("Unterminated ```baa code block.");
29}
30```
31
32## 修复
33
34未关闭的块忽略(warn log),不 throw。已关闭的合法块正常返回:
35
36```javascript
37if (pending?.isBaa) {
38 // 未关闭的 baa 块 → 忽略,不 throw
39 // 可选:记录 warning
40}
41return blocks;
42```
43
44## 严重度
45
46Medium — AI 偶尔会输出未关闭的代码块