aboutsummaryrefslogtreecommitdiff
path: root/src/integration/assets/omp
diff options
context:
space:
mode:
authorWiedzmin <56316383+art-wiedzmin@users.noreply.github.com>2026-07-30 21:44:25 +0300
committerGitHub <noreply@github.com>2026-07-30 21:44:25 +0300
commita07871a55ee77eea15e4e7d1b6cccce720c6f066 (patch)
tree6afaf40f1942145daa297f9d57c33634d927c820 /src/integration/assets/omp
parentac47b9e67912c82dac17388e5541d969a7372c23 (diff)
fix(omp): support Windows session paths (#2092)
Diffstat (limited to 'src/integration/assets/omp')
-rw-r--r--src/integration/assets/omp/herdr-agent-state.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/integration/assets/omp/herdr-agent-state.ts b/src/integration/assets/omp/herdr-agent-state.ts
index b3f88c93..88f804aa 100644
--- a/src/integration/assets/omp/herdr-agent-state.ts
+++ b/src/integration/assets/omp/herdr-agent-state.ts
@@ -2,10 +2,11 @@
// 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=7
+// HERDR_INTEGRATION_VERSION=8
// @ts-nocheck
import net from "node:net";
+import path from "node:path";
const HERDR_ENV = process.env.HERDR_ENV;
const socketPath = process.env.HERDR_SOCKET_PATH;
@@ -84,11 +85,17 @@ function nextReportSeq(): number {
return reportSeq;
}
+export function isAbsoluteSessionPath(file: unknown): file is string {
+ return (
+ typeof file === "string" &&
+ (path.posix.isAbsolute(file) || path.win32.isAbsolute(file))
+ );
+}
+
function updateSessionRef(ctx: any): void {
try {
const file = ctx?.sessionManager?.getSessionFile?.();
- currentAgentSessionPath =
- typeof file === "string" && file.startsWith("/") ? file : undefined;
+ currentAgentSessionPath = isAbsoluteSessionPath(file) ? file : undefined;
} catch {
currentAgentSessionPath = undefined;
}