TDD: fix(agents): virtual-provider budget cost is priced against the agent-level (provider, model), not the selected backend #202
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 milestone
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
#159 fix(agents): virtual-provider budget cost is priced against the agent-level (provider, model), not the selected backend
cleveragents/cleveractors-core
#203 test(agents): capture virtual-provider budget cost misattribution bug (#159)
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core#202
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:
test(agents): capture virtual-provider budget cost misattribution bug (#159)Branch: tdd/m1-virtual-provider-cost-attribution
Background and context
Companion TDD issue for bug #159 (
LLMAgent._accumulate_cost_after_invokeand_check_budget_before_invokeinagents/llm.pyresolve pricing/zero-cost status via the agent-level(self.provider, self.model)anchor, even when the agent is a virtual-provider pool (ADR-2038,docs/index.md§4.4.7) whoseVirtualChatModelactually selected a different backend with its ownprovider/model). Per the project's mandatory Bug Fix TDD Workflow, a failing test proving the bug exists must be written and merged to master BEFORE the fix is implemented. See #159 for the full root-cause analysis.Current behavior
No automated test exists that proves a pooled (
backends-configured)LLMAgentcomputes accumulated cost and evaluates the zero-cost budget carve-out using its agent-level(provider, model)anchor rather than the backend actually selected and invoked byVirtualChatModelfor that call.Expected behavior
Behave scenarios demonstrate the bug:
missing_pricing_entryinstead of completing (#159 AC2).Both assertions fail while the bug is present, and the scenarios are tagged
@tdd_expected_failso they pass CI via inversion until the real fix (#159) lands.Acceptance criteria
@tdd_issue @tdd_issue_159 @tdd_expected_failexists infeatures/(new or extended step file) asserting accumulated cost is computed from the selected backend's rates, not the agent-level anchor's (mirrors #159 AC1).missing_pricing_entry(mirrors #159 AC2).assert/raise AssertionErroronly (per project TDD rules).@tdd_expected_failinversion.nox -s unit_testsis green; coverage unaffected or improved.features/mocks/.Supporting information
docs/index.md§4.4.7,LLMAgent._accumulate_cost_after_invoke/_check_budget_before_invoke/VirtualChatModel._selectinsrc/cleveractors/agents/llm.pyandllm_virtual_provider.py).Subtasks
@tdd_issue @tdd_issue_159 @tdd_expected_fail.missing_pricing_entryfalse failure (AC2), same tags.LLMAgentwithbackendsoverriding provider/model, drive an invocation through fake chat models (features/mocks/), and inspect the accumulated cost / raised exception.missing_pricing_entrywhen the selected backend is priced — both assertions fail on unfixed code.@tdd_expected_failinversion.nox -s unit_tests,nox -s lint, andnox -s typecheckon the new files, fix any errors.Definition of Done
This issue is complete when:
Reopened only to assign the epic