Skip to content

fix(chat): 防止系统通知后子代理被错误显示为已停止 - #2197

Merged
vastsa merged 7 commits into
vastsa:mainfrom
yg2224:fix/live-delegation-system-rows-1990
Nov 9, 2026
Merged

vastsa merged 7 commits into
vastsa:mainfrom
yg2224:fix/live-delegation-system-rows-1990

Conversation

@yg2224

@yg2224 yg2224 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

运行中的 Task 后出现系统通知时,collectLiveDelegationEntries 在重建会话时把系统通知当作回合结束,导致 Task 被推断为 aborted,即使后台子代理仍在运行。

系统通知现在和 steering 消息一样保留当前回合的子代理状态,与现有 liveHistoryTurnId 边界一致。普通新用户提示及已结束会话仍隔离历史工作。

验证:旧代码重建回归显示 aborted,修复后显示 running;共 30 项状态、回合与渲染标签测试通过。Desktop TypeScript 检查通过。scripts/e2e-transcript-render.mjs 完整通过,包括新建 Chromium 回归:切离/重建、平滑流式显示和聊天内可视化的 4 种组合均保留运行状态。复用主检出兼容样式产物,当前分支构建运行时依赖。基线 f69299570ab9。

Refs #1990。这是已确认的系统通知边界缺陷,不声称覆盖该 issue 的所有性能、后台进程和设置相关反馈。

2026-11-09 基线同步:非破坏性合并最新 main@345f6f0e193f,候选 2eaec71。冲突只涉及双方在同一位置新增的文档段落,已完整保留。同步后子代理、回合及 Git deadline 共 31 项回归通过,Desktop TypeScript 和完整 Chromium transcript E2E 通过。 最新 head 的 CI 重新运行。

2026-11-09 最终集成验证:head 2c61e1e 包含最新 main@b9028c3c79fe。四份文档冲突保留双方场景,没有修改子代理 selector。新版依赖产物按 task-local workspace 连接构建,复用主检出外部依赖;最初因旧 shared 缺 normalizeBuiltinMode 和未构建 voice-runtime/live 中止,补建后重跑。当前候选 30/30 状态/回合/SSR 回归、Desktop TypeScript、完整 Chromium transcript-render(含系统通知重建的 4 种设置组合及 history-loading)通过。diff 和 PR base 检查通过,普通推送,无 force-push。新 head CI 待完成;未合并或发布。

系统通知属于当前运行回合,重建时不应作为新提示截断运行子代理选择。与回合状态选择保持相同边界,避免导航后错误显示已停止,普通新提示仍隔离历史工作。

Refs vastsa#1990
Copilot AI balanced review requested due to automatic review settings November 8, 2026 15:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

普通系统通知不会关闭运行回合,真实重启后 running 为 false 才隔离历史工作。补齐旧回归对该边界的覆盖,避免与生产回合状态规则冲突。
文件管理器修复已由维护者合入主线。使用非破坏性合并保留双方规格和回归场景,使本 PR 包含最新基线并消除文档冲突,不改写已共享提交。
@vastsa

vastsa commented Nov 8, 2026

Copy link
Copy Markdown
Owner

独立对照确认系统通知边界缺陷真实存在:保留新增回归,仅将生产 selector 换回最新 main,Task 结果为 aborted 而非 running;恢复候选后通过。

已在独立工作树非破坏性集成最新 main 6c81b7f29,本地候选 f9938ad27。冲突仅涉及四份文档的追加段落,双方内容均保留。运行系统通知重建及 turn-process 回归共 29/29 通过,i18n/shared TypeScript 构建及 diff-check 通过。

暂未批准或推送集成:完整渲染测试仍缺本地 plugin-sdk 构建产物,Chromium E2E 未启动(复用环境的 Electron binary 缺失)。这些属于本地环境限制,尚不能判为 PR 回归;原 head 六项 CI 成功,但不能代替最新集成候选的验证。后续补齐兼容产物与真实渲染验证后再推进。

@aiuo-codepilot aiuo-codepilot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AIUO CodePilot · Preliminary review

Diff-only preliminary review of the system-notice live-delegation boundary fix. The source change consistently skips system messages before the steering/user boundary, and tests plus spec/E2E text align with that behavior. I could not run the referenced tests, TypeScript checks, or Chromium E2E, and cannot verify the merge/CI claims.

No evidenced findings in the supplied diff.

Head: 2eaec71
Base: 345f6f0
CI: success; mergeable: false.

Validation: code/tests NOT EXECUTED. Diff-only preliminary analysis; not approval. Human review and repository gates remain required.

保留原分支历史并整合已合入的 macOS 发布修复,为继续同步最新主线建立完整合并记录。
主线已合入截图粘贴及 steering 修复,保留双方新增规格和测试场景,清除独立子代理修复 PR 的文档冲突,不改写共享分支历史。
保留主线新增的 Goal 能力与本 PR 子代理状态修复,采用普通合并保证已共享历史不变。

@aiuo-codepilot aiuo-codepilot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AIUO CodePilot · Preliminary review

