fix(agent): 修复网络重试后停止卡死【已审核 PR】 - #1742
Open
Andreaseszhang wants to merge 1 commit into
Open
Conversation
Made-with: Proma
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.
概述
修复 Agent 在上游 Responses 流异常中断并进入自动重试后,用户点击停止可能导致停止按钮永久变灰、运行状态无法收敛的问题。此前 renderer 会锁定停止按钮并等待 STREAM_COMPLETE,但 utility runtime 可能只接受 abort 请求而未实际结束 query,导致 UI 和底层状态长期不一致。
改动
apps/electron/src/renderer/components/agent/AgentView.tsx— 停止期间继续禁止发送新消息以避免竞态,但允许重复下发幂等的停止请求;停止未确认时更新无障碍标签和提示。apps/electron/src/utility/agent-runtime.ts—QUERY_ABORT返回 query 是否在 5 秒内真正完成。apps/electron/src/main/lib/adapters/pi-utility-adapter.ts— abort 超时或 RPC 失败时失败当前事件队列并关闭卡住的 utility runtime,使 orchestrator 能走既有终态收尾。apps/electron/package.json— patch 版本从0.17.42升至0.17.43。测试方法
bun run --filter=@proma/electron typecheckbun run --filter=@proma/electron build:mainbun run --filter=@proma/electron build:agent-runtimebun run --filter=@proma/electron build:renderer备注
Made with Proma · GitHub