agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

[Bug]: Kiro preToolUse maps to sticky Input needed with no approval observation path

Open LaibaFirdouse opened this issue 1 month ago • 0 comments

Bug

Kiro TUI sessions can show Summary → Activity as Input needed for ordinary tool use and keep that status sticky until a turn-boundary-style clear. AO installs Kiro preToolUse as permission-request, and StandardDeriveActivityState maps that to sticky waiting_input.

Related: parent family bug #6280 (Copilot / Cline / Kiro). Copilot will be fixed separately via observe-hooks . This issue tracks Kiro-only follow-up.

Code-path confidence: High on current main (hook install + mapping). No separate live TUI recording attached here; behavior follows from the same path called out in #6280.

Reproduction

  1. Start a Kiro TUI session and invoke a tool (interactive approval via Kiro’s permission UI, or an auto/trust path).
  2. Observe Activity when AO’s preToolUse hook runs (ao hooks kiro permission-request).
  3. After the tool is allowed / while tools continue, check whether Activity remains Input needed until stop or the next userPromptSubmit.

Expected: Input needed only while a human decision is actually pending; clear when work resumes after approval.

Actual: Every managed preToolUse enters sticky waiting_input, including tools that never need a human decision. There is no AO terminal waiting-recovery path for Kiro today.

Root cause

  • backend/internal/adapters/agent/kiro/hooks.go — preToolUse → permission-request (ActivityWaitingInput).
  • backend/internal/adapters/agent/activitystate/activitystate.go — name-only sticky waiting_input.
  • Managed hooks are agentSpawn, userPromptSubmit, preToolUse, stop — no post-tool clear; no typed permission-notification hook like Copilot’s notification.permission_prompt.
  • No DetectTerminalActivity implementation for Kiro.
  • Real approvals are owned by Kiro’s permissions.yaml / interactive UI (and PreToolUse can block via exit 2); AO’s install does not expose a Copilot-like ask/allow observe contract.

Fix direction

  1. Stop mapping preToolUse → permission-request / waiting_input (treat as active / tool-use).
  2. Restore real Input needed ,add terminal approval detection, and/or use ACP Chat approval events if/when Kiro Chat is available (#5604).
  3. Remap-only without (2) would hide pending TUI approvals until observation exists — same family tradeoff as closed AO PR #2594.

LaibaFirdouse avatar Oct 08 '26 06:10 LaibaFirdouse