Skip to content

use_subagent tool broken in --tui mode #3680

@MikaelUlvesjo

Description

@MikaelUlvesjo

Checks

Operating system

Linux 5.15.0-168-generic - Ubuntu 22.04.5 LTS

Expected behaviour

When running kiro-cli chat --tui with an agent that has subagents configured
(via toolsSettings.subagent.availableAgents), the use_subagent tool should
accept ListAgents and InvokeSubagents commands as documented and as they
work in non-TUI mode.

Actual behaviour

The TUI mode rejects both commands with a schema validation error:

Failed to parse the tool use: The tool input does not match the tool schema:
unknown variant ListAgents, expected list_agents or invoke_subagents

Using the snake_case variants partially works — list_agents succeeds but
invoke_subagents fails with:

Failed to parse the tool use: The tool input does not match the tool schema:
missing field subagents

Steps to reproduce

  1. Create an orchestrator agent (~/.kiro/agents/my-orchestrator.json):
    • "tools": ["use_subagent"]
    • "toolsSettings": { "subagent": { "availableAgents": ["my-worker"] } }
  2. Create a worker agent (~/.kiro/agents/my-worker.json)
  3. Ensure kiro-cli settings chat.enableSubagent true
  4. Start with TUI: kiro-cli chat --tui --agent my-orchestrator
  5. Ask something that triggers subagent delegation
  6. Observe the enum parse error
  7. Restart without --tui: kiro-cli chat --agent my-orchestrator
  8. Same request works correctly

Environment

<This will be visible to anyone. Do not include personal or sensitive information>

[q-details]
version = "1.28.1"
hash = "fc92565d6f51c1708e92500b2b2bcc4a424f5705"
date = "2026-03-21T05:18:11.590914Z (2d ago)"
variant = "minimal"

[system-info]
chip = "Intel(R) Xeon(R) Gold 6338 CPU @ 2.00GHz"
total-cores = 8
memory = "62.79 GB"

[system-info.os.linux]
kernel_version = "5.15.0-168-generic"
id = "ubuntu"
name = "Ubuntu"
pretty_name = "Ubuntu 22.04.5 LTS"
version_id = "22.04"
version = "22.04.5 LTS (Jammy Jellyfish)"

[environment]
cwd = "/local/workspace/pas-nonfunctional-tests"
cli-path = "/local/workspace/pas-nonfunctional-tests"
os = "Linux"
shell-path = "/usr/bin/bash"
shell-version = "5.1.16"
install-method = "unknown"

[env-vars]
DISPLAY = ":1"
PATH = "/home/USER/.local/bin:/usr/local/bin"
Q_SET_PARENT_CHECK = "1"
SHELL = "/bin/bash"
TERM = "xterm-256color"
XDG_CURRENT_DESKTOP = "MATE"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions