Skip to content

p=bug: composable poe-code/agent ignores MCP server timeout for long-running tool calls #361

@kamilio

Description

@kamilio

Summary

The composable runtime exported from poe-code/agent accepts McpServerConfig.timeout, but long-running MCP tool calls still time out at the default JSON-RPC request timeout (approximately 30 seconds). This prevents tools that intentionally wait for human input (for example, Slack approval/reaction polling) from using the documented server timeout configuration.

Reproduction

import { agent, openaiResponsesPlugin, systemPromptPlugin } from "poe-code/agent";

await agent()
  .model("gpt-5.5")
  .use(openaiResponsesPlugin())
  .use(systemPromptPlugin())
  .mcp({
    name: "approval_tools",
    command: "bun",
    args: ["./src/mcp.ts"],
    timeout: 3_600_000,
  })
  .run("Call the MCP tool that waits for a Slack approval reaction.");

If the MCP tool takes more than ~30 seconds before returning, the request times out even though timeout: 3_600_000 was supplied.

Investigation

In the published composable runtime implementation, the MCP configuration is cloned/stored, but PluginApiImpl.#setupMcp() constructs new McpClient({ clientInfo: DEFAULT_MCP_CLIENT_INFO }) without forwarding config.timeout to the MCP client's request timeout. Runtime tool calls then invoke client.callTool(...) with only the abort signal.

By comparison, spawn-time MCP serialization forwards server.timeout into the supported agent configurations.

Expected behavior

agent().mcp({ ..., timeout }) should apply that timeout to MCP discovery/tool calls, consistent with the exposed McpServerConfig type and spawn-time MCP handling.

Impact

Blocks composable agent integrations from implementing long-running approval/confirmation tools without custom short-poll workarounds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions