Repository navigation
fix(training-agent): reject mixed-currency explicit product_ids proposals - #8128
Merged
Merged
Conversation
…sals Mirror the criteria-only guard on the exactProductIds paths so explicitly selected products priced in different currencies cannot share the first product's budget currency. Follow-up to #7863. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VHwHg8skXvfficerUbeoVd
Contributor
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, minimal server-only fix with no blocking or medium findings.
What I checked:
- Both
exactProductIdsproposal builders (prepared_* seeded branch and selected_product_plan fallback) now reject when selected products span more than one currency, mirroring the criteria-only guard from #7863 verbatim — fail-closed fall-through to the existing rejected path. - Added test exercises both guards (seeded USD+EUR products with explicit product_ids), confirmed red-green.
- Server-only training-agent change, correctly outside protocol scope — no changeset required.
Gate checks:
gated_paths: false— no hard path gate.- No no-auto-approve team match.
high_risk: false.- No critical/high/medium findings.
With no findings and no escalation triggers, this falls through to row 9 of the decision table. review_decision: REVIEW_REQUIRED does not block approval here because gated_paths is false (row 2 does not fire).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #7863. That PR added a mixed-currency guard to the criteria-only
request_proposalsfixture branch. As @aleksUIX pointed out, the explicitproduct_ids(exactProductIds) paths still took the first product's currency fortotal_budget_guidance, so explicitly selected products priced in different currencies were combined into one proposal under a single budget currency.Change
server/src/training-agent/task-handlers.ts, bothexactProductIdsproposal builders (theprepared_*seeded-fixture branch and theselected_product_planfallback) now build no proposal when the selected products span more than one currency. The request falls through to the existingrejectedoutcome, matching the criteria-only guard.Test plan
rejects request_proposals when explicit product_ids span seeded fixtures priced in different currenciestoserver/tests/unit/training-agent.test.ts(seeded USD + EUR products, explicitproduct_ids). Confirmed it fails without the change (proposedinstead ofrejected) and passes with it.npx vitest run --config server/vitest.config.ts server/tests/unit/training-agent.test.ts: 806/806 passing.npx tsc --project server/tsconfig.json --noEmit: clean.