OpenAI Agents SDK client_session_timeout_seconds with Sume jobs_wait

In the OpenAI Agents SDK for Python, client_session_timeout_seconds sets the MCP read timeout. Set it above Sume's 55-second jobs_wait cap, or 0 to disable it.

5 min readSume
All posts

The OpenAI Agents SDK for Python connects to MCP servers through classes such as MCPServerStreamableHttp. The SDK's MCP page says client_session_timeout_seconds sets the client session timeout: a positive value is a finite timeout, and None or 0 disables it, read 2026-10-03. Sume's jobs_wait can hold a call for up to 55 seconds, so the number you pick decides whether a long wait succeeds.

Pick a number against the hold

The Sume tools and gates page says jobs_wait holds 50 seconds by default and 55 at most; larger requests are clamped and the response carries wait_slice_clamped. A client timeout shorter than the hold turns a normal wait into an error even though the job is fine. Set it above 55 seconds, or leave it off and rely on your own outer deadline.

Timeout choices against a 55-second hold, read 2026-10-03.
SettingResult with `jobs_wait`Note
Positive, under 50Default waits can time out client-sidePass a shorter wait instead
Positive, 70Covers the 55-second capA good default
None or 0No client limitAdd your own deadline
import asyncio, os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp

async def main() -> None:
    key = os.environ["SUME_API_KEY"]
    async with MCPServerStreamableHttp(
        name="sume",
        params={
            "url": "https://mcp.sume.com/mcp",
            "headers": {"Authorization": f"Bearer {key}"},
        },
        client_session_timeout_seconds=70,
        cache_tools_list=True,
    ) as server:
        agent = Agent(name="Reader", mcp_servers=[server],
                      instructions="Read job status with Sume tools.")
        r = await Runner.run(agent, "Wait on job abc and report.")
        print(r.final_output)

asyncio.run(main())

What a timeout means

A client-side timeout is a transport failure, not a job outcome. The Sume jobs guide says a client timeout does not cancel the job and it keeps billing. When Sume answers wait_slice_expired, call the wait again with the same job ids. Never resubmit the paid create, which would start a second job unless the idempotency_key repeats.

The code uses a read-only agent on purpose. Give an agent the create tools only when its task needs them.

Checklist

  • Set the timeout above 55 seconds, or disable it and keep a deadline of your own.
  • Persist job ids before waiting.
  • Use wait_for of all or any with up to 20 ids.
  • Treat 524, 522, 523 and 525 as transport failures.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume