agent: add adapter for Mercado Libre - #2607
Merged
webbrain-one merged 3 commits intoJul 27, 2026
Merged
Conversation
|
@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a localized Mercado Libre/Livre adapter for Argentina, Mexico, and Brazil.
Changes:
- Adds storefront matching and marketplace guidance.
- Mirrors behavior across Chrome and Firefox.
- Tests trusted hosts, lookalikes, localization, and parity.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/chrome/src/agent/adapters.js |
Adds the Chrome adapter. |
src/firefox/src/agent/adapters.js |
Mirrors the Firefox adapter. |
test/run.js |
Adds matching and guidance tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Catalog product pages can group the same product from many sellers. The main buy box represents ONE seller/offer, while "Otras opciones de compra"/"Outras opções de compra" may have a different price, seller reputation, shipping cost, or arrival date. Compare the active offer before quoting or adding it. | ||
| - Variant trap: choose required color, size ("talle"/"talla"/"tamanho"), capacity, voltage, flavor, or other variation BEFORE adding. A variation can change stock, seller, price, and delivery; read back the selected variation from the product page or cart. | ||
| - LOCATION-FIRST shipping: set the destination postal code ("código postal" in AR/MX, "CEP" in BR) before promising availability, freight, free shipping, pickup, or an arrival date. Re-check these in the cart because they depend on both destination and seller. | ||
| - Displayed discounts and installment amounts ("cuotas"/"parcelas") may depend on the payment method, and the listing price can exclude shipping. Use "Agregar/Adicionar ao carrito" when choices still need review; verify seller, variations, quantity, shipping, and the final payable total before any consequential "Comprar ahora/agora" action. |
| - Catalog product pages can group the same product from many sellers. The main buy box represents ONE seller/offer, while "Otras opciones de compra"/"Outras opções de compra" may have a different price, seller reputation, shipping cost, or arrival date. Compare the active offer before quoting or adding it. | ||
| - Variant trap: choose required color, size ("talle"/"talla"/"tamanho"), capacity, voltage, flavor, or other variation BEFORE adding. A variation can change stock, seller, price, and delivery; read back the selected variation from the product page or cart. | ||
| - LOCATION-FIRST shipping: set the destination postal code ("código postal" in AR/MX, "CEP" in BR) before promising availability, freight, free shipping, pickup, or an arrival date. Re-check these in the cart because they depend on both destination and seller. | ||
| - Displayed discounts and installment amounts ("cuotas"/"parcelas") may depend on the payment method, and the listing price can exclude shipping. Use "Agregar/Adicionar ao carrito" when choices still need review; verify seller, variations, quantity, shipping, and the final payable total before any consequential "Comprar ahora/agora" action. |
- replace blended ES/PT labels ("Agregar/Adicionar ao carrito",
"Comprar ahora/agora") with per-locale label lists; those strings
match no control on either storefront and contradicted the
don't-mix-locales rule in the first bullet
- distinguish catalog pages (/p/MLA…, /p/MLM…, /p/MLB…), which carry the
multi-seller offer list, from single-seller -_JM listings, which do not
- warn that checkout continues on a Mercado Pago host where the adapter
no longer fires, so the final total must be confirmed there
- date the volatile UI labels per CONTRIBUTING.md
- lock both fixes with test assertions
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adapter notes ride along with every first-turn request on the site, so they should carry only what the model cannot infer. Drops the variant- selection and price-excludes-shipping/installments bullets, which are generic marketplace advice, and folds the postal-code rule into one line. Keeps the site-specific content: locale-exact buy labels, the catalog vs single-seller URL split, the Mercado Pago hand-off, and the account-verification stop. Notes go 2041 -> 1217 chars (5 bullets), from 5th-largest adapter to 19th of 74. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
CONTRIBUTING.mdMotivation
Regional site adapters are the project's highest-priority contribution area, and the contribution guide specifically calls out
mercadolibre.com.ar,mercadolibre.com.mx, andmercadolivre.com.br.These storefronts have a few behaviors that generic e-commerce guidance does not capture:
The seller/offer guidance is based on Mercado Libre's own catalog documentation and current product pages:
Design
/gz/account-verificationinstead of retrying or attempting a bypassA broad
mercadolibre.*matcher was rejected because it would silently apply incomplete localization guidance to unresearched countries and make lookalike handling less explicit.Testing
node test/run.js— new test passed; 1350 passed, 1 pre-existing failure (the repository'spackage.jsonis26.0.1while the newestCHANGELOG.mdentry is26.0.0)node test/security/injection-corpus.mjs— 60/60 passednode --check src/chrome/src/agent/adapters.js— passednode --check src/firefox/src/agent/adapters.js— passedgit diff --check— passedLive HTTP checks confirmed all three storefront roots respond and the three search hosts can redirect automated requests to
/gz/account-verification. No signed-in purchase flow was performed.Compatibility and risks
This only adds adapter metadata and tests. It adds no dependency, API, permission, storage, or data-format changes. The main residual risk is future marketplace label/layout drift.
Scope