Bug
classifyGatewayStatus in src/lib/runtime-recovery.ts matches "Status: Not connected" as connected because \bConnected\b matches and the Disconnected guard doesn't catch it.
if (/\bConnected\b/i.test(clean) && !/\bDisconnected\b/i.test(clean)) {
return { state: "connected", reason: "ok" };
}
This is a pre-existing bug from the original JS code. The TS migration in #1268 partially improved it (added the Disconnected guard) but "Not connected" still slips through.
Fix
Use a stricter match — e.g., check unavailable patterns first, then use /^\s*(?:Status:\s*)?Connected\s*$/im for the connected check. Add a regression test for "Status: Not connected" → inactive.
Found by
CodeRabbit review on #1268.