Skip to content

Let Subagents call function and MCP tools - #780

Merged
SaladDay merged 7 commits into
mainfrom
let-subagents-call-function-and-mcp-tools
Oct 19, 2026
Merged

SaladDay merged 7 commits into
mainfrom
let-subagents-call-function-and-mcp-tools

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Codex and MiniMax Code Subagents now use the Agent's function and MCP tools, as they do in a local run.

Behavior. This is unspecified official behavior, recorded in OpenAI compatibility.

  • A child's function call goes to the client like a root call. It becomes a required action of the root Turn that runs the child: turn_id is that root Turn, and the Session is requires_action.
  • The call's call_id equals the call_id of the child's function_call Item on the Subagent routes. The client answers with tool_result under the root Turn. An answer that names the child Turn gets the existing 400.
  • Child MCP calls are mcp_call Items in the child's history.

Changes.

  • Core–Runtime wire. function_call gains native_id and turn_id, which are set only for a child call. proto.Version becomes 0.19.0, and Core–Runtime protocol is updated.
  • Core. RecordFunctionCall resolves the visible child and derives the call_id the same way as the child's function Item. A hidden child or an invalid native Turn ID gives ErrInvalidInput. Nothing else changes in admission, required actions or result delivery.
  • Codex adapter.
    • Accepts tool calls from child threads.
    • Holds a child call until the child's subagent_turn fact has been sent.
    • Matches child receipts by thread and Turn.
    • While Subagents run, the root's completion stops only root calls.
  • Admission. The RejectSubagentTools calls are gone from the Codex and MiniMax Code declarations. MiniMax Code's declaration then had no configuration rule left, so its ValidateConfiguration is deleted. Claude Code keeps its rejection until its adapter change.
  • Rejections that stay, each for its own declared reason:
    • Codex programmatic tool calling with multi_agent;
    • MiniMax Code public functions.

Docs: runtime-protocol, execution-tools, subagents, harness-capabilities and index.md, with zh mirrors.

Operator action for the release notes: apply the release's Runtime with Core. An older Runtime fails the version check (426).

Checks.

  • go vet ./... in all modules.
  • go test for sessions, execution, harnessconfig, agentdaemon, the codex adapter (plus -race on the Function and Subagent tests) and the mcode adapter.
  • The new integration test TestExecutionSubagentFunctionCallIsARequiredActionOfTheRootTurn and the Subagent/Function integration set, against a local PostgreSQL.
  • The translation test.
  • Live Codex runs on environment: none with MiniMax-M2.7:
    • a forked Subagent called a function, the client answered, and the child used the answer;
    • a Subagent called a service-origin MCP tool, and the call was observed as a child mcp item.
  • Not live-verified: Codex on workspace placements, and MiniMax Code. The docs say "admitted" for these.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@SaladDay
SaladDay force-pushed the let-subagents-call-function-and-mcp-tools branch 2 times, most recently from 7b621a9 to 1a1b706 Compare October 19, 2026 18:20
@SaladDay
SaladDay merged commit 4055180 into main Oct 19, 2026
25 checks passed
@SaladDay
SaladDay deleted the let-subagents-call-function-and-mcp-tools branch October 19, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant