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).
This commit is contained in:
yetone
2026-10-14 17:28:46 +08:00
parent 15d16f5ff0
commit 779e9b2368
4 changed files with 22 additions and 4 deletions
+2 -1
View File
@@ -85,7 +85,8 @@ request:
tool calls and usage. When Kiro reports only how full the context is,
input tokens are estimated from that.
- Thinking (Claude models and Auto) is asked for the way kiro-cli asks, in
the prompt, with a budget: low 10k, medium 20k, high 30k, max 50k. The
the prompt, with a budget: low 10k, medium 20k, high 30k, xhigh and max
50k (as magpie's built-in Kiro: #120). The
`<thinking>` block of the reply comes back as thinking.
- Kiro's failures keep their meaning:
- input too long → 400
+15
View File
@@ -0,0 +1,15 @@
import { test, expect } from "bun:test"
import { _internal } from "./index.mjs"
// Claude Code's levels are low, medium, high, xhigh and max: a thinking
// model offers each, so xhigh isn't routed as max (#120)
test("a thinking model offers xhigh as its own level", () => {
const m = { id: "claude-opus-5.5", name: "Claude Opus 5.5", context: 200000 }
for (const got of [_internal.configModel(m), _internal.runtimeModel(m)]) {
expect(Object.keys(got.variants)).toEqual(["low", "medium", "high", "xhigh", "max"])
expect(got.variants.xhigh).toEqual({ thinking: { type: "enabled", budgetTokens: 50000 } })
}
expect(_internal.thinking({ output_config: { effort: "xhigh" } }, "claude-opus-5.5")).toBe(50000)
// a model that doesn't think offers none
expect(_internal.configModel({ id: "deepseek-3.2", name: "DeepSeek" }).variants).toBeUndefined()
})
+4 -2
View File
@@ -503,7 +503,9 @@ function account(client) {
const windows = new Map() // a model's context, as Kiro last listed it
const thinks = (id) => /claude/i.test(id) || id === "auto"
const BUDGETS = { low: 10000, medium: 20000, high: 30000, max: 50000 }
// the levels a thinking model offers, as the built-in thinks them (xhigh as
// long as max: #120)
const BUDGETS = { low: 10000, medium: 20000, high: 30000, xhigh: 50000, max: 50000 }
function configModel(m) {
return {
@@ -1516,4 +1518,4 @@ export async function KiroAuthPlugin({ client } = {}) {
}
// for tests
export const _internal = { generate, refresh, usageOf, buildKiro, events, reply, failure, toolID, toolName, toolNames, thinking, readCLI, readIDE, regionOf, planName, frames }
export const _internal = { generate, refresh, usageOf, buildKiro, events, reply, failure, toolID, toolName, toolNames, thinking, configModel, runtimeModel, readCLI, readIDE, regionOf, planName, frames }
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@magpie-community/opencode-kiro-auth",
"version": "0.1.10",
"version": "0.1.11",
"description": "Kiro subscriptions (Free, Pro, Pro+, Power) in OpenCode and magpie",
"type": "module",
"main": "./index.mjs",