Conversation
…tyle retry policy Align the LLM stream-retry layer with codex (6 total attempts = 5 retries, uncapped 200ms*2^(n-1)*uniform(0.9,1.1) backoff) and surface each retry attempt's error in an expandable "重试详情" block on the live reply, on both the desktop app and the WebUI. Desktop (agent-gui): - streamRetry.ts: codex backoff, onRetry now carries the failing attempt's errorMessage, onRetryRecovered fires when a retried attempt commits - liveTranscriptStore/useLiveTranscriptController: retryAttempts live state with the same coalesced per-frame flush as toolStatus - agentRunner/runTextConversationTurn: per-network-attempt accumulators (cleared at each fresh attempt) wired through both chat modes - RetryDetailsBlock (RoundContent.tsx, modeled after ThinkingBlock), rendered in the active live round and in the no-rounds-yet fallback row WebUI (agent-gateway/web): - retryAttempts rides the existing tool_status chat event (Rust envelope passes the field through; Go ingress already merges data generically): null/absent = unchanged, empty array = clear - transcriptStore mirrors the list with run-boundary resets; GatewayTranscript renders the mirrored RetryDetailsBlock in the pending bubble and under the live assistant row Tests: stream-retry callback contract incl. errorMessage, bridge event dedupe/ride-along shape, Rust envelope pass-through, web store lifecycle (update/keep/clear/run-boundary resets). Known limitation: a WebUI client that (re)connects mid-retry restores the status text from the activity snapshot but sees retry details only from the next retry event (activity/snapshot protos don't carry the list). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 tasks
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.
概述
将 LLM 流式请求的重试层与 codex 对齐(6 次总尝试 = 5 次重试,
200ms * 2^(n-1) * uniform(0.9, 1.1)无上限退避),并在桌面端与 WebUI 双端的模型回复区提供可展开/折叠的"重试详情"块,逐条展示每一轮重试的报错内容。桌面端(agent-gui)
streamRetry.ts:codex 式退避;onRetry回调新增第三参errorMessage;onRetryRecovered在重试后的尝试产出首个内容事件时触发liveTranscriptStore/useLiveTranscriptController:新增retryAttempts实时状态,复用与toolStatus相同的逐帧合并 flushagentRunner/runTextConversationTurn:两种聊天模式各自维护按网络尝试粒度的累积器(每次新尝试开始时清空)RetryDetailsBlock(仿ThinkingBlock的折叠交互):渲染在活跃 live 轮次内,以及"尚无内容"的兜底行(文本模式重试最常见的场景)WebUI(agent-gateway/web)
tool_status事件新增的可选retryAttempts字段上(Rust 信封白名单放行;Go 网关本就对 data JSON 做通用透传,无 proto / Go 改动);语义:字段缺失/null = 列表不变,空数组 = 清空transcriptStore镜像该列表,run 边界(run_started / run_finished / reset)自动清零GatewayTranscript在等待气泡与 live 回复行两处(互斥)渲染镜像的RetryDetailsBlock,i18n 文案与桌面端一致测试与验证
tsc --noEmit干净;cargo check通过;scripts/check-mirror.mjs87 文件字节镜像校验通过需要评审者知晓
🤖 Generated with Claude Code