Add random backend-selection strategy for virtual provider LLM agents #156
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#154 Epic: Virtual Provider — Load-Balanced LLM Backend Routing
cleveragents/cleveractors-core
#155 Add backends/strategy configuration and round-robin routing for virtual provider LLM agents
cleveragents/cleveractors-core
#158 feat(agents): add random backend-selection strategy for virtual provider LLM agents
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core#156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
Commit Message: feat(agents): add random backend-selection strategy for virtual provider LLM agents
Branch: feature/m1-virtual-provider-random-strategy
Background and context
Part of the virtual-provider Epic #154, extending the
backends/strategyconfiguration and round-robin routing introduced in #155. Design is recorded
in
docs/adr/ADR-2038-virtual-provider-load-balanced-backend-routing.md.This issue adds the second load-balancing strategy requested for the virtual
provider: uniformly random backend selection per invocation.
Current behavior
agents.<name>.configfortype: llmacceptsbackends/strategy, butstrategyonly accepts"round_robin"; any other value raises aConfigurationError. There is no random-selection implementation.Expected behavior
strategy: randomis accepted by the backends/strategy validation.strategy: random, each invocation selects a backend from theconfigured
backendslist uniformly at random, via Python'srandommodule, and forwards the call/response unmodified — identical
selection-and-forward semantics to
round_robin, differing only in howthe backend index is chosen.
to hold unchanged (no retry/failover, byte-identical behavior when
backendsis absent, full conversation context sent on every turnregardless of which backend handles it).
Acceptance criteria
strategy: randomconstructs successfully (no longer rejected).strategy: randomand N backends, every configured backend is selected at least once(statistical coverage, not exact ordering — this is what distinguishes it
from
round_robin).strategyvalues other than"round_robin"and"random"still raise aConfigurationErrornaming the unsupported value.random-based selection carries a# nosec-style justificationcomment addressing the expected low-severity bandit
B311finding(standard pseudo-random generators unsuitable for security/cryptographic
purposes) — this use is a capacity-distribution concern, not a security
boundary.
propagates to the caller unmodified — it is not retried against another
backend or swallowed.
per-backend credentials, provider/model defaulting, credential isolation,
non-regression when
backendsis absent) continue to pass unchanged.Supporting information
docs/adr/ADR-2038-virtual-provider-load-balanced-backend-routing.mdSubtasks
strategyvalidation to accept"random"RandomStrategy(theSelectionStrategyimplementationintroduced in #155) using Python's
randommodule, with a# nosec-style justification comment for the expected low-severitybandit finding
strategy: randominto the existing virtual-provider wrapperfrom #155
docs/index.md§4.4.7 to document therandomstrategy valueover repeated invocations; non-regression for
round_robinand foragents without
backendsstrategy: randomthroughthe library API
nox -s coverage_reportnox(all default sessions), fix any errorsDefinition of Done
This issue is complete when:
in Metadata exactly.
exactly.