@@ -16,8 +16,13 @@ type RetryConfig struct {
1616 }
1717
1818 type Config struct {
19- APIKey string
20- BaseURL string
19+ APIKey string
20+ BaseURL string
21+ // Timeout sets http.Client.Timeout on the internal HTTP client.
22+ // Leave at 0 (the default) for streaming calls — http.Client.Timeout is a
23+ // total round-trip deadline that fires while the response body is still being
24+ // read, which breaks SSE streams that run longer than the timeout.
25+ // Use the request context to enforce deadlines on streaming calls instead.
2126 Timeout time.Duration
2227 UserAgent string
2328 HTTPClient *http.Client
@@ -35,10 +40,6 @@ func (c *Config) applyDefaults() error {
3540
3641 c.BaseURL = strings.TrimRight(c.BaseURL, "/")
3742
38- if c.Timeout == 0 {
39- c.Timeout = 60 * time.Second
40- }
41-
4243 if strings.TrimSpace(c.UserAgent) == "" {
4344 c.UserAgent = "go-opencode-zen-sdk/0.1"
4445 }