fix: strip non-JSON prefix from gateway status output (#165)

This commit is contained in:
Lauren ten Hoor
2026-02-13 20:14:55 +08:00
parent 3440a3c187
commit 70714388e8

View File

@@ -91,7 +91,8 @@ export async function fetchGatewaySessions(): Promise<SessionLookup | null> {
{ timeoutMs: 15_000 },
);
const data = JSON.parse(result.stdout);
const jsonStart = result.stdout.indexOf("{");
const data = JSON.parse(jsonStart >= 0 ? result.stdout.slice(jsonStart) : result.stdout);
const sessions: GatewaySession[] = data?.sessions?.recent ?? [];
for (const session of sessions) {