Conversation
added 2 commits
September 20, 2026 11:45
runner 对行情获取与日历探测都做了降级(失败即跳过),但 researchStart 与 notify 是裸 await:任一 symbol 的分析或通知回调抛错,runAutomation 整体 reject,调用方拿不到返回值,于是 AutomationRun 不落盘、后续 symbol 不再评估、也没有任何失败记录,规则静默失败且每分钟重试。 现在把两个副作用回调按同一策略降级:失败写入 failures(research analysis failed / notification failed),继续处理剩余 symbol。analyzed 只统计真正完成的分析,notified 只在通知真正送达后置位。 新增回归测试:3 个 material symbol,第一个研究失败、第二个通知失败, 仍评估全部 3 个、产出失败记录并保留其余分析与通知;修复前该测试因整轮 reject 失败。
helsome
approved these changes
Sep 21, 2026
helsome
left a comment
Owner
There was a problem hiding this comment.
核心 automation 修复可以批准:runAutomation 对 researchStart / notify 的失败降级与 #137 验收一致,调用侧确实是在 executeAutomation 返回后才持久化 AutomationRun;新增用例直接覆盖“前一 symbol 失败后仍继续处理剩余 symbol、只统计成功 analysis/notify”的行为。当前 head 的 Focused tests / Typecheck / Secret scan / advisory full suite 也均为 success。
但现在不能合并:PR 相对当前 main 有实际冲突,且 experiment-service.ts 的 runtimeUnusable: false 已经在 main,不再属于本 PR 的必要增量。请 rebase/解决冲突,让该冗余 hunk 自然消失,只保留 automation/runner.ts + 对应测试;更新后的 head 跑 focused automation tests + typecheck/basic CI 即可,不要求额外 E2E。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与修复
automation runner 对数据获取是降级策略(quote、日历探测失败只记 failures 并继续),但
researchStart与notify是裸 await:任一 symbol 的研究或通知回调抛错,runAutomation整体 reject,调用方拿不到返回值 →AutomationRun不落盘、后续 symbol 不再评估、无失败记录,且lastAutomationRunByRule未写入导致每分钟重试重复研究。现在把两个副作用回调按同一策略降级:
失败写入
failures后继续处理剩余 symbol;analyzed只统计真正完成的分析,notified只在通知真正送达后置位。函数签名与返回结构不变,调用方无需改动。Closes #137
范围仅 runAutomation 的副作用回调错误处理。排程判定(#96「同一天重复运行」)是另一个根因,不在本 PR 内。
可复现测试报告
Windows 11 / Bun 1.4.2 (744846f84),基于 main ff3ed3d,分支
codex/fix-automation-callback-failures(7a41b26)。bun test packages/shared/src/automation/runner.test.ts:新增回归测试(3 个 material symbol,第 1 个 researchStart 抛错、第 2 个 notify 抛错)修复前 16 pass / 1 fail(整轮 reject:error: research backend offline);修复后 17 pass / 0 fail,并断言仍评估 3 个 symbol、failures 为['AAPL.US: research analysis failed', 'MSFT.US: notification failed']、其余分析与通知照常完成。bun test packages/shared/src/automation:55 pass / 0 fail。bun test packages/shared --isolate:993 pass / 3 fail;3 项(ResearchService ×2、langfuse ×1)已在干净 main(ff3ed3d)上复现为 17 pass / 3 fail,属基线失败,与本改动无关。bun run typecheck:core/uiExited with code 0;shared/i18n/electron 报 main 现有src/evaluation/experiment-service.ts(534,7) TS2741(main 同样复现,PR fix(eval): separate live execution validity from quality and propagat… #122 已包含补全),本 PR 不涉及该文件。git diff --check:通过。集成路径经真实
runAutomation+ capability registry + 通知回调验证;未运行桌面端 E2E 与全仓bun test,也不声称验证了 kernelHost 排程副作用。UI 变化
无可见 UI 变化:仅后台规则执行路径的错误处理,通知内容与呈现未改。
2026-09-20 类型检查修复复验
补齐 experiment-service.ts 配置应用失败返回值的 runtimeUnusable: false。此时尚未启动运行任务,因此不应标记运行时不可用。该主分支遗漏也是旧版 CI 的 TS2741 根因。本 PR 增加此最小修复以解除检查阻塞(与在审 #122 对此字段的修正一致,无需引入其余改动)。无可见 UI 变化。
环境:Windows / Bun 1.4.2。实际执行:
996 pass
0 fail
3944 expect() calls
Ran 996 tests across 91 files. [24.83s]
上述结果替代此前测试报告中类型检查失败的状态;远端检查以本次提交的 CI 为准。未额外运行桌面 E2E。