Repository navigation
Closed
Labels
complexity-lowComplexity: low (board points 1-3)priority-p2Importanttheme-channelsTheme: Channelstype-bugBug fix
Description
Summary
The MCP chat_with_agent tool declares an optional execution_id argument and documents it as the way a delegated task "inherits the channel/thread this request came from and its completion is reported back there". The tool's execute function never reads that argument, so it never reaches runAgentChat, and the parallel /task request goes out without parent_execution_id. The backend inherits a parent's channel context only from parent_execution_id (chat_execution_service._inherited_channel_context). A delegation made through chat_with_agent therefore never carries the caller's Slack/Telegram thread, and its completion is never reported there — the exact failure ent#224 was built to fix.
Context
src/mcp-server/src/tools/chat.ts:execution_idis in thechat_with_agentzod schema, andRunAgentChatParams.execution_idis sent asparent_execution_idon the parallel/taskcall. But thechatWithAgent.executedestructuring and itsrunAgentChat(...)call omit it. It has been unwired since ent#224 shipped (commit6c1e3827b).- Only the
parallel=truebranch sendsparent_execution_id. The sequential/chatbranch and the experiment: pull-coordination pilot — route MCP chat_with_agent through the agent queue #946 pull-routed/taskbranch send none, so forwarding the argument alone would not cover those modes. - The dedicated
chat_with_<agent>tools (feat: per-agent MCP exposure flag — dynamic dedicated tool per exposed agent #846,src/mcp-server/src/tools/dynamic-agents.ts) do not declare the argument at all. - The platform already knows the caller's turn (feat(pull): platform-injected execution id for the side-effect guard — Tier-6 T6.3, blocks default-ON for side-effect agents #2392, the
X-Trinity-Execution-Idheader). The gated-skill requester already prefers it overparent_execution_id(chat_execution_service.py, thex_trinity_execution_id or request.parent_execution_idfallback); channel inheritance does not read it. - Found while reviewing abilityai/trinity-enterprise#568 (the delegation contract). Not fixed there: forwarding it is a behaviour change — report-back starts firing into channels, behind the ent#265 provenance guard — and needs its own review.
Acceptance Criteria
- A
chat_with_agent(parallel=true)call made withexecution_idsends it asparent_execution_id— proven through the real toolexecute, notrunAgentChatalone - Decide and document whether the sequential and pull-routed branches carry the parent too, and whether the platform-known caller turn (feat(pull): platform-injected execution id for the side-effect guard — Tier-6 T6.3, blocks default-ON for side-effect agents #2392) should be the source rather than a model-typed argument
- Dedicated
chat_with_<agent>tools accept the same argument, or the description says why not - The
execution_iddescription promises only what the code does
Technical Notes
_inherited_channel_contextrefuses inheritance unless the caller owns the parent context (ent#265 provenance guard). Keep it the only gate.- Related: abilityai/trinity-enterprise#568, which rewrites the same tool description.
Metadata
Metadata
Assignees
Labels
complexity-lowComplexity: low (board points 1-3)priority-p2Importanttheme-channelsTheme: Channelstype-bugBug fix
Activity
feat(delegation): every caller is taught that a receipt means running…
fix(mcp): chat_with_agent carries the caller's turn so delegated work…
Release: v1.0.0 (#3853)
fix(mcp): an identical delegation from a later turn is a new delegati…