fix(cli): add config alias and reduce probe noise

This commit is contained in:
Peter Steinberger
2026-01-04 17:23:24 +00:00
parent 9eee832282
commit 2110cac5d6
6 changed files with 20 additions and 6 deletions

View File

@@ -92,9 +92,10 @@ export async function callGateway<T = unknown>(
client.stop();
stop(err as Error);
}
},
onClose: (code, reason) => {
}, onClose: (code, reason) => {
if (settled || ignoreClose) return;
ignoreClose = true;
client.stop();
stop(new Error(`gateway closed (${code}): ${reason}`));
},
});

View File

@@ -119,7 +119,9 @@ export class GatewayClient {
this.opts.onHelloOk?.(helloOk);
})
.catch((err) => {
logError(`gateway connect failed: ${String(err)}`);
const msg = `gateway connect failed: ${String(err)}`;
if (this.opts.mode === "probe") logDebug(msg);
else logError(msg);
this.ws?.close(1008, "connect failed");
});
}