Repository navigation
Conversation
A rate-limit or provider error settled back to an ordinary composer with no failure the user could read. Keep the final reason on screen until the user dismisses it or starts another turn. Co-authored-by: tt-a1i <tt-a1i@users.noreply.github.com>
|
Manual end-to-end check for #469. Both runs used the real Main ( Main composer after HTTP 429, no failure alert PR head ( PR head composer showing the 429 failure alert Closing that alert removes it: PR head composer after the 429 alert is dismissed A separate message that receives HTTP 502 shows a new alert with the 502 reason, not the earlier 429 text: PR head composer showing the 502 failure alert Sending the next message, which the endpoint accepts, clears the alert. The assistant reply is “Manual verification reply.”: PR head composer after the next successful message clears the alert |
Problem
Fixes #469.
Provider 或限流错误结束一轮之后,Web 会回到普通空闲输入框,失败原因从界面上消失。用户只看到自己的消息和可继续输入的 composer,无法判断任务为什么停、要不要重试或改配置。这和启动前的
prompt_failed不同:Pi 已经开始模型调用,并把结果记成stopReason: "error"。Value
用户能把成功、取消、失败和仍在重试区分开。限流耗尽或 Provider 错误会留下可读原因,直到用户关闭提示或开始下一轮;刷新快照不会把它清掉。已有的部分回答仍留在会话里,转录里的失败记录也继续保留。
Approach
在运行时事件边界记住本轮最后一条 assistant 错误,自动重试失败时用
finalError覆盖它,但在turn_settled且结果为failed之前不展示。重试进行中不把最终失败提前画出来。结算后,composer 用 alert 显示这条有界、已脱敏的原因。用户关闭、发送下一条,或下一轮turn_started才会把它拿掉。成功结算不会沿用上一轮的失败。Validation
tests/web/provider-failure-idle.spec.ts。去掉 composer 的失败 alert 后,测试在空闲输入框上找不到失败原因而失败;恢复后通过。断言的是可见的 alert 文本,不是内部标签。429 rate limit exhausted而不是中途的temporary 502,快照刷新后仍在,关闭后消失,成功轮次不显示,下一轮开始后清除。node node_modules/vitest/vitest.mjs run tests/web/provider-failure-idle.spec.ts tests/web/provider-error.spec.ts tests/web/web-store.spec.ts tests/web/app-render.spec.ts:4 files, 341 passed。node scripts/run-tests.mjs ui:100 files, 1532 passed。bun run check:通过。bun run test的 Node 套件:2657 passed,1 failed,9 skipped。失败是tests/extensions/shared/setup-config.test.ts的 “a waiting setup writer recovers after the lock owner dies”,子进程 stderr 出现了 Node 的 ExperimentalWarning: Type Stripping,与本次 Web 改动无关。Vitest 套件因此没有在同一次bun run test里继续,已单独跑完并通过。Impact
turnFailure只存在于当前页面状态。刷新页面后,失败事实仍由已保存的 assistant 错误消息呈现。