Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

fileEdited Hook session appears in History instead of Current Tasks, clicking it crashes Kiro

Open rekkles-liu opened this issue 7 months ago • 4 comments

Before opening, please confirm:

Operating System

Windows11

Kiro Version

1.107.1

Bug Description

Environment

  • OS: Windows
  • Kiro Version: 1.107.1

Description

When a fileEdited hook is triggered by an external process modifying a watched file, the hook execution session appears directly in the Chat History list instead of "Current Tasks" / "Tasks in Queue". The session is actually still running.

Clicking on this running-but-misplaced session in History causes Kiro to crash ("Extension host terminated unexpectedly") and reload.

Steps to Reproduce

  1. Create a fileEdited hook watching config.yaml
  2. Have an external process (not Kiro) modify config.yaml
  3. Observe: Hook triggers, but the "Execute hook: ..." session appears in History, not in Current Tasks
  4. Click on that History entry → Kiro crashes

Expected Behavior

  • Hook session should appear in "Current Tasks" while running
  • Move to History only after completion
  • Clicking any session should never crash Kiro

Actual Behavior

  • Hook session goes directly to History while still executing
  • Clicking it crashes the extension host
  • Leaves behind corrupted 0.8KB session files

Additional Context

This happens consistently with fileEdited hooks triggered by external processes. Over time, dozens of corrupted session files accumulate in: %APPDATA%\Kiro\User\globalStorage\kiro.kiroagent\workspace-sessions\ undefined

Steps to Reproduce

Steps to Reproduce

  1. Create a fileEdited hook watching config.yaml
  2. Have an external process (not Kiro) modify config.yaml
  3. Observe: Hook triggers, but the "Execute hook: ..." session appears in History, not in Current Tasks
  4. Click on that History entry → Kiro crashes

Expected Behavior

Expected Behavior

  • Hook session should appear in "Current Tasks" while running
  • Move to History only after completion
  • Clicking any session should never crash Kiro

Conversation ID

No response

Additional Context

No response

rekkles-liu avatar Apr 11 '26 10:04 rekkles-liu

🤖 Potential Duplicate Detected

This issue appears to be similar to:

What happens next?

  • ⏰ This issue will be automatically closed in 3 days
  • 🏷️ If this is not a duplicate, you can prevent automatic closure by adding a comment or reacting with 👎 to this message.
  • 💬 Comment on the original issue if you have additional information

Why is this marked as duplicate? Both issues are specifically about fileEdited hooks not functioning correctly - the new issue reports hooks appearing in wrong UI location and crashing, while #5065 reports hooks not triggering at all in multi-root workspaces. Both are core fileEdited hook functionality problems.

github-actions[bot] avatar Apr 11 '26 10:04 github-actions[bot]

This is not a duplicate of either issue.

Difference from #5065: My hook DOES trigger successfully in a single-root workspace. The problem is what happens AFTER it triggers — the session appears in Chat History instead of Current Tasks, even though it's still actively running.

Difference from #7138: This is about Kiro IDE (GUI), not kiro-cli. The issue is not about hook retries, but about incorrect session state management — the hook execution session is misplaced in the UI, and clicking it crashes the extension host.

My specific issue:

  1. fileEdited hook triggers correctly (single-root workspace)
  2. Hook session appears in History list instead of "Current Tasks" / "Tasks in Queue"
  3. The session is actually still running despite being in History
  4. Clicking this misplaced session crashes Kiro ("Extension host terminated unexpectedly")
  5. Leaves behind corrupted ~0.8KB session files in globalStorage

This is a session state management / UI routing bug, not a hook triggering or retry bug.

rekkles-liu avatar Apr 14 '26 00:04 rekkles-liu

Thank you for your feedback! 🙏

The duplicate label has been removed and this issue has been sent back for maintainer review.

A maintainer will review this issue shortly.

github-actions[bot] avatar Apr 14 '26 00:04 github-actions[bot]

Hi, just checking in to see if the team has had a chance to review this issue.

This bug causes a running fileEdited hook session to appear in History instead of Current Tasks, and clicking it consistently crashes Kiro with an “Extension host terminated unexpectedly” error. It also leaves behind a corrupted session file.

Since this affects the GUI session state and leads to IDE instability, could you please let me know if this has been added to the fix queue or if any update is available?

Thank you for your time and help.

rekkles-liu avatar Jun 07 '26 06:06 rekkles-liu