Skip to content

reduce maxIdleConnection to 30 seconds to avoid ttl mismatch#1645

Merged
akshaydeo merged 1 commit intomainfrom
02-14-reduce_maxidleconnection_to_30_seconds_to_avoid_ttl_mismatch
Feb 13, 2026
Merged

reduce maxIdleConnection to 30 seconds to avoid ttl mismatch#1645
akshaydeo merged 1 commit intomainfrom
02-14-reduce_maxidleconnection_to_30_seconds_to_avoid_ttl_mismatch

Conversation

@akshaydeo
Copy link
Contributor

@akshaydeo akshaydeo commented Feb 13, 2026

Summary

Reduce MaxIdleConnDuration from 60/120 seconds to 30 seconds across all providers to improve connection management and resource utilization.

Changes

  • Reduced the default MaxIdleConnDuration in DefaultClientConfig from 120 seconds to 30 seconds
  • Standardized MaxIdleConnDuration to 30 seconds (down from 60 seconds) across all providers:
    • Anthropic, Azure, Cerebras, Cohere, Elevenlabs, Gemini, Groq, HuggingFace
    • Mistral, Nebius, Ollama, OpenAI, OpenRouter, Parasail, Perplexity
    • Replicate, SGL, Vertex, XAI
  • Updated provider documentation examples to reflect the new value

Type of change

  • Refactor
  • Performance

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Docs

How to test

# Core/Transports
go version
go test ./...

Breaking changes

  • No

Security considerations

This change may improve resource utilization by releasing idle connections more quickly, potentially reducing memory usage and improving connection pool efficiency.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Performance Improvements

    • Optimized HTTP idle connection management by reducing timeout duration from 60 to 30 seconds across all provider integrations and core network configuration, improving resource efficiency and connection reuse patterns.
  • Documentation

    • Updated provider integration documentation to reflect revised idle connection timeout settings.

Walkthrough

This pull request standardizes HTTP client idle connection durations across the codebase. The default MaxIdleConnDuration is reduced to 30 seconds in the base HTTP configuration and all provider implementations, while documentation is updated to reflect the new standard timeout value.

Changes

Cohort / File(s) Summary
Network Configuration
core/network/http.go
Reduced default MaxIdleConnDuration from 120 seconds to 30 seconds in DefaultClientConfig.
Provider HTTP Clients
core/providers/anthropic/anthropic.go, core/providers/azure/azure.go, core/providers/cerebras/cerebras.go, core/providers/cohere/cohere.go, core/providers/elevenlabs/elevenlabs.go, core/providers/gemini/gemini.go, core/providers/groq/groq.go, core/providers/huggingface/huggingface.go, core/providers/mistral/mistral.go, core/providers/nebius/nebius.go, core/providers/ollama/ollama.go, core/providers/openai/openai.go, core/providers/openrouter/openrouter.go, core/providers/parasail/parasail.go, core/providers/perplexity/perplexity.go, core/providers/replicate/replicate.go, core/providers/sgl/sgl.go, core/providers/vertex/vertex.go, core/providers/xai/xai.go
Reduced MaxIdleConnDuration from 60 seconds to 30 seconds across all provider implementations, standardizing idle connection timeout behavior.
Documentation
docs/contributing/adding-a-provider.mdx
Updated provider constructor examples to reflect the new 30-second MaxIdleConnDuration standard.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Idle connections now rest for thirty heartbeats,
No more lingering at sixty—we've quickened the retreats,
From one-twenty down to one-three, a rabbit's swift pace,
Uniform timeouts across each provider's place,
Efficiency hops forward with every small trace! ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically describes the main change: reducing MaxIdleConnection timeout from current values to 30 seconds to address TTL mismatch issues.
Description check ✅ Passed The PR description covers all required template sections including Summary, Changes, Type of change, Affected areas, How to test, Breaking changes, Security considerations, and Checklist with substantive content for each.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 02-14-reduce_maxidleconnection_to_30_seconds_to_avoid_ttl_mismatch

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@akshaydeo akshaydeo marked this pull request as ready for review February 13, 2026 18:45
@github-actions
Copy link
Contributor

🧪 Test Suite Available

This PR can be tested by a repository admin.

Run tests for PR #1645

Copy link
Contributor Author

akshaydeo commented Feb 13, 2026

Merge activity

  • Feb 13, 7:07 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 13, 7:07 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo akshaydeo merged commit e0c5afa into main Feb 13, 2026
12 checks passed
@akshaydeo akshaydeo deleted the 02-14-reduce_maxidleconnection_to_30_seconds_to_avoid_ttl_mismatch branch February 13, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant