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.
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.
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).