Skip to content

feat(web_search): add load balance and failover for web api keys#849

Open
yanhool wants to merge 2 commits intosipeed:mainfrom
yanhool:mutil_keys
Open

feat(web_search): add load balance and failover for web api keys#849
yanhool wants to merge 2 commits intosipeed:mainfrom
yanhool:mutil_keys

Conversation

@yanhool
Copy link

@yanhool yanhool commented Feb 27, 2026

Summary

Add load balance and failover support for web api keys.

Problem

Free-tier web search APIs enforce usage limits, which restrict high-volume workloads. Multi-agent scenarios may also trigger rate limits.

Solution

Introduce an atomic, thread-safe rotating key pool to enable load balance and failover.

Changes

  • pkg/agent/loop.go, pkg/config/config.go, pkg/config/defaults.go, pkg/migrate/config.go: rename variables
  • pkg/tools/web.go: implement load balance and failover logic

Usage

"tools": {
  "web": {
    "brave": {
      "enabled": true,
      "api_key": "brave-key-1, brave-key-2, brave-key-3",
      "max_results": 5
    }
  }
}

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