feat(conversation): side conversation fork API#383
Open
taekchef wants to merge 4 commits into
Open
Conversation
Expose POST /api/conversations/:id/side to fork ephemeral side threads with hidden guardrail context, optional initial prompt, and cascade delete of ephemeral children when the parent is removed.
This was referenced Jun 1, 2026
9e5c92e to
0a5aa4e
Compare
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.
Summary
新增侧边会话 fork API —— 从主会话中分叉子会话的后端原语,支持多个侧边子会话和双 fork 策略。
改了什么
POST /api/conversations/{id}/side— 每次调用创建一个新的侧边子会话guardrail?(guardrail 文本)、initial_prompt?(首条用户消息)、forked_at_msg_id?(分叉点消息 ID)conversation_id、created: true、fork_mode(由服务端根据 agent 能力自动决定)GET /api/conversations/{id}/side— 列出主会话下已有的侧边子会话,供前端刷新后恢复 Tabparent_conversation_id、side_mode、fork_mode关联,不再复用旧的单一side_conversation_id字段。一个主对话可以挂多个独立的侧边子会话claude/opencode/vibe(ACP backend)→agent_fork,产品展示为“会话分叉”codex(ACP backend)/aionrs/ 其他未声明session/fork的 ACP backend →text_snapshot,产品展示为“摘要模式”geminilegacy type 不展示侧边入口;后端对非 ACP / Aionrs 父会话直接拒绝fork_mode):保留 per-turn enrich 路径API 示例
文件变更(18 files, +839 −16)
aionui-ai-agent— 暴露 ACP session fork 能力、父会话 warmup、fork_parent_session_id传入子会话aionui-api-types— 请求/响应类型、SideForkMode枚举、agent build extra 的 fork 字段aionui-conversation— POST/GET/side路由、多 side child 创建/恢复、fork 策略选择、snapshot 注入、legacy enrich 兼容aionui-db— 新增list_side_children查询,按parent_conversation_id/side_mode恢复侧边子会话Test plan
cargo check -p aionui-conversation -p aionui-api-typescargo build -p aionui-appfork_mode→ 列出 side children → 删除 parent → 验证级联删除fork_mode)仍走 per-turn enrich 路径配合 AionUI 前端 PR:iOfficeAI/AionUi#3196