main
53
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0ae116db1a |
kiro 0.1.41: a month used up with trial credits left goes on on credits, so magpie spends the other accounts' plan credits first (#1352)
Kiro spends an account's plan credits first, then its trial credits (kiro.dev/docs/billing: "Kiro uses your plan credits first, then your trial credits"; trial credits last 12 months, plan credits end at the month's reset). A month (or, with overage on, the overage) used up while a bonus has credits left now says `credits: true` beside `aside: true`, so magpie asks that account after the provider's accounts with plan credits left; an older magpie routes it as before. A bonus Kiro marks EXHAUSTED is shown at 100%. Identity Center per-region windows never carry `credits`. Review follow-up (d947cdc): only an ACTIVE bonus counts as credits left (an EXHAUSTED one whose count still said 499.5 / 500 made the account go on on credits Kiro won't spend), and a bonus left that lapses before the month's reset keeps the month set aside only, so that bonus isn't asked last and lost. Run at the reviewed head d947cdc48: HOME=$(mktemp -d) bun test in packages/kiro on mote, 225 pass, 0 fail; bun scripts/check.mjs kiro ok; PR CI (test, bumped, on-npm) green. Broken by hand: with the ACTIVE and lapse checks removed, the new usage test goes red (13 pass, 1 fail). Co-authored-by: yetone <yetoneful@gmail.com> |
||
|
|
13a6f4c226 |
kiro 0.1.40: Kiro sign-ins made elsewhere are imported from a JSON file or paste by their refresh token (#1132)
Accounts signed in to Kiro elsewhere (Kiro Account Manager lists and exports, kiro2api, the Kiro IDE's kiro-auth-token.json with its <clientIdHash>.json client, kiro-cli's tokens) are imported in magpie's "Import accounts from a file…" by their refresh token. Each is renewed where its kind is renewed (Google/GitHub at prod.us-east-1.auth.desktop.kiro.dev, Builder ID / Identity Center at oidc.<region>.amazonaws.com with its client) and named by the email Kiro has for it. Other providers' entries in a sign-in store are skipped, duplicates are renewed once, at most 100 a time. A region or profile ARN read from a file can't pick a host any more, on every route (import, the IDE's file, kiro-cli's DB, a saved sign-in): regionOf takes only Kiro's API regions (us-east-1, eu-central-1) from a profile, arnOf keeps only arn:aws:codewhisperer:<region>:<12 digits>:profile/<id> (else Kiro is asked for it), and oidc/runtime/management/refreshURL refuse a region that isn't an AWS region's shape. Version 0.1.40: #1156 published 0.1.39 first, so main was merged into the branch and the version raised (f8af341f). With arnOf, #1156's test fixture ARN (account "1") was dropped and its reasoning-replay test went red on the merge; every test fixture ARN now has a 12-digit account (0b899428). What was run, on mote with HOME=$(mktemp -d) as CI: - PR head 41938ff0, packages/kiro: bun test, 202 pass, 0 fail. - The earlier review's repro (imported Google sign-in, fresh access token, profileArn arn:aws:codewhisperer:attacker.example/#:1:profile/X): at 41938ff0 every request goes to *.kiro.dev, nothing saved with the crafted ARN. With 5dd9e682's index.mjs put back it and all five profile-host.test.mjs tests are red (hosts [management.attacker.example]). - Merged head f8af341f (main at |
||
|
|
a82a2e3558 |
kiro: preserve scoped reasoning across tool continuations (#1156)
Kiro keeps reasoning signatures across tool continuations, sealed as kiro:<scope>:<payload> where scope hashes the account, region and model, so a signature is replayed only to the account and model that made it. A 400 from Kiro is returned as is (no strip-and-retry). Effort levels come from a per-account model list read at request time, shared by concurrent requests and kept 10 minutes; a failed read is swallowed and the request still goes out. kiro 0.1.39. Reviewed at d60a5d001bd7f7b62574798885714d446eb48e9c (mica, temp HOME): bun test in packages/kiro 203 pass; bun scripts/check.mjs kiro ok. The two probes from the last review (a failed model list made the request a 502; an unlisted model was re-listed on every request) failed at 6af97c7 and pass at this head. Not tried: a real Kiro account. Co-authored-by: asp345 <10955734+asp345@users.noreply.github.com> |
||
|
|
e90d6f011a |
kiro 0.1.38: the tests keep kiro-cli's Windows sign-in under their own HOME (#966)
On Windows the plugin reads kiro-cli's database from %APPDATA%\kiro-cli,
while accounts.test.mjs and builderid.test.mjs wrote and removed it under
~/.local/share. With #1067's EBUSY fix in, these were the last 2 of
#966's 8 Windows reds: "kiro-cli's sign-in, with no way known, keeps the
bare email" and "kiro-cli's Builder ID sign-in ... Builder ID's profile".
The tests now set APPDATA inside the temp HOME before loading the plugin,
so no real %APPDATA% is read or removed, and use that folder on win32.
The version bump releases #1067's statement finalizing.
Run: packages/kiro on Windows 11 (Bun 1.4.2, temp HOME/USERPROFILE)
183 pass 0 fail (2 fail at
|
||
|
|
a9f16031fa |
kiro: finalize kiro-cli's SQLite statements so Windows can remove the file (#1067)
kiro-cli's SQLite statements are finalized in readCLI and saveBack, and in the tests' fixtures, so Windows can remove the database between tests (EBUSY, #966). Run at 85bb47ff: packages/kiro on Windows 11 (Bun 1.4.2, temp HOME) went from 8 reds on main to 2; Linux (WSL Ubuntu 24.04) 183 pass, 0 fail; `bun scripts/check.mjs kiro` ok. The 2 left are the tests writing kiro-cli's database under ~/.local/share while the plugin reads %APPDATA% on Windows; fixed in the next commit. Fixes #966 (with the next commit). |
||
|
|
0135b7b0ea |
agy-cli 0.1.32: the first model list after warming has agy's Claude and GPT models (#1064)
On a signed-in agy, `agy models` takes about 4.4s and `agy acp`'s
session/new about 3s. provider.models() needed three calls before
claude-opus-5-5, claude-sonnet-5-5 and gpt-oss-120b showed up, and
OpenCode 2.x calls it once.
What changed:
- packages/agy-cli/index.mjs:
- The offered-model probe now starts in listAgyModels' .then, as soon as
a non-empty list arrives and a caller asked for probeOffered. It no
longer waits for the next models() call. A hung or failed `agy models`
still never spawns the probe.
- probeSignedIn reuses the `agy models` stdout it already has. The same
parser (parseAgyModels, split out of listAgyModels) fills
cachedModelCatalog, and the probe starts. Sign-in waits for the probe
for at most 3s.
- The offer (acpOfferedModels, acpOfferedKey, offeredProbeAt and any
in-flight probe) is forgotten when agyPath changes and after a new
sign-in finishes. A generation counter drops the answer of a probe
that started before the reset.
- provider.warming() returns a promise while a list or probe is still
running, and null when nothing is.
- scripts/opencode2.mjs, copied byte for byte to every
packages/*/opencode2.mjs: after the first background refresh, the
adapter awaits hooks.provider.warming() once, for at most 60s, and then
refreshes once more. It does not loop. Plugins without warming() behave
as before.
- Not done: the issue's on-disk catalog cache (point 3), skipped as asked.
Known gap: agy-cli has no `config` hook, so under OpenCode 2.x the adapter
lists no provider for it. refresh() returns before it calls
provider.models(), so the follow-up refresh can't add agy's models on 2.x
until agy-cli gets a config hook.
Tests: test/testkit.mjs's fake agy takes a sessionNewDelayMs. The new
tests in test/catalog.mjs set 1.5s on both `agy models` and session/new
and wait for state through warming(), with no fixed sleeps:
- On a slow cold start, the first models() after warming lists Claude and
GPT, from one probe spawn.
- authorize() on a signed-in agy fills the catalog, and the next models()
runs no second `agy models`.
- The sign-in wait is bounded: with a 6s session/new, sign-in returns in
about 4.5s.
- Changing agyPath probes again.
The hang test now awaits warming() before it counts acp spawns.
scripts/opencode2.test.mjs: the warming list is read a second time when
warming ends, and only once when nothing is warming.
Run on Linux (a separate test Mac was over its load limit):
- packages/agy-cli bun test: 17 pass, 0 fail.
- bun scripts/check.mjs agy-cli: ok.
- bun scripts/check.mjs (all packages): ok.
- Root bun test in a temp HOME: 8530 pass, 19 skip, 0 fail.
Broken by hand on Linux, each red, then restored green:
- No probe in the .then: the slow cold-start test.
- probeSignedIn drops the list: the authorize and bounded-wait tests.
- agyPath change keeps the old offer: the agyPath test.
- Unbounded sign-in wait: the bounded-wait test (7514ms).
- Probe also on a failed listing: the hang test.
- origin/main's index.mjs with the new tests: all four #1064 tests.
- Adapter reads the list once: the warming adapter test, and the
copy-identity check.
Not tried: a real agy (no Google sign-in, no network). The reset after
login.finish has no unit test of its own.
Reported-by: hiee3
|
||
|
|
d91f8e31a0 |
kiro 0.1.37: switches to pin an Identity Center account to one credit region (#964)
Two switches in the provider's editor, "Use us-east-1 only" and "Use
eu-central-1 only" (us-east-1-only, eu-central-1-only), pin an Identity
Center account to one credit region. They are read with input.magpie.option
at each request.
- With one on, every request goes to that region. If that region is not
enabled or is used up, the answer is a 429 naming the switch, and the
other region is never tried.
- auth.usage counts only the pinned region. If the pinned region is not
enabled or couldn't be read, a used-up window gives the reason, so the
account is left out of routing.
- The not-enabled reminder names only the pinned region.
- Both off, or both on, is the default.
Run at 38c18529 merged with main
|
||
|
|
5292fc9f55 |
kiro 0.1.36: overage is its own window against its cap; the plan's credits are the plan's (wizcheu on X)
wizcheu on X, Kiro Power (10000 credits) with overage on: the Kiro IDE
shows "10000 used / 10000 covered in plan" and 2589.24 post-paid credits
used (12589.24 this month). magpie showed 12589.24 / 37500 (in "left"
mode 24910.76 / 37500), the overage cap taken for the month's whole
limit.
The cap counts the overage alone: it is the profile's "maximum allowed
overage" quota, in USD at $0.04 a credit (Kiro's Service Quotas
L-75434B0B; $400 is 10000 credits, the cap the 0.1.28 fixture had on a
2000-credit plan). So with overage on the month is now two windows, as
the IDE shows it:
- the plan's credits, min(used, plan) / plan, shown only (aside): using
them up doesn't stop the account;
- "Overage": currentOveragesWithPrecision (else currentOverages, else
what is past the plan) / overageCap, the window that stops it.
With overage off nothing changes. An Identity Center account's regions
sum each: the plans' sum first, shown only, then the overages' sum,
which is the one magpie weighs; a region is used up when its overage
is.
Run (mote, macOS, Bun 1.4.2, HOME a temp dir), at this commit:
- bun test packages/kiro: 172 pass, 0 fail.
- bun scripts/check.mjs: ok.
Broken by hand, bun test packages/kiro/region.test.mjs:
- index.mjs from origin/main (overage cap as the month): 6 fail,
the reporter's numbers among them.
- a region used up by its plan, not its overage: 1 fail ("a region
past its plan with overage left is still used").
Not tried: a real Kiro account with overage on. The fixture is built
from the reporter's screenshot (12589.24, 10000, 2589.24, 37500); the
overageCap-is-overage-only reading is from Kiro's quota docs, not from
a read of a real account at its cap.
|
||
|
|
588b3611cb |
kiro 0.1.35: the sign-in's ways, question and choices in magpie's languages
mahiro233 on magpie's Discord (plugin 0.1.34, magpie v0.1.3372): in a Chinese window, the account sheet's "Choose a sign-in method" and its three choices read in English. Each way, question and choice now gives its words in Chinese, Traditional Chinese, Japanese and German, as magpie's own labels, messages and hints fields beside the English (magpie reads them from its next release; OpenCode and an older magpie show the English, which is unchanged). "AWS Builder ID" stays the product's name; its hint is translated. The API key way also gives its field a "ksk_…" placeholder. The same report said there's no API key option. The plugin has had one since it began (the third way, "Kiro API key (ksk_…)", as kiro-cli uses KIRO_API_KEY), but magpie opened a moved Kiro's first way at once, and its question left no way to the others; magpie's side of the fix is in yetone/magpie. Run on mote: packages/kiro bun test with HOME under the temp dir, 171 pass 0 fail; bun run check ok (exit 0). Broken by hand: with origin/main's index.mjs, signin-words.test.mjs goes red (the first way's zh label undefined). Not tried: a real sign-in (no words on the wire changed); the full root suite. |
||
|
|
1aab125bf1 |
kiro 0.1.34: each model shows Kiro's credit multiplier
01huadalang on Discord: "kiro 加上积分倍率消耗". Kiro's List-Available-Models gives each model rateMultiplier with rateUnit "Credit"; listModels now carries it as the model's rate, which magpie's plugin host reads (rateOf) as Model.Rate, on the account's list and on the config's model. A null, non-number, zero or negative multiplier, or a unit other than Credit, gives no rate. Values from a real Free account on 11-09 (origin KIRO_CLI and AI_EDITOR answer the same, and kiro-cli chat --list-models shows the same rate_multiplier): auto 1, claude-sonnet-4.5 1.3, claude-haiku-4.5 0.4, deepseek-3.2 0.25, minimax-m2.5 0.25, minimax-m2.1 0.15, glm-5 0.5, qwen3-coder-next 0.05. rate.test.mjs keeps sonnet's and the default model's objects as Kiro sent them. Usage is not multiplied again: the credits a request's meteringEvent reports (usage.credit) already include the rate. One prompt cost 0.005349 on haiku and 0.017385 on sonnet, 3.25x, which is 1.3/0.4. The README says so. Run on mote: packages/kiro bun test with HOME under the temp dir, 170 pass 0 fail; bun scripts/check.mjs kiro ok. Real run: listModels with kiro-cli's sign-in returned all eight rates and runtimeModel carries them. Broken by hand: without the rate in listModels both rate tests go red; without the unit check the "no rate" test goes red. Not tried: a Pro account's list (only Free); the rate in magpie's GUI. The full root suite at this head was cut off when mote dropped mid-run (connection closed by the host); it was not run to the end. |
||
|
|
9b41df1507 |
kiro 0.1.33: an account in Kiro IDE's CreateResponse experiment is asked at /v1/responses, as the IDE asks it (#842, #848)
ThirdTimes (#842, #848): on one Builder ID account the plugin (0.1.32) was answered 429 USER_REQUEST_RATE_EXCEEDED on generateAssistantResponse, and Kiro IDE 1.4.121, 11s later, was answered. The IDE's log says "api=CreateResponse armSource=experiment callPath=main". The version strings the plugin sends already match the IDE (1.4.121, the update feed's latest, 2026-11-06). The difference is the call. Kiro puts accounts in a create_response_api experiment, and an account in its arm is asked at POST runtime.<region>.kiro.dev/v1/responses. The IDE's own generateAssistantResponse title call on that account was 429 too. All of this is read from the IDE's extension.js (kiro.kiro-agent, in the 1.4.121 linux tarball, which was not run): - The experiment is read as ExperimentConfigService reads it: GET /featureConfiguration?origin=AI_EDITOR&version=1.4.121 with x-amzn-kiro-profile-arn. The key is sha256hex("kiro-feature-config-key-salt-3e9b1d7a" + "create_response_api"), and the arm's value is "create_response". The result is kept 15 minutes per sign-in. A failed read is asked again after 60s and keeps the last good config, and the read has a 5s timeout. With no config the account stays on generateAssistantResponse, as the IDE's default does, so an account outside the arm is sent what 0.1.32 sent. - CreateResponse is sent with the IDE's headers: the plain IDE user agent (no aws-sdk prefix, no amz-sdk-*), x-amzn-kiro-origin AI_EDITOR, x-amzn-codewhisperer-optout, x-amzn-kiro-profile, TokenType and x-amzn-kiro-attempt "n;max=3". The body is {model, input, tools, stream, origin, profileArn, metadata kiro:agent_mode/kiro:conversation_id, reasoning}, made from the request built for generateAssistantResponse (history, tool calls and results, images as data: URLs). The system text stays at the head of the first message, as with the IDE's system_field_injection off. - The SSE reply is read into the same events the old frames gave: text, reasoning and its signature, refusals, function calls (pieces or whole), stop reason, context %, and credits. An error before any answer becomes the status generateAssistantResponse's would have, mapped through the IDE's reason table (rate_limit_exceeded is USER_REQUEST_RATE_EXCEEDED, context_length_exceeded is CONTENT_LENGTH_EXCEEDS_THRESHOLD, and so on). The 0.1.32 429 retry applies to both paths. Not done: the auxiliary path (create_response_api_auxiliary; the plugin has no auxiliary calls), the x-amzn-kiro-fallback header, documents as input_file, and reasoning items in history. Run on mote at base |
||
|
|
966cf71764 |
kiro: a 429 throttle is waited out and tried again, as the Kiro IDE does (0.1.32)
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) |
||
|
|
087c36123d |
inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, key calls on the session cookie (#832)
inkstone 0.1.3 (#832, yunwang2442-creator): - Image requests are prechecked before they leave: 8 images, 10MB each, 40MB in all. - A request over a cap gets a local 400 shape refusal, so magpie asks the next account and rests none. - The plan's invalid_media / media_fetch_failed / unsupported_media_type errors become the same kind of refusal. - The body rewrite strips the reasoning fields and sets image detail to auto. - A zero-prompt browser sign-in comes first, and a second browser method reuses a pasted key. - Neither browser method is offered when no Chromium-family browser is found (#825). - The /keys calls ride the session cookie, without the pagination query. Key creation retries the console's -15100 "refresh page and retry". - The #826 metadata token read is kept, and its test is back. - The fake browser is built once per user and source hash (#824), and the title wait reads only on Windows. - maxConcurrency is 4. - The doubled comment line is dropped from every opencode2.mjs copy, agy-cli's included. Reviewed at 88e66bde, on mote (macOS, Bun 1.4.2) with a temp HOME: - full bun test: 6853 pass / 0 fail; both checks exit 0 - bun scripts/check.mjs and bun scripts/check.mjs inkstone: exit 0 - 21 hand breaks: 20 red, 1 not caught (the /keys pagination test calls protocol.listKeys directly; follow-up filed) Not tried: a real InkStone account or sign-in, Windows and Linux runs. |
||
|
|
b81000019f |
kiro 0.1.31: reasoning sent with its signature in one event keeps it; chat as the Kiro IDE
Called as the Kiro IDE (previous commit), Kiro's auto ends a reply with
one reasoningContentEvent holding both text ("...") and a signature
(".KTR~~…"). events() read the text and dropped the signature, so the
reply had a thinking block with an empty one. Both are now kept: the
signature goes on the block the text began, streamed (signature_delta)
or not. The IDE's own reader (extension.js) keeps them together too.
Version 0.1.31 carries this and the IDE identity.
Run on mote: bun test in packages/kiro (152 pass), bun scripts/check.mjs
kiro, in a temp HOME.
Broken by hand: reasoning-signature.test.mjs (the payloads of a real
reply) against the old else-if, 2 of 2 red.
Real use (same sandbox as before): auto answered 200 with the thinking
block's signature kept, a second turn carrying that block back answered
200, and the streamed reply sent the signature_delta.
Not tried: a thinking model with a budget under the new identity.
Reported-by: onemezao
|
||
|
|
1d3b537c0d |
kiro: chat calls go as the Kiro IDE 1.4.121 sends them, not as kiro-cli
onemezao on Discord (Builder ID, Kiro Pro for students, claude-haiku-5.5, pi): every request was answered 429 USER_REQUEST_RATE_EXCEEDED, and kiro-cli on the same account is too, while the Kiro IDE goes on working there. Kiro is limiting the CLI's identity on that account, not the IDE's, and the plugin called as kiro-cli: aws-sdk-rust's user agent with AmazonQ-For-CLI and a random suffix on every request, origin KIRO_CLI, and a new conversationId per request. A generateAssistantResponse call now carries what the IDE's own extension.js (Kiro 1.4.121, agent KAS 0.66.89, Electron 44 / Node 24.22.1, downloaded from prod.download.desktop.kiro.dev) sends through its KiroRuntime client: - User-Agent: the AWS SDK for JavaScript's, "aws-sdk-js/1.0.0 ua/2.1 os/<platform>#<release> lang/js md/nodejs#24.22.1 api/kiroruntime#1.0.0 m/N", then the IDE's "KiroIDE-1.4.121-<machine id>-KAS/0.66.89 acp-client/kiro-ide"; x-amz-user-agent is "aws-sdk-js/1.0.0" and that last part. The machine id is one 64-hex per install (the hash the plugin already names itself with to Kiro's auth service), never a random one per request. m/N is the SDK's feature for the endpoint the IDE names; its retry strategy has no mode, so no E. - x-amzn-kiro-client-attribution: kiro-ide; x-amzn-kiro-attempt: 1;max=3 and amz-sdk-request attempt=1; max=3 (the IDE's budget at a conversation's start); TokenType SSO_OIDC for a Builder ID or Identity Center token, as the IDE says it. - Each message's origin is AI_EDITOR. agentMode leaves the body: the IDE's client binds it to x-amzn-kiro-agent-mode, which stays. - conversationId is one per session: a UUID made from magpie's X-Magpie-Conversation (or X-Magpie-Session, or OpenCode's session header), the same on every turn; a call that names no session gets a new one, as before. The session's own name never goes to Kiro. This holds for every account and every call, not only after a 429: the IDE's identity is the one that works where the CLI's is limited, waiting for a refusal first would spend one, and one identity per account is simpler than two. Prompts are unchanged. The usage, model-list and API-key control calls keep kiro-cli's origin (unchanged here). Run on mote: bun test in packages/kiro (150 pass) and bun scripts/check.mjs kiro, and the repo's bun test (6815 pass, 20 skip, 0 fail) with bun scripts/check.mjs, each in a temp HOME. Broken by hand: ide-identity.test.mjs against the old index.mjs, 4 of 4 red; with a random suffix put back on the user agent and the Headers lookup taken out, 2 red. Real use (the owner's existing kiro-cli sign-in, a Google account, copied into a sandbox HOME, no sign-in or refresh): auto and claude-sonnet-4.5 answered 200 twice each under the new identity, one conversationId across both turns. It showed auto, called as the IDE, ending a reply with a reasoning event that carries its signature; the next commit keeps that signature. Not tried: a Builder ID account or the reporter's account (the owner's is Google; claude-haiku-5.5 is not on it, INVALID_MODEL_ID), whether this ends the reporter's 429, and the IDE's A/B user agent (AB_USER_AGENT_REFACTORING), whose control form is used here. Reported-by: onemezao |
||
|
|
44df5f0505 |
kiro 0.1.30: an account's request rate (USER_REQUEST_RATE_EXCEEDED) says whose limit it is, and isn't re-asked at 1/2/4s
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 |
||
|
|
4200fed099 |
kiro 0.1.29: what Kiro's meteringEvents say a request cost goes on as usage.credit (#823)
Kiro gives no token counts, only what each request cost in credits: a
meteringEvent ({"unit": "credit", "usage": 0.091}) near the end of its
reply. The plugin read past it, so magpie's Usage page reckoned Kiro's
cost from estimated tokens with no cache (yetone/magpie#4328, #3761).
The credits of a request's meteringEvents are now summed (a hosted web
search's turns are one request) and said as usage.credit in the last
message_delta, streamed, or in the message's usage, as WorkBuddy's
usage.credit is said on the Chat path. A reply with none says no credit;
one Kiro says cost 0 says 0. An event in another unit, or with a usage
that isn't a number of at least 0, is left out. magpie reads the field on
/v1/messages once the host half of yetone/magpie#4328 is in; until then
it is passed over.
Run at 57a4d35e on mote (Bun 1.4.2, HOME a temp dir): bun test
packages/kiro 144 pass, 0 fail; bun scripts/check.mjs kiro ok; bun test
(whole repo) 6679 pass, 0 fail. Merged onto main
|
||
|
|
e7004d9354 |
inkstone 0.1.0: Intern InkStone (书生·端砚) Token Plan, browser sign-in, credit card and ink-* key chat (#775)
New package @magpie-community/opencode-inkstone-auth 0.1.0 for Intern InkStone (书生·端砚, Shanghai AI Lab) Token Plan, provider id `intern-inkstone`. Community package by yunwang2442-creator. What it does: - Browser sign-in (Edge/Chrome, its own profile under $XDG_CONFIG_HOME or ~/.config/magpie/inkstone-browser, or %LOCALAPPDATA%\magpie\inkstone-browser). The login window has no debugging port. A headless CDP read takes the uaa-token cookie, and the same read renews it silently later. - Usage card: ink-credit balance, 5-hour and 7-day windows, credit packs. - Chat: a pasted ink-* API key, or one the sign-in creates, named ink-<host4>-<acct4>-<rand4> (18 of the console's 20 characters). An idempotency clash (-15109) retries with a fresh name, up to three times. Pruning is on by default. It only touches this machine's and account's prefix, keeps the newest two and the key this sign-in created, and never deletes manual keys or keys of unknown age. - Closing on Unix: SIGTERM, then SIGKILL only after a 15s grace. Leftover browsers are matched by --user-data-dir=<escaped profile>, and Windows uses .Contains(). - The login wait comes from an injected waitForLogin in tests. No env hook is left in production code. - Hosts: discovery.intern-ai.org.cn, discovery-api.intern-ai.org.cn, 127.0.0.1 (CDP). Outside the package: scripts/opencode2.mjs lets a prompt with `required: false` stay optional (`p.required !== false`). Every package's copy is synced byte for byte, so all 39 copies in the merged tree are blob |
||
|
|
e7cb9dc54c |
kiro 0.1.28: an Identity Center account's two credit regions, each with its overage cap (#820)
An IAM Identity Center organization can enable Kiro in both of its regions, us-east-1 and eu-central-1. Each region has its own profile, its own month of credits and its own overage cap. The plugin used only the first profile it found, so when that region was used up the account left rotation while the other region still had credits.
- Overage: with overageStatus ENABLED, the month counts against overageCap (the month's whole limit).
- Identity Center sign-ins list their profiles in both regions and keep them with the account (`profiles`, by region). A region with no profile is asked for again at most every PROBE_MS (10 minutes).
- A request goes to the first enabled region with credits left. On MONTHLY_REQUEST_COUNT / USAGE_LIMIT that region rests until its reset (an hour when none is known), and the request is sent once to the other region. A rate limit is passed on with Kiro's wait as Retry-After. When every region is used up, the reply is a 429 that names them, carries the last wait and names any region not enabled.
- auth.usage reads both regions. Each region gets a window, shown only, and their sum is the window magpie weighs the account by.
- Builder ID, Google, GitHub and API key sign-ins keep one region.
Run at head ce4004b99257fb66bac92a564a322b693748a7ec, merged onto main
|
||
|
|
ab0d3fe54a |
kiro 0.1.27: Kiro's wait before asking again goes on as Retry-After
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 |
||
|
|
17e5ef7457 |
all: load on OpenCode 2.x through a default {id, setup} (#657)
nbczw8750 (#657): trae 0.2.26 on OpenCode 2.2.5 fails with "Plugin must export a default definition with an id and an effect or setup function. (cause: SchemaError(Missing key at ["default"]))". 2.x imports a package's exports["."] (a plugin dir and an npm install alike) and has no V1 path at all, so every package here that serves models failed the same way, not only trae. Every one of the 32 model packages now has: - opencode2.mjs, exports["."]: a copy of scripts/opencode2.mjs, an adapter that runs the package's V1 plugins inside 2.x's promise API. Config providers become 2.x providers (package pinned so the aisdk sdk hook runs), V1 auth methods become integration methods (oauth auto/code with forms; api without authorize as a key method), V1 credentials are kept in metadata.v1, the loader's baseURL, apiKey, headers and fetch are applied through the sdk hook, an auth.set renewal is stored per credential, and credential.switched /updated reload the account's own model list. - opencode.mjs, main: re-exports the V1 plugin functions only. OpenCode 1.x and magpie's host.js take main. On 1.x, trae 0.2.26's main exported a non-plugin (_internal) and 1.19.5 refused it ("Plugin export is not a function"); the new main fixes that too. - both files in "files"; patch version bumped. devin already had 2.x and is unchanged. scripts/check.mjs fails a model package whose 2.x entry has no default {id, setup}, whose opencode2.mjs differs from the canonical one, whose entry is missing from files, or whose main exports a non-plugin. Run at this head (mote): - HOME=$(mktemp -d) bun test, as CI runs it: 4900 pass, 0 fail (4914 tests, 374 files). A first run set globalThis.fetch for the whole process from opencode2.test and failed 528 tests in other packages; the block is now set and put back around that file's tests. - bun scripts/check.mjs: every package passes. With the network blocked cloudflare-workers-ai fails on its fetched catalog, the same on origin/main. - Real OpenCode 2.2.5 (npm opencode-ai), sandbox HOME, packed trae 0.2.27: loads with no error; /api/integration lists trae-cn "Trae CN" and trae-global "Trae Global" with their browser sign-ins; `auth login` starts the trae.cn authorization and waits (cancelled there); with a fake credential POSTed to /api/credential, `opencode models` lists trae-cn's six models. - Real 2.2.5 with a fake V1 key plugin through the same adapter against a local fake server: `auth login` with a key, `models`, `opencode run` reached /real/v1/chat/completions with the loader's "Bearer loader-sk-fake" and header, and printed the fake's reply; with @ai-sdk/anthropic it reached /real/v1/messages with x-api-key from the loader. This run found the key method missing after 2.x's second integration transform (a once-only flag outside the transform); fixed, and opencode2.test checks a rebuild. - Real OpenCode 1.19.5, sandbox HOME, trae 0.2.27: `opencode models` lists trae-cn and trae-global models; 0.2.26 failed there. Broken by hand (scratch copy, bun test scripts/ and check.mjs): - trae's exports back to "./index.mjs": the trae 2.x test fails (default.id undefined), check fails trae with "OpenCode 2.x: ./index.mjs has no default {id, setup} (plugins#657)". - zed's opencode2.mjs changed: the copies test fails, check fails zed "differs from scripts/opencode2.mjs". - the key flag back outside the transform: the 1.x plugin test fails on the rebuilt sign-ins (key missing). Not tried: a real sign-in with a real account on 2.x; Windows (the reporter's OS); chat.headers, chat.params, usage and tool hooks, which the adapter doesn't carry to 2.x; the tools/pages packages (calc, goanyapi, layerfs, search1api, aelios, agent-console, chat, fingerprint, nowledge-mem, kimi-desktop), which still load only on 1.x. |
||
|
|
464acbc2fc |
kiro: the README no longer lists usage under Not included
The plugin has read usage (auth.usage, Get-Usage-Limits) since 0.1.17, and #602 added a "Usage in magpie" section right above the stale line. README only, no version bump: it ships with the next kiro release. Nothing to run. |
||
|
|
605381174d |
kiro 0.1.25: bonus credits show on the Usage card, each with when it lapses (#602)
kiro 0.1.25: bonus credits (bonuses in Get-Usage-Limits) show on the Usage card as windows of their own, aside, with when they lapse; a month used up while a bonus has credits left is set aside too, since Kiro spends plan credits first.
Reviewed head fc9eb1e on main
|
||
|
|
e8050e812d |
kiro 0.1.24: a conversation past the model's window is a 400 that says too long
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). |
||
|
|
3d56e7e4d6 |
kiro 0.1.23: an effort without thinking asked for is sent no thinking (#538)
thinking() turned thinking on for any output_config.effort above low,
even when the request had no thinking object or had thinking disabled.
Claude Code's title and side requests carry an effort and no thinking,
and a turn with thinking turned off says disabled, so Kiro was sent a
<max_thinking_length> budget for them, or, for a model whose catalog lists
effort fields, adaptive thinking at that level. Low alone was spared.
Now only thinking.type enabled or adaptive asks for thinking, as
Anthropic's API and magpie's gateway (anthropic.go) read a request.
With thinking on, nothing changes: each of low, medium, high, xhigh and
max goes as additionalModelRequestFields {thinking: adaptive,
output_config: {effort}} when the model's schema lists it, else as the
10k/20k/30k/50k/50k budget.
Run: HOME=$(mktemp -d) bun test in packages/kiro on mote: 118 pass.
bun scripts/check.mjs: ok. Broken by hand: with index.mjs at HEAD~,
the new "an effort without thinking asked for" test fails, the
per-level test passes. A probe built the body for every level x
{adaptive, enabled, none, disabled} x {schema, no schema}.
Not tried: a live Kiro account whose catalog lists effort levels.
|
||
|
|
9d4c7ce558 |
kiro: xhigh and max go as Kiro's own effort levels; trailing system context goes before the question (#538)
Two problems from #538 (zengxiaosong): 1. xhigh and max both became a 50000 <max_thinking_length> budget. The plugin now reads each model's additionalModelRequestFieldsSchema from ListAvailableModels, as Kiro IDE 1.4.62 does: when the schema offers thinking.type "adaptive" and an effort enum under output_config (or reasoning), a level in that enum is sent as additionalModelRequestFields {thinking:{type:"adaptive"}, output_config:{effort}} and the XML budget is left out. A model with no such schema (every model on a Free account today: the schema is null), a level not in the enum, or thinking off, is sent as before. 2. System messages ending the conversation (Claude Code's environment context) were joined into the question. They now go as a user turn before the question, answered by "Understood." (Kiro IDE's placeholder for a missing assistant turn), and the question is the current message. Not moved when the question holds tool results or follows tool calls, so call/result pairs are unchanged. systemPrompt is not used: the reporter's account refuses it. Run (on mote, bun 1.4.2): - bun test packages/kiro: 115 pass. - Full suite as CI, HOME=$(mktemp -d) bun test: 3885 pass, 0 fail; bun scripts/check.mjs: ok. Broken by hand: - nativeFields never finding a model: the two schema tests go red. - contextFirst returning messages as given: the reporter's [user, system] test and the later-question test go red. - The new tests on origin/main's index.mjs: 6 fail (in part only because the new exports are missing there). Not tried: a real Kiro account whose catalog has a non-null schema. The only account here is Free, whose ListAvailableModels gives null for every model, so the schema shape is from Kiro IDE 1.4.62's source, and the fixture follows it. |
||
|
|
498358c04e |
kiro 0.1.21: choose direct AWS sign-in for a remote magpie (#507)
The Kiro browser sign-in asks first which way to sign in:
- AWS Builder ID registers a client with AWS OIDC (us-east-1) and opens
AWS's authorize page directly.
- IAM Identity Center asks for the organization's HTTPS Start URL and AWS
region (blank is us-east-1), then opens that region's AWS authorize page.
- Kiro sign-in page keeps the portal (Google, GitHub, other ways); a caller
without inputs (OpenCode's CLI) keeps it too.
The direct ways skip the portal's first loopback callback, so a magpie on a
server or in Docker needs one pasted callback address instead of two. Still
authorization code + PKCE, same scopes, same hosts (oidc.<region>.amazonaws.com,
Kiro's own API). The callback handler now takes each stage's own state and
path once, answers a stale or foreign address with 404 without ending the
sign-in, says 409 to a second paste while a code is traded, sends a repeated
portal address to the same AWS page, and a new sign-in ends the one left
behind and frees its port at once. Kiro's page's region and AWS issuer are
checked for shape (a region can no longer put another host into the OIDC
address). Version 0.1.20 -> 0.1.21.
Reviewed head: 236db712518305415f15651178696a59a72c4a8b (base
|
||
|
|
ecc4df3076 |
kiro 0.1.20: accept object tool schemas and run native web search (#492)
Kiro answers 400 REQUEST_BODY_INVALID to a tool schema whose root has
properties and no type, or is {}: the root is now sent as type "object"
(copied; nothing under it changed, another explicit root type left alone).
Anthropic's hosted web search (web_search_20250305) is searched with Kiro's
own web_search, sent as kiro-cli 2.35 sends it: InvokeMCP at the runtime's
root (AWS JSON 1.0, x-amz-target AmazonCodeWhispererStreamingService.InvokeMCP),
a JSON-RPC tools/call with {query} only, the profile ARN in the body and in
x-amzn-kiro-profile-arn. The model is offered kiro-cli's own web_search spec
(with __tool_use_purpose, which is stripped before the caller sees it and
never searched). At most 10 searches per request (max_uses honoured), a
turn cap of uses+2 (pause_turn), 30s timeout and a 1 MiB cap per search.
The config hook says searches: true, which the user's own setting overrides.
Other web_search versions are a 400 that names provider.kiro.searches: false.
kiro 0.1.19 -> 0.1.20.
Author: SemonCat (#492)
Run at 993f9bae5628cd3d525a838bdc0319cc58968c03 on mote (macOS, Bun 1.4.2),
HOME=$(mktemp -d) as CI:
- bun test packages/kiro: 94 pass, 0 fail
- bun test (whole repo): 3563 pass, 8 skip, 0 fail
- bun scripts/check.mjs: every package ok, kiro included
- npm pack --dry-run in packages/kiro: 0.1.20, 3 files; node scripts/dist.mjs
into a scratch folder packs opencode-kiro-auth@0.1.20
Broken by hand, each red in packages/kiro: schema root sent raw (5 fail),
profileArn left out of the search body (1), the 10-search cap removed (1),
__tool_use_purpose kept in the caller's input (1).
Checked against kiro-cli 2.35.0's binary: the web_search description, the
query's description and maxLength, the __tool_use_purpose text and the
InvokeMCP target/content type are its strings; the fixture's result fields
(title, url, snippet, publishedDate, domain, id, maxVerbatimWordLimit,
publicDomain) are the output its tool spec documents.
The search goes to the same runtime.<region>.kiro.dev host as inference.
Not tried here: a live search (the author's record has one OAuth account,
Haiku 5.5, us-east-1); an API-key search live.
|
||
|
|
9410e2a510 |
commandcode 0.1.19, devin 0.1.26, kiro 0.1.19: a refused sign-in marks the account signed out
blue12345655 (magpie Discord #help): a Command Code account signed in
through the plugin was signed out, and magpie offered no 重新登录, on
v0.1.1844 and still on v0.1.2021.
Cause: commandcode said X-Magpie-Sign-In "kept" on every answer and
signIn "kept" on every usage read, so a revoked key came back as a card
saying "Unauthorized" while magpie kept the account signed in, routed to
it, and never showed Sign in again on its rows. Devin and Kiro did the
same in their usage reads: their errors already said "sign in again",
but "kept" stops magpie from reading those words.
- commandcode: a usage read whose credits are refused (401/403), or a
request answered 401, asks /alpha/whoami; when whoami refuses the key
too, the usage says signIn "expired" with "Command Code's sign-in has
expired; sign in again", and the answer carries X-Magpie-Sign-In:
expired, its body unchanged. A 403 for a model the plan lacks, a 401
whoami still takes, and a whoami 500 keep the account. A clean usage
read says "renewed", which takes a mark off.
- devin: a usage read Devin answers 401 says "expired"; a clean read
"renewed"; other failures "kept". Requests unchanged.
- kiro: a usage read whose sign-in Kiro refused (the errors made by
gone) says "expired"; a clean read "renewed"; other failures "kept".
auth.refresh and requests unchanged.
The response bytes in commandcode/signed-out.test.mjs are what
api.commandcode.ai answered an unknown key on 2026-10-29 (whoami,
billing/credits, billing/subscriptions, provider/v1/chat/completions).
Run (WSL magpie-desktop, Bun 1.4.2, HOME=$(mktemp -d)):
- bun test in packages/commandcode: 82 pass, 0 fail; packages/devin:
142 pass; packages/kiro: 67 pass.
- bun scripts/check.mjs: every package ok.
Broken by hand: signed-out.test.mjs against the 0.1.18 index.mjs, 4 of
9 red (usage expired, clean read renewed, Provider API expired, Go
expired). kiro's and devin's changed usage tests against their old
index.mjs: red ("kept" received where "expired" expected).
Not tried: a real revoked Command Code, Devin or Kiro account; the
whoami check is only against an unknown key's real answers.
|
||
|
|
ceda580080 |
kiro 0.1.18: an image over Kiro's 5 MiB Base64 limit is shrunk on the request, or replaced by a note (#428)
imwaco (#428): in Codex -> magpie -> Kiro, view_image returned a PNG of
4,171,428 bytes, 5,561,904 as Base64, and Kiro answered
messages.130.content.2.image.source.base64: image exceeds 5 MB maximum:
5561904 bytes > 5242880 bytes (IMAGE_SIZE_EXCEEDED)
on that turn and on every later one, text-only ones too, as the image
stays in history. The limit is on the Base64 string: 5561904 is that
image's Base64 length, not its file size, so the largest file that fits is
3,932,160 bytes. kiro-cli's own gate is 10 MB of raw file
(MAX_IMAGE_SIZE, aws/amazon-q-developer-cli chat/consts.rs), the gap
kirodotdev/Kiro#11497 describes.
buildKiro's conversation is now built as an object (kiroRequest) and,
after the latest-image selection, kiroBody fits every image left in it,
user images and tool images in history alike, on the plugin's own copy:
- an image at or under 5,242,880 Base64 characters is sent byte for byte;
- one over it is decoded with Bun.Image (Bun 1.4's built-in libspng /
libjpeg-turbo / libwebp, no new dependency; magpie's host and OpenCode
2.0.25 both run Bun 1.4.2) and tried, in order: its own kind with the
long edge at most 2000 px, then WebP (keeps alpha) or JPEG for a JPEG,
q80, then 0.7x smaller at q75 down to 256 px, until it fits;
- bounds: 50M pixels (a header claiming more is refused before decoding),
64 MB of Base64 looked at, 30 s per image; one image is worked once per
sha256 (in-flight shared, 4 kept);
- one that can't be read, has too many pixels, can't be brought under, or
a host without Bun.Image: the image is left out and a one-line note
takes its place in that message's text, so the turn still goes.
History, entry count, tool pairing and image order are unchanged.
Run:
- HOME=$(mktemp -d) bun test packages/kiro: 67 pass (image-size.test.mjs
new, 10 tests); the same under OpenCode 2.0.25's Bun (BUN_BE_BUN=1
opencode test packages/kiro): 67 pass. bun scripts/check.mjs kiro: ok.
- Fixtures are built in the test: a 1389x1000 noise PNG padded to exactly
4,171,428 bytes (5,561,904 Base64), PNGs at 3,932,159 / 3,932,160 /
3,932,161 bytes (Base64 5,242,880 with "=", 5,242,880, 5,242,884), a
20000x20000 header bomb and 4 MB of junk.
- Full HOME=$(mktemp -d) bun test at
|
||
|
|
634a865346 |
kiro 0.1.17: credits tell their count, so magpie's "Left" shows what is left (#408)
Fidelxyz switched magpie's usage to "Left" and Kiro's credits still read
as used ("12.5 / 50"). magpie turns a window round only from its count
(amount, limit, unit; quotaCount in app.js): display alone is the
vendor's text, shown as it is. usageOf now gives each Credits and Free
trial window amount = currentUsageWithPrecision, limit =
usageLimitWithPrecision and unit "credits"; display is unchanged.
Run: HOME=$(mktemp -d) bun test in packages/kiro: 57 pass 0 fail. On the
old index.mjs the two usage tests fail (amount/limit/unit missing).
bun scripts/check.mjs: kiro ok.
Not tried: a real Kiro account (no vendor credentials used); the window
shape is the one workbuddy's Credits already shows "left" with.
|
||
|
|
9f6c4e8861 |
kiro 0.1.16: a reply with no token counts says its cache is unknown, not 0 (zeewell on X)
zeewell on X: every Kiro request in magpie's Routing page shows cache 0%
(Claude Code through group/wf-coding-*, claude-sonnet-5.5 and
claude-opus-5.5, 150-180k tokens, consecutive calls seconds apart).
Cause, from real requests (Google sign-in through kiro-cli, 2026-10-24):
Kiro caches, but reports no token counts at all. A
generateAssistantResponse reply ends with metadataEvent {stopReason},
contextUsageEvent {contextUsagePercentage} and meteringEvent {credits};
no tokenUsage. The same 9k-token prompt sent twice was billed 0.091
then 0.048 credits, the same with or without cachePoints and with a
fresh or a fixed conversationId. kiro-cli 2.32's own trace log
(KIRO_LOG_LEVEL=trace) shows its MetadataEvent with total_tokens,
uncached_input_tokens, cache_read_input_tokens and
cache_write_input_tokens all None, and kiro-cli sends no cachePoint.
So nothing the plugin sends or drops keeps Kiro from caching (#110's
reading that only cachePoints make it cache was wrong); the plugin said
cache_read_input_tokens 0 for a number Kiro never gave.
Now, with no tokenUsage, the reply's usage leaves both cache fields out
and says magpie_cache_unknown: true, which magpie reads as no hit rate
instead of 0%. A tokenUsage, if Kiro sends one, is told as before.
cache-points.test.mjs's comment is corrected; the marks stay.
Run: cache-unknown.test.mjs (the real reply's events, streamed and not)
fails on 0.1.15's index.mjs (1 fail) and passes; bun test in
packages/kiro 57 pass under a scratch HOME/TMPDIR; scripts/check.mjs
kiro ok. The patched loader's fetch against real Kiro (source "kiro",
claude-sonnet-4.5, twice): 200, message_delta usage
{"output_tokens":1,"magpie_cache_unknown":true}. Not tried: an IDE or
Builder ID sign-in, other models' replies.
|
||
|
|
20396784c7 |
kiro 0.1.15: an API key is used as kiro-cli uses it, with or without a profile GetProfile finds (Hollowhere on Discord)
Hollowhere (magpie 0.1.1319, kiro-cli 2.33.1, macOS) signed in to Kiro in
magpie with a Kiro API key. /v1/models listed kiro/auto alone, and every
request failed with "Kiro: Kiro didn't take the API key: 400 Bad Request",
while kiro-cli listed claude-opus-5.5 and claude-sonnet-5.5 and chatted
with the same key.
Cause: the plugin asked GetProfile in us-east-1 only and threw on any
answer but a profile, so a key GetProfile has no profile for never got
further: the model list fell back to Auto and every request failed with
that 400. kiro-cli 2.32.0 (installed here), traced with KIRO_API_KEY set
to a made-up key in a sandbox HOME, every host behind a local proxy that
refused all of them (nothing left the machine), and then with
api.cps.service/api.krs.service/api.codewhisperer.service pointed at a
local recorder:
- asks GetProfile (POST management/, X-Amz-Target
AmazonCodeWhispererService.GetProfile, body {}) in us-east-1, then
eu-central-1, then GovCloud and ISO, and with every one refused goes on
to list models and chat in us-east-1 all the same;
- lists models with the control plane's ListAvailableModels (POST
management/?origin=KIRO_CLI, X-Amz-Target
KiroControlPlaneBearerService.ListAvailableModels, body
{"origin":"KIRO_CLI"}, paged with nextToken), not the REST
List-Available-Models with a profileArn;
- reads credits with GetUsageLimits (same shape, body {"origin":"KIRO_CLI"});
- names no profileArn in generateAssistantResponse, ListAvailableModels
or GetUsageLimits, even when GetProfile gave one;
- sends each with Content-Type application/x-amz-json-1.0,
Authorization: Bearer <key>, tokentype: API_KEY (as the plugin did).
The plugin now does the same for an API key: GetProfile in us-east-1 then
eu-central-1, once per key; a found profile only picks the region; none
found means us-east-1. Its models are ListAvailableModels as above, its
credits GetUsageLimits as above, and its chat names no profile. Sign-ins
other than an API key are unchanged.
Run, in packages/kiro, H=$(mktemp -d); HOME="$H" bun test: 55 pass at
this head (rebased on origin/main
|
||
|
|
7fdc07f150 |
kiro 0.1.14: an account is named by its email and the way it was signed in to, "email (Google)", "email (GitHub)" (#309)
magpie names a plugin's account by its accountId (host.js whoOf) and,
when two read the same, adds the slot: molvqingtai's Google and GitHub
accounts of one email read "email (uid-slot)". The accountId is now the
email and the way, as Kiro's sign-in page names it: Google, GitHub,
Builder ID, IAM Identity Center, Internal. A way not known (kiro-cli's
or the Kiro IDE's sign-in, which carry no loginProvider) keeps the bare
email, and magpie's slot stays the fallback.
- browserSignIn's success names the account so.
- An account kept by its bare email, with a known loginProvider, is
given the name the way the uid was in 0.1.13: by the save after a
request, model listing or usage read (once per token), and in
auth.refresh's result (host.js renew merges it over the old).
- Sibling: usage's user is the same name for a sign-in kept here
(magpie's quota card shows it); kiro-cli's and the IDE's stay bare.
The window: magpie's settle (internal/plugin/host.js) replaces an account
only when whoOf (the accountId) is equal and the uids don't differ. An
old account still named "email", signed in again the same way before
its first use on 0.1.14, has "email (Google)" against "email" and is
kept beside it as a second account. The plugin can't close it: its
client.auth has set/remove for the account in scope only, and a sign-in
result is matched by name alone. Any use (magpie's usage read, a
request, a renewal) renames it first, after which the sign-in replaces
it. Said in the README.
Run at
|
||
|
|
d767d1c8e6 |
kiro 0.1.13: a Google and a GitHub sign-in of one email are two accounts, not one replacing the other (#309)
molvqingtai: Kiro keeps a GitHub and a Google sign-in that share an
email as two accounts, but only one could be added; the second replaced
the first. The plugin named each sign-in by its email alone, and magpie's
host.js settle (internal/plugin/host.js:1022) replaces an account whose
accountId is the new sign-in's, unless both carry a uid and the two
differ (the rule WorkBuddy's uid uses, #413).
Each browser sign-in now carries uid = its way in, lowercased (google,
github, builderid, enterprise, internal). accountId stays the email, so:
- Google and GitHub (or Builder ID) of one email are kept side by side;
magpie labels the two rows apart by their slot.
- A sign-in again the same way still replaces its own account.
- An account saved before 0.1.13 (bare email, loginProvider kept, as the
built-in's mover also saved it) still matches a sign-in again, so no
duplicate appears. It is given its uid from loginProvider on its first
request, model listing or usage read (one save per token), and on
magpie's renewal (auth.refresh returns uid with the token). Until then,
a sign-in the other way of the same email would still replace it, as
before; magpie lists each account's models when its host starts, so
that window is the time to the first listing.
Not changed: kiro-cli's and the IDE's sign-in (a pointer to whatever they
are signed in to; kiro-cli's social token doesn't say Google or GitHub)
keeps no uid and matches by email as before. Two Identity Center orgs
with one email are still one (both "enterprise"). Kiro's userInfo gives
no per-account id this plugin reads; none was assumed.
Run at this tree (origin/main
|
||
|
|
060bda8f65 |
kiro 0.1.12: a request's structured output (output_config.format) is told in the system prompt, as the built-in told it
Kiro's generateAssistantResponse has no field for the answer's format, so magpie's built-in Kiro (internal/gateway/kiro.go, req.inSystem()) told the model the schema at the end of the system prompt: "Respond with a single JSON value and nothing else, matching this JSON schema:\n<schema>." The plugin dropped output_config.format, and magpie's generic plugin path falls back to inSystem only when an upstream answers 400 naming the format, which the plugin never did, so a moved user asking for JSON got prose. buildKiro now says the schema the same way, after the caller's system prompt and before the thinking budget prefix. The AI SDK's output_format is read too. A JSON object with no schema needs nothing here: magpie's Anthropic body already tells it in the system prompt. Run: HOME=$(mktemp -d) bun test in packages/kiro: 46 pass, 0 fail. structured-output.test.mjs: 3 of its 4 tests red with the index.mjs change taken out (the fourth checks a request with no format is unchanged). bun scripts/check.mjs kiro: ok. Not run: a real Kiro account, nor magpie end to end. |
||
|
|
779e9b2368 |
kiro 0.1.11: a thinking model offers xhigh as its own level, so Claude Code's xhigh isn't routed as max (#120)
The variants came from BUDGETS (low, medium, high, max), while thinking() already read xhigh. magpie fits an effort the model doesn't offer to the nearest it does, so Claude Code's xhigh on a moved Kiro was recorded and sent as max: 166 of the reporter's requests on 10-14, after the built-in, which takes xhigh, had served it as xhigh the day before. BUDGETS now has xhigh at 50k, the budget thinking() and the built-in's kiroThinkingBudget give it, so what Kiro is asked is unchanged; only the level magpie records and passes is. Both configModel and runtimeModel read BUDGETS. Run: bun test across the repo (TMPDIR+HOME in the scratchpad), all pass; the new effort.test.mjs fails on the old BUDGETS. Not tried with a real Kiro account (none signed in on this machine). |
||
|
|
386a2ba5ad |
kiro 0.1.10: the caller's prompt-cache marks reach Kiro as cachePoints (#110)
What: buildKiro dropped every cache_control, so Kiro was never asked to
cache a prompt and its tokenUsage reported no cache reads ("kiro cli
cache 率为 0"). Kiro's generateAssistantResponse takes Bedrock's cachePoint
({"type":"default"}) on a userInputMessage, on an assistantResponseMessage
and as an entry of the tools: the CodeWhisperer streaming model's
UserInputMessage.cachePoint, AssistantResponseMessage.cachePoint and
Tool::CachePoint (aws/amazon-q-developer-cli's generated client), and
Kiro CLI 2.27's model list carries supportsPromptCaching and
maximumCacheCheckpointsPerRequest. A message holding a marked block now
gets a cachePoint on the entry it ends up in (merged turns included; a
marked system prompt marks the first message, where the instructions
go), and a marked tool is followed by a cachePoint entry, as kirocc and
AIClient2API send. Four at most, the last kept, as Anthropic allows.
conversationId is left per request: a cachePoint caches the prompt's
prefix, not a conversation.
Run: TMPDIR=<scratch> HOME=<scratch> bun test (1191 pass, 0 fail) and bun
scripts/check.mjs kiro. cache-points.test.mjs's first fixture places the
marks where a captured Claude Code 2.1.296 request had them (two system
blocks and the trailing system-role hook message; texts cut short); the
second is the shape magpie's buildAnthropic hands a plugin for a
translated request. With the two cachePoint lines taken out, 3 of its 4
tests fail. Not tried against a real Kiro account (none signed in here),
so whether Kiro then reports cacheReadInputTokens is not seen yet.
|
||
|
|
66facacf14 |
kiro 0.1.9: a tool's images reach the model, as the built-in sends them (yetone/magpie#1861)
What: buildKiro read a tool_result's content for its text alone, so an image a tool returned (Codex's view_image, a computer-use screenshot, Claude Code's Read of a PNG) never reached Kiro: the model got "(no output)" and said it saw nothing. Its image blocks (base64) now go with the message that answers the call, beside any image the user sent, as magpie's built-in has sent them since yetone/magpie#369. Kiro's tool results hold text alone. The "only the latest images" rule is unchanged; an image named only by a URL still has no bytes to send and is left out. Why: simonsmh reported Codex's view_image unreadable through Kiro on magpie v0.1.1215 (#1861). A moved Kiro is served by this plugin, which never got #369's fix. Run: HOME=<scratch> TMPDIR=<scratch> bun test (1152 pass, 0 fail) and bun scripts/check.mjs. tool-images.test.mjs's fixture is the Anthropic body magpie's gateway hands the plugin for Codex 0.162's view_image output ([{"type":"input_image","image_url":"data:...","detail":"high"}]), dumped from magpie's buildAnthropic; 3 of its 4 tests fail on 0.1.8. Not tried against a real Kiro account (none signed in here); #369 checked the same body shape on the built-in against a real account. |
||
|
|
e1efc3d623 |
kiro 0.1.8: a tool named past 64 characters is sent under a short name, and its calls come back under the caller's (yetone/magpie#1393)
Kiro answers a tool name longer than 64 characters "Invalid tool use format." (REQUEST_BODY_INVALID), and has declined to raise the limit (kirodotdev/Kiro#7684). Claude Code names a plugin's MCP tools mcp__plugin_<plugin>_<server>__<tool>, e.g. the Cloudflare plugin's mcp__plugin_cloudflare_cloudflare-docs__search_cloudflare_documentation (71), so every turn that offered it failed. The plugin passed t.name through as it was. toolName keeps a name of [a-zA-Z0-9_-]{1,64} as it is; any other becomes its head (other characters as _) plus _ and 12 hex of its sha256, at most 64 characters. It is the same each turn, so the declaration, the history's toolUses and the tools declared for the history all agree without state. toolNames maps each such name back from the request's tools and history, and reply gives the caller's name on tool_use blocks, streamed and not. Results pair by toolUseId, which is unchanged. tool-names.test.mjs (the reporter's 71- and 70-character names) fails 3 of 3 without the change and passes; HOME=$(mktemp -d) bun test: 1003 pass, 0 fail across the repo; bun scripts/check.mjs kiro passes. Not tried against Kiro itself: no Kiro sign-in on this machine. |
||
|
|
f35c18981c |
kiro tests: a turn's parallel tool_use split over two assistant messages keeps its results (yetone/magpie#1275)
buildKiro already joins consecutive assistant messages, so #1275's request reaches Kiro with both calls in one assistantResponseMessage and both real results after; a call that went unanswered is still answered for. The test keeps it so. Test-only, no version bump; HOME=$(mktemp -d) bun test (30 pass, 0 fail) and bun scripts/check.mjs pass. |
||
|
|
b5fc67f0f4 | kiro 0.1.7: a Builder ID sign-in is asked with Builder ID's service profile, so its models are listed and served, as the built-in (#16, YuanZhe-99: a Kiro Student account moved to the plugin was offered no claude-opus-5.5 or claude-sonnet-5.5, which the built-in listed) — a Builder ID sign-in (kiro-cli's, the Kiro IDE's or one made here) names no profile, and Kiro won't list one for it: List-Available-Profiles answers 403 "AWS Builder ID is not supported for this operation" in both regions, so profileOf threw, provider.models fell back to Auto alone, and usage and chat failed. magpie's built-in has asked such a sign-in with the service profile kiro-cli and the IDE use (arn:aws:codewhisperer:us-east-1:638616132270:profile/AAAACCCCXXXX) since magpie 40102f74 (yetone/magpie#422); the plugin now does as it does: kiro-cli's odic sign-in with Builder ID's start URL or none, the IDE's with provider BuilderId, and one signed in here (or moved from the built-in) with loginProvider BuilderId take it without asking, and an AWS sign-in whose profile listing is that 403 takes it too. Identity Center sign-ins still have their profile listed. builderid.test.mjs (fake management and runtime API: one signed in here lists claude-opus-5.5 and chats under the service profile, the 403 found, Identity Center unchanged, kiro-cli's with and without a start URL, the IDE's) fails 4 of 5 on 0.1.6 and passes; bun test (28 pass) and bun scripts/check.mjs kiro pass under a temp HOME. Checked for real with a Google sign-in (profile listed, models listed, claude-sonnet-4.5 answers): unchanged. Not tried with a real Builder ID or Kiro Student account (none here). | ||
|
|
ce009e60c6 |
kiro 0.1.6: magpie renews the sign-in ahead of time through auth.refresh
auth.refresh with refreshLead 10 minutes (in-fetch: 2) for sign-ins kept in magpie; kiro-cli's and the IDE's (expires 0) are renewed as before. It runs under the request path's per-account lock, and an after map lets a request holding the old token use the new one. Every failure, a refusal included, throws plainly: the built-in never marked a Kiro account lapsed. The check before each request stays for OpenCode, which doesn't call the hook (magpie 0.1.684+ does). refresh.test.mjs fails without the change; HOME=$(mktemp -d) bun test passes (396 across the repo). |
||
|
|
8f25b63718 |
publish from GitHub Actions with npm's trusted publishing, no one-time password [skip ci]
.github/workflows/publish.yml runs the tests (in a throwaway HOME) and scripts/publish.sh on each package.json change pushed to main, or by hand; npm's OIDC exchange stands in for a token and an OTP. Every package now names magpie-community/plugins' publish.yml as its trusted publisher on npmjs.com, and gets the repository field npm checks it against. |
||
|
|
ef81d34320 |
tests: a usage test's offline fetch is put back when its file is done, so the next file doesn't inherit it
bun test runs every file in one process, and three usage tests left globalThis.fetch on a fake of theirs: zcode's (offline, set in a beforeEach, never restored), kiro's and workbuddy's (offline, set at import, never restored). A file run after them got that fake: - minimax's tests (27/27 alone) failed 19 after zcode's usage test: the plugin's requests to the local fake MiniMax went to zcode's offline and threw "no network in tests". - qoder's cn.test.mjs takes globalThis.fetch as the real one when it loads; after kiro's or workbuddy's usage test that was offline, so every request meant for its Bun.serve stand-in threw. The CN sign-in, which polls on through errors, timed out at 10 s and kept polling, and the job-token test timed out too, so a full bun test never finished. Each of the three now keeps the fetch it found and puts it back in afterAll. Test-only; no package version changes. HOME=$(mktemp -d) bun test: 341 pass, 0 fail across 42 files (8.5 s); bun scripts/check.mjs passes. |
||
|
|
01aee5da28 | all: a usage read says what it means for the sign-in, and a renewal clears the mark whatever follows, as the built-ins did (要保证插件跟内置的所有逻辑都要一模一样) — auth.usage returns signIn on every path: expired where the built-in's quota read marked the account (Zed's /users/me 401, Factory's and MiMo's refused renewals, Qoder's refused job refresh), renewed after a renewal, which took the mark off, kept everywhere else, so magpie no longer guesses from the words 'sign in again' (Kiro's, Devin's and ZCode's usage errors marked accounts their built-ins never did) nor clears on a clean read. A request after a renewal says renewed on any status; one without says kept, as the built-ins cleared only on renewal. Kiro, Cursor, Devin, Command Code, WorkBuddy, Grok and ZCode, whose built-ins never marked an account, say kept on every answer. New tests fail against 85d7dd0's index.mjs. | ||
|
|
85d7dd0d0a | all: each plugin fails with its built-in's status and marks the sign-in as it did, through X-Magpie-Sign-In (要保证插件跟内置的所有逻辑都要一模一样) — Factory's and MiMo's refused renewals are the built-ins' 502 marked expired, not 401s; Qoder's vendor 403 is the built-in's 401 kept, its model list's failure a 400, its job refresh refused marked expired; Zed's retried 401 is a 401 kept, not a 403; Kiro's unreachable refresh a 401 kept; Cursor's expired trial a 401 kept; a vendor 401 WorkBuddy, Grok, Devin, Command Code and ZCode passed on no longer marks the account, as their built-ins never did, and Grok and MiMo no longer retry what their built-ins sent once. Messages take the built-ins' words. New tests fail against the previous index.mjs. | ||
|
|
8efe85163c | kiro 0.1.4: an exception Kiro sends before any of the answer (a throttle, a quota, a server error) is a status, not a 200 stream holding an error event, as the built-in's relay answers it: a 429 when it reads as a quota or rate limit (magpie's quotaWords), else a 502, so magpie moves on to the next account exactly as it did; unstreamed, what was said before a later exception is the answer, as the built-in's collector gives it, where the plugin answered 502. errors.test.mjs fails without the change. | ||
|
|
96b3ad276b | kiro 0.1.3: only a sign-in that is gone (a refresh Kiro refused, no refresh token, no sign-in, a refused API key) answers a request with the 401 magpie marks the account lapsed on; a refresh that timed out, failed to connect or met a 5xx is a 502; errors no longer start with "Kiro: ", which magpie adds | ||
|
|
b3a3ae0887 | kiro: a lost sign-in says what magpie's built-in says — add the subscription, sign in with kiro-cli or the IDE, or save an API key; a magpie-added account's is gone and is added again |