onemezao on Discord: a "hi" answered, and the next message straight
after was Kiro's 429 USER_REQUEST_RATE_EXCEEDED, while the Kiro IDE on
the same Builder ID account and model (claude-haiku-5.5) took two
messages in a row (plugins#842, plugins#848).
The IDE gets the same throttles; it rides them out. Its chat client
(kiro.kiro-agent 1.1.787, dist/extension.js) classifies a
ThrottlingException with reason USER_REQUEST_RATE_EXCEEDED or
CREDIT_CONSUMPTION_RATE_EXCEEDED (ClientThrottleError) or any other
throttle (ServiceThrottleError) as retryErrorType THROTTLING, and its
QClientRetryStrategy tries 3 times: Kiro's retryAfterMilliseconds when
said, else 1s doubling (20% jitter, 20s max), counting each try in
amz-sdk-request and x-amzn-kiro-attempt. It shows "Retrying in N
seconds" over 2s. The plugin sent the first 429 back at once, and
since 0.1.30 with Retry-After 30s, so magpie didn't retry either.
Now paced() sends a chat call the same way: a 429 throttle (those three
reasons, or a reasonless "too many requests"/throttling) is waited out
and sent again, up to 3 tries, one invocation id, attempt=N; max=3. A
wait Kiro says is over 20s isn't held: the 429 goes back with it as
before. Usage limits (MONTHLY/DAILY/..., USAGE_LIMIT), model capacity
and other statuses aren't retried. A cancelled request ends during the
pause and isn't sent again. The last try's 429 keeps 0.1.30's words and
Retry-After.
The 47.3K input tokens of a "hi" are Kiro's own contextUsagePercentage
times the model's window: the agent's system prompt and tools, not
something the plugin adds.
Run (mote, HOME and TMPDIR inside the run dir):
- packages/kiro: bun test, 157 pass 0 fail.
- repo root: bun test; bun scripts/check.mjs kiro.
Root: 6867 pass, 0 fail, 6887 tests across 499 files; check ok.
Broken by hand: paced() returning the first answer (n >= 1) turns 5
tests red (the four new throttle tests in errors.test.mjs and
region.test.mjs's rate-limit case).
Not tried: a real throttled Kiro account. No Builder ID account that
Kiro throttles was at hand, so the retry is checked against the IDE's
code and mocked answers only, not against Kiro.
Reported-by: onemezao (Discord)
onemezao on Discord: through pi, every request of a one-account Kiro
setup (claude-haiku-5.5, 965KB sent) failed after 42s with Kiro's "Too
many requests, please wait before trying again.
(USER_REQUEST_RATE_EXCEEDED)", while the Kiro IDE answered on the same
account. Kiro's words say neither whose limit it is nor what to do, and
with no wait given magpie sent the whole request to the same account
again at 1, 2 and 4s, each try one more against that account's rate.
- failure() and the stream's exception() turn that reason into a 429
that says Kiro is limiting this account's requests, to wait a minute,
and that a limit persisting while the Kiro app works is on the account
for Kiro support, with the request ID (x-amzn-requestid, as the IDE
reads it) when Kiro gave one.
- When Kiro gives no wait for that reason, Retry-After is 30s, past
magpie's same-account retries (8s), so the 1/2/4s re-asks stop. A
wait Kiro does give still wins; other reasons keep magpie's pauses.
Cause, from a real account (the owner's existing kiro-cli sign-in, no
sign-in or refresh, sandbox HOME): a 975KB request is not refused as a
rate: claude-haiku-4.5 answers 400 CONTENT_LENGTH_EXCEEDS_THRESHOLD and
auto (1M) answers 200 in 8.9s; 467KB on haiku 200 in 5.2s; "?" 200. So
the reporter's 429 is Kiro's per-account request-rate state, not the
body or the model. Kiro's own tracker has the same reason on the IDE
for hours (kirodotdev/Kiro#10937, #8549), answered by support.
Run on mote: bun test packages/kiro (146 pass), bun scripts/check.mjs
kiro, and the repo's bun test (6759 pass, 0 fail), each in a temp HOME.
Broken by hand: the new tests against the old index.mjs, 3 red (the
Retry-After cases, the plain message with request ID, the stream case).
Not tried: a real USER_REQUEST_RATE_EXCEEDED (couldn't be drawn without
hammering an account), claude-haiku-5.5 (not on the owner's account),
and whether the Kiro IDE's other request path (CreateResponse) is
rate-counted apart from generateAssistantResponse.
Reported-by: onemezao
A 429 Kiro answered before any of the reply (USER_REQUEST_RATE_EXCEEDED,
"Too many requests, please wait before trying again.") reached magpie
with no word of when, as the plugin built its error response from
nothing. With one account magpie then asked it again after 1, 2 and 4s
and on through its patience: onemezao's one small message took six asks,
five of them 429.
The plugin now reads the wait where Kiro's own clients read it and sends
it on as Retry-After (whole seconds, rounded up): the Kiro IDE's
x-amzn-kiro-ratelimit-retry-after header and the body's
retryAfterMilliseconds (both ms; kiro.kiro-agent 1.1.499, decompiled in
hj01857655/kiro-account-manager docs/Kiro-1.4.5/re/pfd-full.txt), the
x-amz-retry-after header kiro-cli 2.35's AWS SDK honours (ms, found in
the binary's strings), and HTTP's Retry-After. magpie's gateway already
waits a Retry-After: past 8s it skips the quick retries and rests the
account that long. With none said, nothing changes.
Run (mote, HOME a temp dir): bun test packages/kiro, 127 pass;
bun scripts/check.mjs, ok.
Broken by hand: generate without the wait argument; the new test fails
(Expected "13", Received null).
Not tried: a real Kiro 429. Which of these headers Kiro sends on
generateAssistantResponse's 429 is not seen; the IDE reads them on its
CreateResponse path. Hammering a real account to get one was not done.
Reported-by: onemezao
Kiro says a conversation is too long for the model three ways: an HTTP
400 ValidationException "Input is too long." (CONTENT_LENGTH_EXCEEDS_THRESHOLD),
the same ValidationException as an exception frame in the event stream,
or a metadataEvent with stopReason MODEL_CONTEXT_WINDOW_EXCEEDED. Only the
first came out as the 400 "input is too long for the model's context: ..."
that magpie's gateway reads as an overflow (tooLong). The stream exception
went out as a 502 (failedBefore), and the stop reason as end_turn.
As a 502, magpie counted a passing failure: it asked the same Kiro model
again, could rest the account, and in a group routed by intent only moved
on as for any vendor error; a lone agent got a vendor error instead of
context_length_exceeded, so it never compacted. Reported by
ergou0954_54426 on Discord (Kiro's Claude/GPT and DeepSeek in intent
routing, "kiro 那边报错说超出上下文").
Now failedBefore, and the turn after a web search, answer a too-long
exception with that 400. A MODEL_CONTEXT_WINDOW_EXCEEDED stop before any
of the reply is the same 400; after some of it, the reply ends with stop
reason model_context_window_exceeded (Anthropic's word for it). Other
exceptions keep 502, quota and throttling keep 429.
Run on mote: HOME=$(mktemp -d) bun test in packages/kiro, 122 pass;
bun scripts/check.mjs ok. Broken by hand: with index.mjs at HEAD the
three new too-long tests fail (13 pass, 3 fail in errors.test.mjs).
Not tried: a real Kiro account pushed past its window; the stream shapes
come from Kiro's own clients (amazon-q-developer-cli's error enums,
kiro.rs, opencodex's kiro stream reader).