Skip to content

kiro-cli v3: --no-interactive with a V2 agent exits 4 and only suggests /upgrade-agent, which a script cannot run #12110

Open

Description

@peepeepopapapeepeepo

Before opening, please confirm:

Operating System

Amazon Linux 2023 (x86_64); also macOS

Kiro Version

kiro-cli 2.34.0 (agent engine V3)

Bug Description

When chat.enableAutoAgentUpgrade is not true (it is unset on a fresh install, and stays off if the user answers "Not now" to the first-run upgrade offer), a non-interactive run with a V2-format agent fails with exit code 4:

Error: agent "v2agent" needs upgrading for this agent engine, using "default" — run /upgrade-agent to convert v2agent.json

The message points to /upgrade-agent, an interactive slash command. A non-interactive command already exists (kiro-cli agent upgrade <DIR>, with --dry-run and --no-backup) and fixes the file, but the error does not mention it. Shared agent files (zips, repos) are often still V2, so CI jobs and scripts hit this first. The text using "default" also suggests the run continues with the default agent, but it exits.

Steps to Reproduce

  1. kiro-cli settings chat.enableAutoAgentUpgrade false (or use a fresh install where the key is unset).
  2. In an empty folder, create .kiro/agents/v2agent.json:
    {"name":"v2agent","description":"v2 style","prompt":"You are a helper.","tools":["fs_read"],"allowedTools":["fs_read"],
     "toolsSettings":{"fs_write":{"allowedPaths":["./out/**"]}}}
  3. kiro-cli chat --agent v2agent --no-interactive "Reply with only OK."; echo $?. Observed: the error above, then 4.
  4. kiro-cli agent upgrade .kiro/agents. Observed: ✓ upgraded v2agent.json / 1 upgraded · 0 unchanged/skipped · 0 errors. Step 3 now succeeds.

With chat.enableAutoAgentUpgrade true, step 3 upgrades the file in place (leaving v2agent.json.bak) and succeeds.

Expected Behavior

  • The error names the non-interactive fix, for example run "kiro-cli agent upgrade .kiro/agents" (or /upgrade-agent in chat).
  • The message matches what happens (it exits; it does not continue with default).
  • Optionally, a flag for one-shot runs that upgrades (or loads V2 configs) without changing the global setting.

Conversation ID

No response

Additional Context

Related, not the same: #11127 (/upgrade-agent leaves stale keys and .bak files).

Activity

  1. github-actions commented on Oct 25, 2026

    @github-actions

    Thanks for filing this detailed issue and the clear reproduction steps! You've highlighted a real usability gap where non-interactive/CI workflows hit a dead end when encountering V2 agents, since the error only points to an interactive command. A maintainer will take a look at this shortly — really appreciate you taking the time to document both the problem and the existing workaround so thoroughly! 🙌

  2. AnilMaktala commented on Oct 26, 2026

    @AnilMaktala
    Contributor

    Thanks for raising this.

    When chat.enableAutoAgentUpgrade is not set (the default on a fresh install), running kiro-cli chat --no-interactive with a V2-format agent exits with code 4 and suggests running /upgrade-agent interactively. Since a script cannot run that slash command, there is no non-interactive path to handle V2 agents without manual intervention, making kiro-cli automation break silently on fresh installs.

    Marking this as a bug to investigate further.

  3. added theissue type on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions