Migrate inventory Sell Vendor to the bridge - #58
Conversation
Migrates the single-bot inventory Sell Vendor action from legacy per-item chat commands to the MultiBot Bridge.
Adds the SELL_VENDOR inventory action, structured result handling and localization for all 8 supported locales. Keeps the legacy fallback available when no Bridge request token is available.
SELL_GREY and the global SellAllBots("s vendor") behavior remain unchanged.
In-game validation: normal vendor sales confirmed on multiple bots, no chat spam, profession tools/Hearthstone/ammunition preserved, no-eligible-item and no-vendor cases validated, and SELL_GREY regression test passed. Craft protection is implemented and statically validated but its dedicated runtime test is deferred until a suitable crafted item is available.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe inventory UI submits bulk grey-item and vendor-item sales through bridge actions when supported. The communication layer tracks and validates the capability. The UI retains per-item fallback handling. Localized success messages report sold-item counts. ChangesInventory selling flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MultiBotInventoryFrame
participant CoreMultiBotComm
participant MultiBotInventoryItem
MultiBotInventoryFrame->>CoreMultiBotComm: submit SELL_GREY or SELL_VENDOR
CoreMultiBotComm-->>MultiBotInventoryFrame: return accepted action result
MultiBotInventoryFrame->>MultiBotInventoryItem: process successful bridge action
MultiBotInventoryItem-->>MultiBotInventoryItem: select localized message with moved-item count
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c91ad8e59e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c365539cf7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Core/MultiBotComm.lua (1)
1524-1536: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winKeep positive-item
SELL_VENDORrequests valid.At Line 1524,
allowsZeroItemIdis based only on the action. Lines 1532-1535 therefore reject every positive-itemSELL_VENDORrequest. This breaks the migrated single-bot Sell Vendor action.Derive a separate bulk condition from the action,
itemId == 0, andcount == 0. RequireINVENTORY_BULK_SELL_V1only for that form.Proposed validation fix
- local allowsZeroItemId = action == "SELL_GREY" or action == "SELL_VENDOR" + local isBulkSell = (action == "SELL_GREY" or action == "SELL_VENDOR") + and itemId == 0 and count == 0 ... - if allowsZeroItemId and state.inventoryBulkSellCapable ~= true then + if isBulkSell and state.inventoryBulkSellCapable ~= true then return false end - if allowsZeroItemId then - if itemId ~= 0 or count ~= 0 then + if itemId == 0 then + if not isBulkSell then return false end elseif itemId <= 0 then🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Core/MultiBotComm.lua` around lines 1524 - 1536, Update the validation around allowsZeroItemId so SELL_VENDOR requests with positive itemId and count remain valid. Derive the bulk condition from the action plus itemId == 0 and count == 0, and require state.inventoryBulkSellCapable only for that bulk form; retain the existing zero-item validation and positive-item path for other requests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Core/MultiBotComm.lua`:
- Around line 1529-1531: Update the MultiBotInventoryFrame caller of the Bridge
submission to treat an unavailable API or missing token from Comm.Send as a
failed submission, then fall through to the existing legacy per-item selling
loop instead of returning false. Preserve the fast path when a valid token is
returned, and keep the capability validation in MultiBotComm unchanged.
---
Outside diff comments:
In `@Core/MultiBotComm.lua`:
- Around line 1524-1536: Update the validation around allowsZeroItemId so
SELL_VENDOR requests with positive itemId and count remain valid. Derive the
bulk condition from the action plus itemId == 0 and count == 0, and require
state.inventoryBulkSellCapable only for that bulk form; retain the existing
zero-item validation and positive-item path for other requests.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 84d3e9bf-f116-4e1e-8373-0e3b19095f07
📒 Files selected for processing (2)
Core/MultiBotComm.luaUI/MultiBotInventoryFrame.lua
🚧 Files skipped from review as they are similar to previous changes (1)
- UI/MultiBotInventoryFrame.lua
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2193a33023
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Migrates the single-bot inventory Sell Vendor action from legacy per-item chat commands to the MultiBot Bridge.
Adds the SELL_VENDOR inventory action, structured result handling and localization for all 8 supported locales. Keeps the legacy fallback available when no Bridge request token is available.
SELL_GREY and the global SellAllBots("s vendor") behavior remain unchanged.
In-game validation: normal vendor sales confirmed on multiple bots, no chat spam, profession tools/Hearthstone/ammunition preserved, no-eligible-item and no-vendor cases validated, and SELL_GREY regression test passed. Craft protection is implemented and statically validated but its dedicated runtime test is deferred until a suitable crafted item is available.
Summary by CodeRabbit
New Features
Bug Fixes