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.