Diff-only preliminary review: the fix in `live-delegation-entries.ts` skips system-role message rows so a running Task behind a system notice keeps its live-delegations state, while ordinary user prompts still terminate reconstruction; the updated tests and E2E scenario are consistent with that change. I found no evidenced correctness regression in the added lines. This is a diff-only preliminary review: tests, TypeScript checks, E2E runs, and the claimed passing statuses could not be executed or verified here, and only the supplied patches (not the full surrounding implementations, `collectDelegationStatuses`, `subagentOutcome`, `TranscriptHistory`, or runtime behavior) were available for inspection.

No evidenced findings in the supplied diff.

Head: 2c61e1e
Base: b9028c3
CI: pending; mergeable: true.

Validation: code/tests NOT EXECUTED. Diff-only preliminary analysis; not approval. Human review and repository gates remain required.

@vastsa

vastsa commented Nov 9, 2026

Copy link
Copy Markdown
Owner

已跟进作者最新提交,并从作者 head 重新建立独立工作树,非破坏性整合最新 main 3169c219d 为 d13a46926,普通推送完成,未改变修复逻辑。原有本地集成文档有分歧,因此未覆盖作者分支。

独立验证:系统通知/steering/turn-process 回归 30/30;Desktop typecheck、依赖及 Desktop 构建、完整 Chromium transcript-render E2E(含系统通知子代理卡片与历史加载七场景)、diff-check 全部通过。此前 main 对照已复现 running 被错误判断为 aborted,当前最小 selector 修复保留普通用户消息边界。复用依赖的初始产物缺失已通过候选源码构建解决,未修改主工作区依赖。

新 head CI 尚待完成,暂未批准或合入;待检查新 CI、最新 main 与实际 merge-ref 后推进。未执行真实 provider 或本机 Windows UI 测试。

@aiuo-codepilot aiuo-codepilot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AIUO CodePilot · Preliminary review

Diff-only preliminary review of the system-notice delegation-live fix. The core predicate change and added unit/E2E probes look internally consistent with the stated `liveHistoryTurnId` boundary. One test intent/verification mismatch is reported: the new unit test’s non-live assertion passes a system notice as the live turn with `true`, while the established boundary test uses `false`, so it does not demonstrate that the notice itself is treated as live; the expected live case is the preceding turn’s identity. Additional limitations: no repository execution, tests, or full-file context were available.

  • low apps/desktop/test/send\-now\-subagent\-rendering\.test\.mjs:56: The restored `true` assertion now checks that a system notice does not clear a live task, but the companion check named as the restart/ended case passes the notice as `entries.at(-1)` with `false`. The PR description claims system notices preserve the current turn live state "与现有 liveHistoryTurnId 边界一致"; the test does not assert `live.has("task") === true` when the notice is the current live turn and history excludes it, which is the arrangement used in `live-delegation-system-row.test.mjs`. As added, this regression would still pass if `collectLiveDelegationEntries` returned an empty set for history when `entries.at(-1)` is a system notice and `true`, because both `true` cases here prepend the notice to `entries` instead of using `entries.slice(0, -1)`. Verify the live-turn boundary explicitly before relying on this test as coverage for that invariant.
    Evidence: assert\.equal\(collectLiveDelegationEntries\(entries, \{ kind: "message", message: message\("restart", "system", "Restart"\) \}, false\)\.has\("task"\), false\);

Head: d13a469
Base: 3169c21
CI: pending; mergeable: true.

Validation: code/tests NOT EXECUTED. Diff-only preliminary analysis; not approval. Human review and repository gates remain required.

vastsa commented Nov 9, 2026

Copy link
Copy Markdown
Owner

本轮检查 head 仍为 d13a46926226d5493ff8252004f1c354f4b0f1e7,main 仍为 3169c219d。五项远端检查成功;Trusted extensions Electron E2E 失败于安装 Electron:GitHub releases 下载返回 HTTP 504,尚未执行测试,不能作为代码回归证据。我已重跑失败任务(run 42584032271),保持原有检查要求,待重跑成功并再次核对主干与实际合并候选后再批准合入。此前独立集成验证 30/30、桌面类型检查/构建和完整 transcript-render E2E 证据仍适用于此 head。

@vastsa vastsa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

独立审查完成:此前 main 对照已复现系统通知导致运行中 Task 被错误显示为 aborted;本次最小 selector 修复保留普通用户消息边界。既有集成验证 30/30、Desktop typecheck/build、完整 Chromium transcript-render E2E(含历史加载七场景)通过;本轮补跑 system-row + send-now 三项回归全部通过。自动审查提出的 live-turn 边界由 live-delegation-system-row.test.mjs 第一项明确覆盖:history=entries.slice(0,-1)、current=system row、running=true,最终 outcome=running;false 则 aborted。六项远端 CI 全部成功,Electron 下载超时重跑已恢复。最新 main 3169c21、head d13a469 未变,实际 merge-ref 32bc73b 的 tree 9013c69f9 与已验证候选完全一致。未执行真实 provider 或本机 Windows UI。批准合入。

@vastsa
vastsa merged commit f23440c into vastsa:main Nov 9, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants