Skip to content

Commit e84dc32

Browse files
committed
fix: suppress stop notifications for subagent sessions
Fetch the session on session.idle to check for parentID. If the session is a child (subagent) session, return early without sending a stop notification. Falls through on fetch failure so notifications are never silently dropped. Bump version to 0.1.7.
1 parent b392a9f commit e84dc32

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@warp-dot-dev/opencode-warp",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
44
"description": "Warp terminal integration for OpenCode — native notifications and more",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { truncate, extractTextFromParts } from "./utils"
99
// NOTE: do not `export` this constant — opencode's legacy plugin loader
1010
// treats every named export as a plugin function and throws if any export
1111
// is not a function ("Plugin export is not a function").
12-
const PLUGIN_VERSION = "0.1.6"
12+
const PLUGIN_VERSION = "0.1.7"
1313
const NOTIFICATION_TITLE = "warp://cli-agent"
1414

1515
function sendPermissionNotification(perm: Permission, cwd: string): void {
@@ -90,8 +90,17 @@ export const WarpPlugin: Plugin = async ({ client, directory }) => {
9090
case "session.idle": {
9191
const sessionId = event.properties.sessionID
9292

93-
// Fetch the conversation to extract last query and response
94-
// (port of on-stop.sh transcript parsing)
93+
if (sessionId) {
94+
try {
95+
const session = await client.session.get({
96+
path: { id: sessionId },
97+
})
98+
if (session.data?.parentID) return
99+
} catch {
100+
// If we can't fetch the session, fall through and notify anyway
101+
}
102+
}
103+
95104
let query = ""
96105
let response = ""
97106

0 commit comments

Comments
 (0)