Skip to content

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

@rekkles-liu

Description

@rekkles-liu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions