Skip to content

Migrate inventory Sell Vendor to the bridge - #58

Merged
Wishmaster117 merged 4 commits into
mainfrom
feat/sell-vendor-chatless
Aug 12, 2026
Merged

Migrate inventory Sell Vendor to the bridge#58
Wishmaster117 merged 4 commits into
mainfrom
feat/sell-vendor-chatless

Conversation

@Wishmaster117

@Wishmaster117 Wishmaster117 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

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

    • Added bulk actions to sell all gray items or all vendor-sellable items.
    • Displays dedicated success messages with the number of items sold.
    • Added localized labels and confirmations across supported languages.
  • Bug Fixes

    • Bulk selling now uses the connected inventory service when available.
    • Retains item-by-item fallback when the service is unavailable.
    • Inventory actions now verify required capabilities before execution.

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.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a446eee9-be24-474d-b1e4-33aa25a63773

📥 Commits

Reviewing files that changed from the base of the PR and between 2193a33 and 816f570.

📒 Files selected for processing (1)
  • Core/MultiBotComm.lua
🚧 Files skipped from review as they are similar to previous changes (1)
  • Core/MultiBotComm.lua

📝 Walkthrough

Walkthrough

The 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.

Changes

Inventory selling flow

Layer / File(s) Summary
Bridge bulk-action support
Core/MultiBotComm.lua, UI/MultiBotInventoryFrame.lua
The bridge tracks INVENTORY_BULK_SELL_V1, validates SELL_GREY and SELL_VENDOR requests, and resets capability state during lifecycle changes. Bulk commands use the bridge when supported and otherwise use the existing per-item fallback.
Localized selling results
UI/MultiBotInventoryItem.lua, Locales/MultiBotAceLocale-*.lua
Success handling uses dedicated messages for grey-item and vendor-item sales. Locale files provide action labels and messages with sold-item counts.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: migrating the inventory Sell Vendor action to the bridge.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sell-vendor-chatless

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread UI/MultiBotInventoryFrame.lua Outdated
@Wishmaster117

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread UI/MultiBotInventoryFrame.lua
@Wishmaster117

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Keep positive-item SELL_VENDOR requests valid.

At Line 1524, allowsZeroItemId is based only on the action. Lines 1532-1535 therefore reject every positive-item SELL_VENDOR request. This breaks the migrated single-bot Sell Vendor action.

Derive a separate bulk condition from the action, itemId == 0, and count == 0. Require INVENTORY_BULK_SELL_V1 only 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

📥 Commits

Reviewing files that changed from the base of the PR and between c365539 and 2193a33.

📒 Files selected for processing (2)
  • Core/MultiBotComm.lua
  • UI/MultiBotInventoryFrame.lua
🚧 Files skipped from review as they are similar to previous changes (1)
  • UI/MultiBotInventoryFrame.lua

Comment thread Core/MultiBotComm.lua Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Core/MultiBotComm.lua Outdated
@Wishmaster117

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 816f570557

ℹ️ 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".

@Wishmaster117
Wishmaster117 merged commit edc77cf into main Aug 12, 2026
5 checks passed
@Wishmaster117
Wishmaster117 deleted the feat/sell-vendor-chatless branch August 12, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant