feat(seller): multi-item carts on the deterministic path - #27
Merged
Conversation
The real model already quotes multi-item requests ("5 kg rice and 2 kg
dal" -> two lines) because the quote tool accepts lines[]. The offline
proposer was single-SKU, so the model-down fallback quoted only the
first item. It now parses a multi-item request into cart lines and
quotes them all, matching the real model.
Strictly additive: _parse_multi_lines returns [] unless at least two
segments (split on and/,/&/aur/और) each yield a distinct product with an
explicit quantity, so every single-item request takes the unchanged
single-SKU path. The 200-task simulator (single-SKU by construction) is
unaffected. New test covers both the multi-item and the single-item case.
92 tests, ruff clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLrj9TWybDCNw1mWxZgAks
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.
feat(seller): multi-item carts on the deterministic path
The real model already quotes multi-item requests ("5 kg rice and 2 kg
dal" -> two lines) because the quote tool accepts lines[]. The offline
proposer was single-SKU, so the model-down fallback quoted only the
first item. It now parses a multi-item request into cart lines and
quotes them all, matching the real model.
Strictly additive: _parse_multi_lines returns [] unless at least two
segments (split on and/,/&/aur/और) each yield a distinct product with an
explicit quantity, so every single-item request takes the unchanged
single-SKU path. The 200-task simulator (single-SKU by construction) is
unaffected. New test covers both the multi-item and the single-item case.
92 tests, ruff clean.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01BLrj9TWybDCNw1mWxZgAks