Repository navigation
Description
Summary
Reported: some websites answer Tale with "Too many requests" (HTTP 429) when it fetches them, for example through the chat's web_fetch. The details were not captured: which sites, through which path (the chat's web_fetch, the website crawler or another), whether the deployment sends its requests through outbound proxies, and what the 429 response carried.
What the code shows is that neither path does anything with a 429. Neither waits for Retry-After or slows down. The chat says only that the site answered with an error, and the crawler marks the page failed and moves on to the site's next page at the same pace.
Anchors are on main at 3d802f94f (v0.5.102, with the web_fetch page reader and browser render).
What Tale does today
The chat's web_fetch.
- One GET per call, with a 15 s timeout, as
TaleAssistant/1.0 (+chat web_fetch), through the outbound proxies when any are set (assistant_tools.ts:140-157,:178-195). - It asks again, through the next proxy and up to 3 attempts, only when a JavaScript challenge answered. A CAPTCHA or a refusal ends the attempts, since "asking again from another address would be a way around the site's demand for a person, or its refusal" (
:167-224; CHAT-R50,chat/spec.md:640-648). - A 429 is treated like any other error status. It is not asked again,
Retry-Afteris not read, and the model is told "The server answered 429." with the reasonhttp_error(assistant_tools.ts:3186-3196,:279-284). The reply's step reads "The site answered with an error" (chat.yml:731). - No limit on how many
web_fetchcalls go to one site at once, within a turn or across an organization, was found inassistant_tools.tsorlib/net.
The website crawler (Knowledge › Websites).
- It waits 500 ms between two fetches from one site, longer when the site's
Crawl-delayasks (crawl_action.ts:147-160). It introduces itself asTaleBot/<version> (+https://docs.tale.dev/platform/knowledge/crawling)(crawler_identity.ts:13-30) and goes through the outbound proxies. - A 429 marks the page failed with "The page answered HTTP 429 Too Many Requests" (
crawl_action.ts:1520-1531). The crawl goes on to the site's next page at the same pace, and the failed page is tried again at the next scan.
Outbound proxies. Requests take the proxies in OUTBOUND_PROXY_URLS in turn, round robin per process, and a proxy that fails is passed over for 60 s (outbound-proxy.ts:1-28). A site therefore sees one deployment's requests, from every organization, come from the same few addresses. If those are shared datacenter addresses, a site that limits by address or address range may count other users of the same addresses too.
What would settle it
- The sites, and when it happened.
- Which path met the 429: the chat (a step reading "The site answered with an error"), or a website source's page list ("The page answered HTTP 429 Too Many Requests").
- The 429 response's headers:
Retry-After, and what answered (the site, or a CDN or bot protection in front of it). - Whether
OUTBOUND_PROXY_URLSis set, and whether the same address answers without the proxy. - How many requests went to that site shortly before: a turn that fetched several pages of one site at once, or a crawl.
Options
None is preferred; several combine.
- A. Read
Retry-Afterinweb_fetch: wait when the pause fits the tool's time budget, and otherwise say that the site asked Tale to wait (a reason of its own, such asrate_limited, in every locale, instead ofhttp_error). - B. Let the crawler treat 429 (and 503 with
Retry-After) as "come back later": pause that site for the time it asked, or back off, and retry the page instead of marking it failed. - C. Pace
web_fetchper site: one request at a time to a host within a turn, or across the organization. - D. Keep a successful
web_fetchread for a short while, so a turn that asks for the same page again does not ask the site again. - E. Keep one site on one proxy for a while. Asking again through another proxy after a 429 would get around the site's limit, which CHAT-R50 already rules out for refusals.
Related
- CHAT-R50 and the
web_fetchreader and render changes in v0.5.102 (a49c606, 078d5e5, 4c7d6b1, 16a061d). - fix(platform): classify a vendor's 429 from a live connector body as rate limited #5274 (closed): a connector vendor's 429 classified as rate-limited.
- feat(platform): reach other websites through a round-robin proxy pool #5053 (merged): the outbound proxy pool.
Activity
fix(platform): honour Retry-After when a site answers 429
fix(platform): honour Retry-After when a site answers 429