Repository navigation
Conversation
- RunFooter 在 run 结束后回读持久化 Run 记录的 stopReason/stopDetail: guard stop(预算/循环/重试风暴)的事件流 code 恒为 RUN_CANCELLED, 事件投影层拿不到停止原因,只有 Run 记录上有; - guard 停止显示既有 stopped 文案(stopReasons 子键),重试风暴补充 retriesInWindow 证据格式化;用户取消显示新的 cancelled 文案—— 此前 cancelled run 会落入 completed 分支,被显示成「已完成」; - i18n en/zh 新增 trace.footer.cancelled;GuardStopDetail 增加 retriesInWindow 可选字段; - RunFooter 导出并新增 5 条组件测试(纯取消、持久化预算停止、 重试风暴证据、事件投影优先于记录、正常完成不受影响)。
- Before:修复前,取消的 run 在 footer 显示「Completed · 0.1s · 0 steps」; - After:修复后,同一取消操作显示「Cancelled · 0 tools」; - 场景:FINAGENT_AGENT_PROVIDER=local + FINAGENT_DEMO_DATA=1, 发送报价问题后在 Stop 可点窗口内取消(local runtime 加了 4s 演示延迟 以便人工取消,该延迟只存在于截图脚本环境,不在本 PR diff 中)。
Contributor
Author
截图补充(demo/local 模式:
|
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.


改动说明
接线上游 #17「维护进度更新」中列出的剩余缺口之一:UI 展示 stopReason / stopDetail,让用户看到 run 为什么停止。当前 main 上存在两个具体问题:
RunManager的 safeguard stop(fix(runtime): replay #49 run-budget wiring onto clean main #54 接线的预算/循环/重试风暴)把stopReason写在持久化的 Run 记录上,但事件流的run_failedcode 恒为RUN_CANCELLED(pi-event-adapter.ts:126、local-runtime-adapter.ts:67),事件驱动的 footer 投影永远拿不到停止原因——GUARD_STOP_CODES的提取路径实际不可达。RunFooter的三分支文案里没有 cancelled 分支,status === 'cancelled'且非 guard 停止的 run 落入trace.footer.completed。修复:
kernel.listRuns()取该 run 的stopReason/stopDetail,guard 停止(budget_exhausted / loop_detected / retry_storm)渲染既有trace.footer.stopped文案;事件投影携带的 guard stop(若有)优先。trace.footer.cancelled(en:Cancelled · {{tools}} tools/ zh:已取消 · {{tools}} 个工具),不再误报完成;中性样式(取消不是错误),guard stop 与 failed 保持红色样式。formatStopDetail支持 retry_storm 的retriesInWindow(· N retries);GuardStopDetail补充该可选字段。bun run i18n:check1558 keys parity 通过)。不修改运行时预算算法;
observeRetry的运行时接线见 #424。无其他可见 UI 变化(footer 在正常 completed 场景的文案与样式不变,有组件测试钉住)。关联 Issue
Related to #17(本 PR 补全维护者列出的 UI 展示缺口;
observeRetry运行时接线见 #424。两个缺口都落地后 #17 的验收清单仅剩真实 provider 的 retry-storm run——检测器语义由单测覆盖,#49 已交付的低预算与重复调用 E2E 不受本 PR 影响)测试报告(正式审核前必填)
环境
实际执行命令与结果
截图(demo/local 模式:
FINAGENT_AGENT_PROVIDER=local+FINAGENT_DEMO_DATA=1,取消场景的 After 与修复前 Before)随后以评论附上。