Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

Kiro chat agent cannot read output from commands

Open rossalanmiller opened this issue 1 year ago • 5 comments

Before opening, please confirm:

Operating System

macOS 15.7.2

Kiro Version

0.6.0

Bug Description

Settings in .bash_profile and .bashrc interfere with the agent's ability to parse output (including settings added to support the kiro-cli).

Agent sees no output and always returns error code -1 when iterm shell integrations are enabled

Image Image

Agent shows no output from python commands (pytest) when pre/post sections for kiro-cli are enabled

Image Image

Steps to Reproduce

  1. Install iterm and enable shell integration https://iterm2.com/documentation-shell-integration.html
  2. Install kiro-cli and enable shell integrations for terminal and iterm
  3. Open kiro app.
  4. Ask the agent to run a basic bash command or python script. Shows no output and/or says it encountered a -1 code

Expected Behavior

These bash configurations should not interfere with the kiro app's ability to read command output.

Conversation ID

No response

Additional Context

Mac and kiro info

Image Image

My original .bash_profile and .bashrc

.bash_profile

# Kiro CLI pre block. Keep at the top of this file.
# Kiro cli interferes with kiro???
[[ -f "${HOME}/Library/Application Support/kiro-cli/shell/bash_profile.pre.bash" ]] && builtin source "${HOME}/Library/Application Support/kiro-cli/shell/bash_profile.pre.bash"

# Load homebrew settings
eval "$(/opt/homebrew/bin/brew shellenv)"

# Load default python venv
source ~/venvs/python3.11/bin/activate

# Suppress zsh defaults messages
export BASH_SILENCE_DEPRECATION_WARNING=1

# Force docker to build for amd64 instead of the mac default (arm64)
export DOCKER_DEFAULT_PLATFORM="linux/amd64"

# Add HOME/bin to the path
export PATH="$HOME/bin:$PATH"

# Iterm shell integrations seem to interfere with kiro
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"

# Source .bashrc for interactive features
[[ -f ~/.bashrc ]] && source ~/.bashrc

# Kiro CLI post block. Keep at the bottom of this file.
[[ -f "${HOME}/Library/Application Support/kiro-cli/shell/bash_profile.post.bash" ]] && builtin source "${HOME}/Library/Application Support/kiro-cli/shell/bash_profile.post.bash"

.bashrc

# Kiro CLI pre block. Keep at the top of this file.
# Kiro cli interferes with kiro???
[[ -f "${HOME}/Library/Application Support/kiro-cli/shell/bashrc.pre.bash" ]] && builtin source "${HOME}/Library/Application Support/kiro-cli/shell/bashrc.pre.bash"

# Interactive shell configurations
# Git branch function for prompt
parse_git_branch() {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1='\[\033[32m\]\u\[\033[32m\]@\[\033[32m\]\h\[\033[00m\]\[\033[33m\][\w]\[\033[31m\]$(parse_git_branch)\[\033[00m\]:\$ '

# Aliases
alias code='codium'

# [[ "$TERM_PROGRAM" == "kiro" ]] && . "$(kiro --locate-shell-integration-path bash)"

# Kiro CLI post block. Keep at the bottom of this file.
[[ -f "${HOME}/Library/Application Support/kiro-cli/shell/bashrc.post.bash" ]] && builtin source "${HOME}/Library/Application Support/kiro-cli/shell/bashrc.post.bash"

rossalanmiller avatar Nov 24 '25 17:11 rossalanmiller

Adding a guard around the shell integrations mentioned in https://github.com/kirodotdev/Kiro/issues/5240#issuecomment-3821798969 seems to be a viable work around. At least for myself.

Image

rossalanmiller avatar Feb 05 '26 19:02 rossalanmiller

I found following workaround to work on my setup.

Workaround

Comment out both Kiro CLI shell integration lines in ~/.bashrc:

#[[ -f "${HOME}/.local/share/kiro-cli/shell/bashrc.pre.bash" ]] && builtin source "${HOME}/.local/share/kiro-cli/shell/bashrc.pre.bash"
#[[ -f "${HOME}/.local/share/kiro-cli/shell/bashrc.post.bash" ]] && builtin source "${HOME}/.local/share/kiro-cli/shell/bashrc.post.bash"

Environment

  • Product: Kiro IDE updated 18.6.2026
  • OS: openSUSE Linux (SUSE-based)
  • Shell: bash

mikahaht avatar Mar 18 '26 10:03 mikahaht

I dug into this pretty extensively and found something that reframes the issue — during blackout periods, commands aren't executing at all. The tool reports exit 0 with empty output, but nothing actually runs.

Proof: date > /tmp/test.txt reports exit 0 — file never gets created. this_command_does_not_exist — also exit 0. The response is fabricated.

The interesting part: control_bash_process + get_process_output works 100% of the time in the same session where execute_bash is completely dead. They use different output capture mechanisms but share terminal infrastructure (confirmed — a ^C from stopping a background process leaked into the next execute_bash output).

Even weirder: starting and stopping a background process temporarily "unsticks" execute_bash for ~3-5 commands before it goes dark again. Reproducible.

On the shell side, I progressively eliminated hooks (nvm → autosuggestions → conda → spaceship → oh-my-zsh entirely). Skipping oh-my-zsh gets you from 0% to ~60% capture, but even with zero hooks and a bare %~ %# prompt, it still drops ~40%.

My takeaway; shell config is a contributing factor, not the root cause.

Setup: macOS 26.5 arm64, Kiro 1.0.0, zsh 5.9, oh-my-zsh + spaceship

Suggestions:

  • execute_bash could use whatever mechanism control_bash_process uses — that one just works
  • If output + exit code are both empty/0, retry or mark the terminal unhealthy
  • An env var like KIRO_AGENT_TERMINAL=1 for agent-only terminals would let users keep their full shell in manual terminals (currently TERM_PROGRAM and VSCODE_SHELL_INTEGRATION are identical in both)

gfargo avatar Jun 20 '26 15:06 gfargo

Quick follow-up: found that #9483 (filed against 1.0.0, Jun 17) describes this same issue with additional context — the reporter notes it correlates with "context entry" boundaries between turns. My comment there has the same data cross-referenced: https://github.com/kirodotdev/Kiro/issues/9483#issuecomment-4760895857

gfargo avatar Jun 21 '26 04:06 gfargo

Closing this issue as it was reported against an older version of Kiro (v0.x or early v1.x) and has had no activity in several months.

Kiro has shipped significant improvements since these versions, including stability fixes, new features, and major changes across v1.0, v1.1, v2.x, and the current v2.23.x releases. The behavior described here may already be resolved.

If this is still affecting you on the latest version, please open a new issue at https://github.com/kirodotdev/Kiro/issues/new with your current version (kiro-cli --version or Help > About in the IDE), your OS, and steps to reproduce. The latest version is available at https://kiro.dev/downloads/ or via kiro-cli update.

Thank you for taking the time to report this.

AnilMaktala avatar Sep 24 '26 13:09 AnilMaktala