fileEdited Hook session appears in History instead of Current Tasks, clicking it crashes Kiro
Before opening, please confirm:
- [x] I have searched for duplicate or closed issues
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
- Create a
fileEditedhook watchingconfig.yaml - Have an external process (not Kiro) modify
config.yaml - Observe: Hook triggers, but the "Execute hook: ..." session appears in History, not in Current Tasks
- 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
- Create a
fileEditedhook watchingconfig.yaml - Have an external process (not Kiro) modify
config.yaml - Observe: Hook triggers, but the "Execute hook: ..." session appears in History, not in Current Tasks
- 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
🤖 Potential Duplicate Detected
This issue appears to be similar to:
- #5065: fileEdited hooks don't trigger in multi-root workspaces (85% similar)
- #7138: Kiro CLI Bug - AgentSpawn Hook Retries on Every Tool Call (82% similar)
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.
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:
fileEditedhook triggers correctly (single-root workspace)- Hook session appears in History list instead of "Current Tasks" / "Tasks in Queue"
- The session is actually still running despite being in History
- Clicking this misplaced session crashes Kiro ("Extension host terminated unexpectedly")
- 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.
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.
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.