Commit f21e418
committed
fix(service-automation): 降级版挂起态读取器的 warn cause 移出 message,改走 meta (#6230)
`engine.ts` 的 `loadSuspendedRun`(`loadSuspendedRunStrict` 的降级版读取器)在
catch 里把数据源驱动自己的失败文本插进了 `logger.warn` 的 message。
`ObjectLogger.write()` 一次调用只加一个「时间戳 + 级别」记录头,message 里的
换行把一条记录切成多个物理行,后几行无级别无时间戳。
这条比 #5912(PR #6228)那条多一层危害:`warn` 走 stdout,`serve` 的 boot-quiet
窗口只包了 `process.stdout.write`,`BootLogCapture.offer()` 仅保留带级别头的
物理行 —— 无头续行被直接丢弃,不只是被误读;且 boot 期真实可达
(plugin.ts start() -> rearmSuspendedWaitTimers -> engine.resume -> gate)。
实测:三行 better-sqlite3 驱动错误把这条告警切成 3 个物理行,过 boot 缓冲过滤
后只剩 1 行,而留下的那行不含任何驱动事实。
改法与同族前六单一致,零新词汇:message 单行自足并补上后果句(读失败被翻译成
null,调用方看到的与「本来就没有这个挂起运行」完全一样),cause 走 `Logger`
契约 `warn(message, meta?)` 的第二参 —— 与 `error` 的第三参不同,warn 没有
Error 槽。级别刻意仍是 `warn`:这是功能性降级(#4632),上调才是镜像误用。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015a5qkLzpGXhLL2F5gvJ7dD1 parent dbe92a7 commit f21e418
3 files changed
Lines changed: 485 additions & 1 deletion
File tree
- .changeset
- packages/services/service-automation/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments