refactor(status): remove unused gateway probe exports

This commit is contained in:
Vincent Koc
2026-06-18 23:07:53 +08:00
parent 1fc97cf05d
commit c8fc2fedee
3 changed files with 4 additions and 13 deletions
-9
View File
@@ -6,7 +6,6 @@ import {
resolveGatewayProbeAuthSafeWithSecretInputs,
resolveGatewayProbeTarget,
} from "../gateway/probe-auth.js";
export { pickGatewaySelfPresence } from "./gateway-presence.js";
/** Resolves gateway probe auth plus any non-secret warning about credential lookup. */
export async function resolveGatewayProbeAuthResolution(cfg: OpenClawConfig): Promise<{
@@ -24,11 +23,3 @@ export async function resolveGatewayProbeAuthResolution(cfg: OpenClawConfig): Pr
env: process.env,
});
}
/** Resolves only gateway probe auth material for callers that do not display warnings. */
export async function resolveGatewayProbeAuth(cfg: OpenClawConfig): Promise<{
token?: string;
password?: string;
}> {
return (await resolveGatewayProbeAuthResolution(cfg)).auth;
}
-2
View File
@@ -74,7 +74,6 @@ function createStatusScanDepsRuntimeModuleMock(
}
type StatusGatewayProbeModuleMock = {
pickGatewaySelfPresence: Mock<() => null>;
resolveGatewayProbeAuthResolution: StatusScanSharedMocks["resolveGatewayProbeAuthResolution"];
};
@@ -82,7 +81,6 @@ function createStatusGatewayProbeModuleMock(
mocks: Pick<StatusScanSharedMocks, "resolveGatewayProbeAuthResolution">,
): StatusGatewayProbeModuleMock {
return {
pickGatewaySelfPresence: vi.fn(() => null),
resolveGatewayProbeAuthResolution: mocks.resolveGatewayProbeAuthResolution,
};
}
@@ -1,7 +1,7 @@
// Credential precedence parity tests keep call, probe, status, and auth surfaces
// aligned on local/remote gateway token and password resolution.
import { describe, expect, it } from "vitest";
import { resolveGatewayProbeAuth as resolveStatusGatewayProbeAuth } from "../commands/status.gateway-probe.js";
import { resolveGatewayProbeAuthResolution } from "../commands/status.gateway-probe.js";
import type { OpenClawConfig } from "../config/config.js";
import { resolveGatewayAuth } from "./auth.js";
import { resolveGatewayCredentialsFromConfig } from "./credentials.js";
@@ -156,7 +156,9 @@ describe("gateway credential precedence coverage", () => {
mode,
env,
});
const status = await withGatewayAuthEnv(env, () => resolveStatusGatewayProbeAuth(cfg));
const status = (
await withGatewayAuthEnv(env, () => resolveGatewayProbeAuthResolution(cfg))
).auth;
const auth = resolveGatewayAuth({
authConfig: cfg.gateway?.auth,
env,