aboutsummaryrefslogtreecommitdiff
path: root/src/integration/assets/omp
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-07-24 02:49:33 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-24 02:50:58 +0300
commite608a75159fc5cca70485d83ffb8ee681c9da385 (patch)
tree5ffdec62d0bee9a798418d6414ecbddae7ff8ae5 /src/integration/assets/omp
parent169a4fd90c20a00aec77d684ecec98b9f0f996cc (diff)
fix: make known-agent exit process-owned
refs #1792 refs #1648
Diffstat (limited to 'src/integration/assets/omp')
-rw-r--r--src/integration/assets/omp/herdr-agent-state.ts35
1 files changed, 4 insertions, 31 deletions
diff --git a/src/integration/assets/omp/herdr-agent-state.ts b/src/integration/assets/omp/herdr-agent-state.ts
index 350cdea7..b3f88c93 100644
--- a/src/integration/assets/omp/herdr-agent-state.ts
+++ b/src/integration/assets/omp/herdr-agent-state.ts
@@ -2,7 +2,7 @@
// managed by herdr; reinstalling or updating the integration overwrites this file.
// add custom hooks/plugins beside this file instead of editing it.
// HERDR_INTEGRATION_ID=omp
-// HERDR_INTEGRATION_VERSION=6
+// HERDR_INTEGRATION_VERSION=7
// @ts-nocheck
import net from "node:net";
@@ -168,29 +168,6 @@ function sendState(state: AgentState, message?: string, seq = nextReportSeq()):
});
}
-function releaseAgent(): Promise<void> {
- return sendRequest({
- id: `${source}:release:${Date.now()}:${Math.random().toString(36).slice(2)}`,
- method: "pane.release_agent",
- params: {
- pane_id: paneId,
- source,
- agent: "omp",
- seq: nextReportSeq(),
- },
- });
-}
-
-function shouldReleaseOnSessionShutdown(event: any): boolean {
- // OMP tears down and rebinds extension runtimes for internal lifecycle actions
- // such as /reload, /new, /resume, and /fork. Those do not mean the pane's
- // agent process has exited, and releasing hook authority there can suppress
- // legitimate reports from the replacement runtime. Only a user/process quit
- // should release Herdr's full-lifecycle authority.
- const reason = event?.reason;
- return reason === "quit";
-}
-
let sendInFlight = false;
let queuedState: QueuedState | undefined;
@@ -470,13 +447,9 @@ export default function (pi) {
scheduleIdle();
});
- pi.on("session_shutdown", async (event) => {
- if (!rootSession) {
- return;
- }
- clearPendingTimers();
- if (shouldReleaseOnSessionShutdown(event)) {
- await releaseAgent();
+ pi.on("session_shutdown", () => {
+ if (rootSession) {
+ clearPendingTimers();
}
});
}