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.

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.
| Setting | Result with `jobs_wait` | Note |
|---|---|---|
| Positive, under 50 | Default waits can time out client-side | Pass a shorter wait instead |
| Positive, 70 | Covers the 55-second cap | A good default |
None or 0 | No client limit | Add 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_forofalloranywith up to 20 ids. - Treat 524, 522, 523 and 525 as transport failures.
Sources
Related posts
More in Developers
- Move OpenAI GPT Image 2.5 calls to Sume: field-by-field mapping
Which OpenAI gpt-image-2.5 parameters carry over to Sume's POST /v1/images, which change name, and which return 400 unsupported_parameter.
- OpenAI transcription 25 MB limit: how many minutes of wav fit?
OpenAI caps transcription uploads at 25 MB. A 16 kHz mono wav fills that in about 13 minutes, so detach long videos to mp3 or ranges first.
- openapi-typescript on the Sume OpenAPI JSON: types only, one command
npx openapi-typescript takes a URL or file and writes a .d.ts. Generate Sume job and error types from the 3.0.3 spec with no runtime code in your bundle.
- Orval react-query client from the Sume OpenAPI JSON, tags-split
Point Orval at api.sume.com/reference/json with client react-query and mode tags-split for typed hooks per Sume tag. Config, caveats and polling tips.
Written by Sume