Repository navigation
feat(acp): 支持父子会话多轮沟通与消息队列 - #1123
Open
leehom0123 wants to merge 5 commits into
Open
leehom0123 wants to merge 5 commits into
leehom0123 wants to merge 5 commits into
Conversation
Contributor
Author
|
@xintaofei 佬请审查 |
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.
动机
父会话委派任务后,经常需要继续补充要求、调整执行方向,或者根据子会话的结果安排下一轮工作。这些沟通应当发生在原子会话中,保留已有上下文,让父会话能够与多个子会话长期协作。
多轮沟通还需要区分处理时机:有些要求需要立即生效,有些可以等当前任务完成后再处理;尚未执行的要求,也可能需要修改或取消。因此,本次在现有委派机制上增加后续消息和队列管理。
功能变化
send_to_subsession,父会话通过child_conversation_id向原子会话发送后续消息。默认排队,当前轮结束后按顺序执行。manage_subsession_messages,支持查询消息状态和结果,以及修改、取消尚未执行的队列消息。实现与使用范围
本次沿用现有 ACP 会话、MCP 委派、共享业务逻辑和事件广播机制。后续消息必须续接原代理会话;续接失败时返回错误,不另建会话。
父代理通过 MCP 工具管理后续消息,本次不增加专用队列界面。首次委派结果仍由
get_delegation_status查询,后续消息及结果由manage_subsession_messages查询。子会话完成后,父代理在当前执行流程中主动读取结果,不会自动唤醒空闲父会话。验证结果