Skip to content

refactor(account): centralize account runtime ownership - #2173

Open
zvzuola wants to merge 1 commit into
GCWing:mainfrom
zvzuola:refact-account
Open

refactor(account): centralize account runtime ownership#2173
zvzuola wants to merge 1 commit into
GCWing:mainfrom
zvzuola:refact-account

Conversation

@zvzuola

@zvzuola zvzuola commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #

Type and Areas

Type:

Areas:

Motivation / Impact

Verification

Reviewer Notes

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@GCWing
GCWing requested a review from bobleer August 9, 2026 09:33

@limityan limityan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

总体结论:Approve。

本次重构在 CLI / Embedded 范围内完成了账户运行时所有权收敛:CliRuntimeContext 只构造一个共享 Arc<AccountRuntime>,Embedded App Server、Peer Host、启动恢复和 settings-sync loop 使用同一实例;Shared 路径没有创建本地账户 owner,并继续对 Account / Sync / Worktree 能力 fail closed。未发现需要阻止该重构方向的 P0/P1 问题。

本地 exact-head 验证已通过:

  • git diff --check
  • Core no-default-features 与 agent-runtime checks
  • AccountRuntime 聚焦测试(4 passed)
  • App Server 测试(43 passed)
  • CLI product assembly 合同测试(15 passed)
  • pnpm run check:core-boundaries

建议后续补充但不阻塞本次批准:

  1. AccountLoginResult::routing_owner_replaced 已保留 daemon owner 被替换的事实,但 App Server 的登录状态消息没有投影该字段。建议恢复“旧 daemon 已停止、需重启 daemon 才能恢复 always-on routing”的提示。
  2. 建议恢复迁移前覆盖 daemon retirement、pending replacement、token revoke、并发候选登录和 routing lease 的关键行为等价性测试。
  3. Settings sync 的 upload / fetch / apply 路径建议恢复分阶段错误上下文。

合并门禁:当前 exact-head 的 CLI Tests (macos-15) 仍失败,失败点是本 PR 未修改的 dispatch cancellation timing test。请先定位/处理该问题并确认 required checks 全绿,再合并。

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.

2 participants