Skip to content

bug: use_subagent returns EmptyResponse in --no-interactive mode #3835

@lazy-developer-dot

Description

@lazy-developer-dot

Checks

Operating system

  • kiro-cli 2.6.0 - Linux (WSL2 Ubuntu 24.04, glibc 2.39)

Expected behaviour

Orchestrating Agent call subagent successfully

Actual behaviour

While building an agent evaluation system (parent agent orchestrating specialized sub-agents), we discovered that sub-agent responses are lost when running in --no-interactive mode. The sub-agent executes fully (reads files, writes results), but its final text response is never returned to the parent agent.

Steps to reproduce

Reproduce

kiro-cli chat --agent repro-parent --no-interactive "call the child agent to process /tmp/repro_input.txt"

Expected

Parent receives child's text response (analysis + confirmation)

Actual

Parent reports EmptyResponse. But /tmp/repro_output/result.json IS written correctly by the child.

See repro_output.log for full output.

Key Findings

Mode Child Response Type Result
--no-interactive Multi-line text after fs_write ❌ EmptyResponse (100%)
--no-interactive Single short line after fs_write ✅ Works (0% failure)
Interactive (tty) Multi-line text after fs_write ✅ Works (0% failure)
--no-interactive Multi-line text without fs_write ✅ Works (0% failure)

The bug requires ALL of:

  1. --no-interactive mode (no tty)
  2. Sub-agent uses fs_write tool
  3. Sub-agent responds with multi-line text after writing

Workaround

Change child prompt ending from:

IMPORTANT: You MUST write the result file AND respond with a natural language confirmation. Do not respond with only JSON.

To:

IMPORTANT: After writing the result file, respond with ONLY this exact text: 'DONE:case-001:PASS'. Nothing else.

See repro_output_short_reply.log for successful output with workaround.

Files

  • repro-parent.json — minimal parent agent (only use_subagent tool)
  • repro-child.json — child agent that triggers bug (fs_read + fs_write + multi-line response)
  • repro_output.log — output showing EmptyResponse (bug)
  • repro_output_short_reply.log — output showing success (workaround)

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions