Repository navigation
Conversation
主代理本轮结束不再等同于整组工作完成;持续跟踪排队、准备、执行及结果回传中的子代理和后代。 - 后端统一提交 session_complete 与 completionId,页面提示和 Web Push 共用完成决定 - 保持主代理自身 isRunning 语义,子代理与主动停止继续静默 - 补齐最终回传后的重查、重连去重及后台侧栏恢复 - 覆盖嵌套代理、异常清理、空闲回收和状态持久化失败场景 Refs agegr#1434
tossp
pushed a commit
to tossp/tsgw-agent
that referenced
this pull request
Oct 28, 2026
对应 agegr#1437,解决 agegr#1434。保留独立上游贡献分支。
This branch has not been deployed
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.
关联议题
Fixes #1434
问题与复现
在
main的主会话中启动两个耗时不同的后台子代理,然后切换到其他标签页:主代理结束“已开始处理”等阶段性回复时,即使还有子代理运行,也可能发送完成通知;第一个子代理回报后主代理再次暂停,还可能重复宣布完成。子代理自身已静默,但原来的后端 Push 和页面提示分别根据主代理本轮结束判断,未覆盖整组代理及结果回传。
改动
completionId并发出session_complete,服务端 Web Push 和页面完成提示共用该决定。prompt_done、agent_settled继续负责原有 UI 阶段,不再单独触发完成提示。现有 SSE、状态读取和侧栏轮询使用完成 ID 恢复及去重,初次快照不重放历史。不改变主代理自身的
isRunning()定义、正常子代理调度、结果回传协议或 SDK,不新增依赖、设置或扩展 API。每个客户端观察者按完成 ID 去重,不引入跨标签页或跨浏览器的全局通知仲裁。会话名称兜底不在本 PR 范围内。验证
setpriv --bounding-set=-dac_override,-dac_read_search npm test去除 DAC 绕过能力,使权限测试按普通用户语义执行)。node_modules/.bin/tsc --noEmit:通过。npm run lint:通过。git diff --cached --check:通过。next build、未部署;未进行真实浏览器 Push 端到端验收。