Repository navigation
Description
Bug Description
With chat.agentEngine set to v3, the Kiro card shows "Couldn't read usage — no response", and every poll spends real Kiro credits.
KiroCLI.arguments is ["chat", "--no-interactive", "/usage"]. On the v3 engine, /usage is not handled as a local slash command in non-interactive mode. It is sent to the model as a prompt. The agent then tries to work out what /usage means (subagents, web fetches, file reads) until Codenotch's 20s timeout kills it, so the UI never gets a card.
Measured on one Mac over 7 days, from usage_summary entries in Kiro's session files:
- 1,381 agent sessions with cwd
$TMPDIR(Codenotch's working directory) - 807 credits in total, about 0.58 per poll
- Polls ran on the configured default model, here Opus 5 at high effort in autopilot
- Almost all ended
aborted; the partial turns were still billed
This is separate from #220 (stderr capture) and #367 (Windows report). PR #517 does not change the arguments, so it won't fix this.
Steps to Reproduce
Each hanging run spends credits.
- Install kiro-cli 2.37.1 and run
kiro-cli settings chat.agentEngine v3. - Run Codenotch's exact call:
cd "$TMPDIR"
TERM=dumb KIRO_CHAT_UI=classic kiro-cli chat --no-interactive /usage < /dev/nullResult: no card, the model starts working, and the process does not exit by itself within 90s.
Same call with the engine pinned: exit 0 in 2-4s, card on stdout:
TERM=dumb KIRO_CHAT_UI=classic kiro-cli chat --agent-engine v2 --no-interactive /usage < /dev/nullEstimated Usage | resets on <date> | <PLAN>
Credits (<used> of <total> covered in plan), <n>%
Overages: Disabled
Expected Behavior
Reading usage shows the card and never starts a billed model turn, whichever engine is the user's default.
Affected Provider (if applicable)
Kiro
Environment & macOS Version
macOS 27.0.1, kiro-cli 2.37.1 (KAS 0.66.70)
Codenotch Version
1.24.0
Relevant Logs (Unified Log)
kiro-cli stderr during a poll, on v3:
[INFO] kas.server.starting {"product":"KAS (Kiro Agent Server)","version":"0.66.70"}
[INFO] [KRS] <-- GenerateAssistantResponseCommand done totalEvents=9
[tool] Inspect workspace layout and cost data files
[denied] tool permission approval is not supported in non-interactive mode. Use --trust-all-tools to auto-approve.Additional Context
Suggested fix
- Short term: add
--agent-engine v2toKiroCLI.arguments. I tested this flag from the command line; the Swift change itself is untested.--v2also works, but placed beforechat. - Longer term: stop depending on
/usagethroughchat. kiro-cli's own strings say Classic is being deprecated with the 3.0 release, so the v2 pin may not last, and if v3 becomes the default this hits every Kiro user.GetUsageLimitsis already called for enrichment inKiroProvider.enrich()and could become the primary source, with no model involved.
What did not work as a user-side override
KIRO_AGENT_ENGINE=v2in the environment: still ran v3 and hung.kiro-cli settings --workspace chat.agentEngine v2: rejected with "Setting 'chat.agentEngine' cannot be overridden at workspace level".
Workaround without changing the global engine
Point KIRO_CLI_PATH at a wrapper script that adds --agent-engine v2 to this one call. To stop the spend immediately, disable the Kiro provider.
Related: orphaned processes after a timeout
acp-server.js runs in its own process group, so killpg on the kiro-cli pid does not reach it. After each timed-out poll it was reparented to PID 1 and stayed around for several minutes. With a poll every 30s, I saw 3-5 at once, 20-200 MB each.
Separately, quitting Codenotch mid-poll leaves the child running with no timeout. One such v3 poll ran about 60s and cost 2.51 credits before it ended.
Activity
Kiro: name the V2 engine so /usage never reaches the model (#520)
Merge #528: Kiro: name the V2 engine so /usage never reaches the model (