fix(desktop): reset goal controller on account switch (#3117) - #3298
Conversation
Signed-off-by: nothingyuancando <1579035512@qq.com>
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/bootstrap-electron.ts | Awaits goal-controller reset before outgoing Maker shutdown while preserving non-fatal teardown logging. |
| apps/desktop/src/main/goal-host/controller.ts | Extends startup restoration fences to stop when disposal has begun, preventing old-account runtime state from being recreated. |
| apps/desktop/src/main/goal-host/tests/controller.test.ts | Covers disposal races at both active-goal list and per-goal lookup await boundaries. |
| apps/desktop/src/main/maker-host/tests/accountProviderReadinessWiring.test.ts | Verifies that both controller reset calls occur before outgoing Maker shutdown. |
Sequence Diagram
sequenceDiagram
participant A as Account boundary
participant G as GoalController
participant M as Outgoing Maker
participant N as New account runtime
A->>G: resetGoalController()
G->>G: Mark disposing and detach runtime state
G-->>A: Persistence teardown settled
A->>M: shutdown(account-boundary)
M-->>A: Outgoing runtime stopped
A->>N: Start account-scoped services
Reviews (3): Last reviewed commit: "fix(desktop): await recreated goal teard..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 634f6f4e81
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
这条 PR 触发了维护者确认(产品)。 标题/正文只覆盖账号切换时复位 GoalController,但 diff 还改了输入区状态条:本机 Workflow 运行时会显示新的等待文案和进度,并藏掉耗时。这是用户看得见的交互,需要维护者确认产品方向。 确认方式:直接在本 PR 上 Approve。需要修改就 Request Changes,作者改完后再 Approve 即放行。 讨论 issue:#3300 |
|
@nothingyuancando 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/main/bootstrap-electron.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
命中 UI 路径(apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范。缺证据不阻断合并。 |
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
On behalf of nothingyuancando <1579035512@qq.com>, I, Dash <125997726+dashhuang@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 634f6f4 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a23c7cae0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
MagicLizi
left a comment
There was a problem hiding this comment.
格式门未通过(P1)
.github/PULL_REQUEST_TEMPLATE.md: Description 缺段落「这次改了什么」「怎么验证的」「风险」。当前描述是自由格式说明,请改成仓库 PR 模板对应段落后再推一次。
本次只拦模板完整性,未进入代码审查。
这些问题已在当前 head 的后续 commit 中修复(格式门/安全门已通过),自动 dismiss 旧的 CHANGES_REQUESTED 以解除合并阻塞。
|
合了。切账号时 GoalController 会先拆掉,旧账号的目标不会再往新会话里跑。 |
这次改了什么
摘要
账号退出或切换时,先复位并等待 GoalController 完成清理,再关闭旧账号的 Maker,避免新的账号会话继续使用旧的、正在退出的 Maker。同步收紧控制器销毁期间的状态恢复,防止旧账号运行时状态被重新创建。
变更类型
fix缺陷修复feat新功能refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
UI 变化
涉及输入区状态条的文案和进度展示,未改变布局或交互结构。
怎么验证的
自动验证
同时覆盖 GoalController 销毁期间 active-goal 列表和单目标查询的竞态测试。
手工验证
不涉及;改动通过账号提供方生命周期和 GoalController 单元测试验证。
未执行的验证
无。
风险
风险分类
影响与回滚
提交前检查
git commit -s,见 DCO)