Problem
Currently, each agent has a single provider field — resolved once at spawn time. For cost-conscious deployments, it would be useful to rotate providers across restarts. For example, a witness agent could randomly pick between gemini-flash and claude-haiku on each spawn, spreading token usage across providers and providing resilience when one provider hits rate limits.
Proposal
Add providers (list) and provider_strategy fields to the Agent config:
[[agent]]
name = "witness"
scope = "rig"
providers = ["gemini-flash", "claude-haiku"]
provider_strategy = "random"
Behavior:
- When
providers is set (list), ResolveProvider() picks one based on provider_strategy
- When
provider is set (string, existing behavior), nothing changes — full backward compatibility
provider_strategy is extensible (template method / strategy interface) but only random is implemented initially
- Selection happens at spawn time in the controller, so each restart naturally gets a new provider
Config precedence: providers + provider_strategy takes priority over provider when both are set.
Scope
- Add
Providers []string and ProviderStrategy string to Agent struct
- Add
ProviderStrategy interface with Select(providers []string) string
- Implement
RandomStrategy
- Update
ResolveProvider() to check for multi-provider config
- Update
AgentPatch, AgentOverride, apply functions, pool deep-copy
- Tests for strategy selection, config parsing, backward compat
Problem
Currently, each agent has a single
providerfield — resolved once at spawn time. For cost-conscious deployments, it would be useful to rotate providers across restarts. For example, a witness agent could randomly pick betweengemini-flashandclaude-haikuon each spawn, spreading token usage across providers and providing resilience when one provider hits rate limits.Proposal
Add
providers(list) andprovider_strategyfields to the Agent config:Behavior:
providersis set (list),ResolveProvider()picks one based onprovider_strategyprovideris set (string, existing behavior), nothing changes — full backward compatibilityprovider_strategyis extensible (template method / strategy interface) but onlyrandomis implemented initiallyConfig precedence:
providers+provider_strategytakes priority overproviderwhen both are set.Scope
Providers []stringandProviderStrategy stringtoAgentstructProviderStrategyinterface withSelect(providers []string) stringRandomStrategyResolveProvider()to check for multi-provider configAgentPatch,AgentOverride, apply functions, pool deep-copy