anthropics / anthropics/claude-agent-sdk-python

Intermittent timeouts in the SDK

未关闭
#533 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
8.1k
派生
1.3k
平均合并
2 天 31 分钟
30 天内合并 PR
1

描述

We're experiencing an issue with the Claude Agent SDK where some streaming requests are intermittently timing out after 10 minutes. While the workflows do eventually complete, they take significantly longer than they should because each timeout blocks the request for 10 minutes before retrying. The same workflows complete much faster when using Claude Code CLI, which suggests this is specific to the Agent SDK. (Both are using the same backend APIs via our gateway).

Based on our initial investigation, the requests that timeout does not seem to reach our server - we see no logs for these failed requests. This could be due to requests getting stuck at the SDK/client level before being transmitted. We're continuing to investigate on our end for any other issues, but this appears to be SDK-specific.

We need help from Anthropic to investigate why the Agent SDK behaves differently than Claude Code for streaming requests. While we investigate, we'd also like to check if there's a way to configure the SDK timeout to less than 10 minutes. This would allow stuck requests to fail and retry faster, reducing the overall workflow duration.

```
[CLI DEBUG] [Anthropic SDK INFO] [log_db4a4b] connection timed out - error; no more retries left
[CLI DEBUG] [Anthropic SDK DEBUG] [log_db4a4b] connection timed out (error; no more retries left) {
url: ".../llm/v1/messages?beta=true",
durationMs: 879855,
message: "The operation was aborted.",
}
[CLI DEBUG] 2026-01-29T13:04:39.945Z [ERROR] Error streaming, falling back to non-streaming mode: Request timed out.
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。