chore: 修复切换cli时,还会唤起历史cli的问题 - #346
Merged
deepcoldy merged 2 commits intoJul 3, 2026
Merged
Conversation
- sessionBotCliMismatch 增加 wrapperCli 比较(仅 agentFrozen 会话): 'aiden x claude' 与裸 claude-code 共享 cliId,二者互切同样是真实的 CLI 切换,旧 wrapper 会话不该在重启后被 lazy resume 复活;legacy 未 冻结会话下次 fork 会从 live bot 配置回填 wrapper,不参与该轴判定 - re-attach 循环里的第二处失配守卫改为直接复用 closeRestoredSessionIfCliMismatch:早期守卫已在注册前拦截,这里保留 belt-and-suspenders 但不再手工重复 log+kill+close 三件套 - 测试补 wrapper 轴三例:失配关闭 / 匹配保留 / legacy 回填保留
This was referenced Jul 3, 2026
deepcoldy
added a commit
that referenced
this pull request
Jul 3, 2026
#346 只堵了 daemon 重启路径;dashboard PUT /api/bot-agent 热改 cliId/wrapperCli 后,存量会话冻结的旧 CLI 仍会被下一条消息 lazy resume 复活。本 PR 在热切端点改完配置后立即清理该 bot 名下失配的活跃会话(复用 #346 同一失配判定,含 wrapper 轴),响应新增 closedMismatchedSessions 计数。 - 豁免口径与 restore 一致:queued(没起过 CLI)、adopt(外部用户 CLI,失配合法)、其他 bot 不动 - 预杀 backing pane 仅限 worker-less 记录(与 killWorker 语义对齐:!ds.worker || ds.worker.killed);活 worker 走 closeSession 的 close IPC 由 worker 侧优雅拆除,避免竞态(Codex review 发现并确认修复) - restore 私有 helper 更名 closeActiveSessionIfCliMismatch,日志措辞中性化 - 测试:runtime sweep ×5(含 live worker 不预杀)+ 原 restore 用例,16/16;dashboard-ipc 51/51 Codex 独立二审:初审 blocking(活 worker 预杀竞态)→ 修复后增量复核通过。
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.
No description provided.