Repository navigation
Correct the Amazon Ads rate limit note in the adapter - #1648
Merged
Merged
Conversation
The instructions said Amazon answers 429 with Retry-After. Amazon publishes no fixed rate limits for the Ads API and a 429 does not always carry Retry-After. The REST engine retries a 429 once, so tell the model to wait before calling again if it is throttled a second time and not to poll report status in a tight loop. The rate_limited verify hint no longer assumes a Retry-After header either.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
The Amazon Ads adapter instructions said "Amazon throttles per account and endpoint and answers 429 with Retry-After; wait and retry." Amazon publishes no fixed rate limits for the Ads API, and a 429 does not always carry a Retry-After header.
The REST engine (
retryDelayMsinrest.engine.ts) retries a 429 exactly once: after Retry-After when it is 3 s or less, after about 1 s when there is none, and not at all when Retry-After is longer. The model then sees the 429 and the header in the error. The instructions now say that, and tell the model to wait before calling again and not to poll report status in a tight loop.Changes
packages/backend/src/adapters/intl/amazon-ads.json,instructions: the Limits. sentence now reads "Amazon publishes no fixed rate limits: it throttles per account and endpoint, and a 429 does not always carry Retry-After. AnythingMCP retries a throttled call once; if it is throttled again, wait before calling again and do not poll report status in a tight loop." The token sentence after it is unchanged.verifyHints.rate_limited: "Wait before trying again (for the Retry-After time, when Amazon sends one)." instead of assuming the header is always there.catalog.ts:node scripts/regenerate-catalog.mjsproduced no diff (it does not embed instructions).amazon-seller.jsondoes not make the "429 with Retry-After" claim, so it is unchanged.Cloud and self-hosted behave the same: this only changes text the model reads.
Type
Testing
All from a worktree of
origin/main(1f5edfa):Repo root:
node scripts/validate-adapters.mjs --warn: exit 0, 1434 warnings, output identical to the same run onorigin/main(no new warnings; none foramazon-ads).Repo root:
node scripts/regenerate-catalog.mjs: "748 adapters across 21 regions", no diff.Repo root:
node scripts/adapter-count.mjs --check: "OK: every quoted count equals 732 adapters (42 keyless, 13312 tools)."packages/backend:npx jest src/adapters/intl/amazon-ads --maxWorkers=4: 1 suite, 6 tests passed. The worktree had nonode_modules, so this ran with the main checkout'snode_modulessymlinked in, whose lockfile differs frommain; CI is the authoritative run.Full backend lint / tsc / test suites not run locally (JSON text change only); left to CI.
Added/updated unit tests
Tested manually (describe steps below)
No tests needed (explain why): text-only change to adapter instructions; the existing static spec covers the file's structure.
Checklist
npm test) (left to CI, see above)Related Issues
Same correction on the website guides: HelpCode-ai/anythingmcp-website#566.