fix(subagents): 子会话与普通会话一样长期保存,修复后台任务面板打开子会话 404 - #99
Merged
Merged
Conversation
- 后台任务面板查看子会话时带上父会话所在工作区。Desktop 的 daemon 同时服务多个 工作区,子会话不在内存里(网状 agent 被换出、Desktop 重启后)时只按 daemon 自己的 cwd 找,返回 404 SESSION_NOT_FOUND,子会话的通信内容看不到。 - 面板「清除」改为「归档」,TUI /tasks clear 同语义:只把已结束任务收起 (卸载 + meta.archived),记录保留;归档的子会话也不进「已归档会话」列表。 - 永久删除已归档主会话时级联删除它的全部子会话(含只在内存里的),子会话在前、 主会话最后;任一子会话运行中返回 409。 - TUI 退出清理只按主会话计 max_sessions,被清理的主会话连同子会话一起删除; 父会话已不在的孤儿子会话按主会话计。 - 网状 agent 被归档后再次被寻址时自动取消归档,重新出现在面板里。
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.
背景
/tasks clear都是直接永久删除。改动
SubagentPanel/useSubagentTasks/ChatView),daemon 能去对应工作区读盘。/tasks clear同语义:卸载 +meta.archived=true,从面板收起,记录保留;归档的子会话也不进「已归档会话」列表。purge_session_data,含还没落盘、只在内存里的),子会话在前、主会话最后,中途失败主会话仍在可重试;任一子会话运行中返回 409。max_sessions,被清理的主会话连同子会话一起删;父会话已不在的孤儿子会话按主会话计,否则永远清不掉。purgeTask;文档(CLAUDE.md、docs/subagents.md、docs/daemon-api.md、帮助页)同步。验证
WebServerHttp.PurgingArchivedMainSessionCascadesToItsSubagents、SessionCleanup.*(2 条)、SubagentHost.ListMergesAndClearOnlyArchivesSettled、MeshAgentServiceTest.ArchivedAgentIsUnarchivedWhenAddressedAgain、前端subagentPanelSplitArchitecture.test.js两条。run_fast_tests.py --profile fast4939 执行 0 失败;pnpm test全过、pnpm build成功;分层与所有权闸门通过。builtin_commands.cpp行数 2077 超 R12 基线 2060 是 master(329faf9)上已有的情况,本 PR 未改变它的行数。