fix: improve gateway protocol mismatch diagnostics (#82908)

* fix: improve gateway protocol mismatch diagnostics

* test: cover daemon deep connection diagnostics

* fix: normalize mapped loopback gateway clients
This commit is contained in:
Peter Steinberger
2026-05-17 06:33:34 +01:00
committed by GitHub
parent 926a5a825f
commit 38b3e73622
14 changed files with 801 additions and 6 deletions

View File

@@ -28,6 +28,10 @@ const inspectPortUsage = vi.fn(async (port: number) => ({
listeners: [],
hints: [],
}));
const inspectPortConnections = vi.fn(async (port: number) => ({
port,
connections: [],
}));
function collectMatching<T, U>(
items: readonly T[],
@@ -114,6 +118,7 @@ vi.mock("../daemon/inspect.js", () => ({
}));
vi.mock("../infra/ports.js", () => ({
inspectPortConnections: (port: number) => inspectPortConnections(port),
inspectPortUsage: (port: number) => inspectPortUsage(port),
formatPortDiagnostics: () => ["Port 18789 is already in use."],
}));
@@ -192,6 +197,7 @@ describe("daemon-cli coverage", () => {
serviceReadCommand.mockResolvedValue(null);
resolveGatewayProbeAuthSafeWithSecretInputs.mockClear();
findExtraGatewayServices.mockClear();
inspectPortConnections.mockClear();
buildGatewayInstallPlan.mockClear();
});