[PR #1149] [MERGED] fix(hooks): prevent session_complete hook from firing on subagent sessions #9831

Closed
opened 2026-02-16 18:14:14 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1149
Author: @timoclsn
Created: 7/19/2025
Status: Merged
Merged: 7/19/2025
Merged by: @adamdotdevin

Base: devHead: fix-session-complete-hook-firing-on-subagent-sesssions


📝 Commits (1)

  • 0574c89 fix(hooks): prevent session_complete hook from firing on subagent sessions

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 packages/opencode/src/config/hooks.ts (+5 -1)

📄 Description

Only fire the session_complete hook for top-level sessions. I think that is the more expected behavior. For example, when using it for notifications when the agent is done.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1149 **Author:** [@timoclsn](https://github.com/timoclsn) **Created:** 7/19/2025 **Status:** ✅ Merged **Merged:** 7/19/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `fix-session-complete-hook-firing-on-subagent-sesssions` --- ### 📝 Commits (1) - [`0574c89`](https://github.com/anomalyco/opencode/commit/0574c89989cea94dd1d7cb183bfa24d4bb635688) fix(hooks): prevent session_complete hook from firing on subagent sessions ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/config/hooks.ts` (+5 -1) </details> ### 📄 Description Only fire the session_complete hook for top-level sessions. I think that is the more expected behavior. For example, when using it for notifications when the agent is done. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:14 -05:00
yindo closed this issue 2026-02-16 18:14:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9831