Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import { normalizeEmbeddedAgentRuntime } from "../pi-embedded-runner/runtime.js";
import { resolveProviderIdForAuth } from "../provider-auth-aliases.js";
import type { AgentRuntimeAuthPlan } from "./types.js";
const CODEX_HARNESS_AUTH_PROVIDER = "openai-codex";
function resolveHarnessAuthProvider(params: {
harnessId?: string;
harnessRuntime?: string;
}): string | undefined {
const harnessId = normalizeEmbeddedAgentRuntime(params.harnessId);
const runtime = normalizeEmbeddedAgentRuntime(params.harnessRuntime);
return harnessId === "codex" || runtime === "codex" ? CODEX_HARNESS_AUTH_PROVIDER : undefined;
}
export function buildAgentRuntimeAuthPlan(params: {
provider: string;
authProfileProvider?: string;
sessionAuthProfileId?: string;
config?: OpenClawConfig;
workspaceDir?: string;
harnessId?: string;
harnessRuntime?: string;
allowHarnessAuthProfileForwarding?: boolean;
}): AgentRuntimeAuthPlan {
const aliasLookupParams = {
config: params.config,
workspaceDir: params.workspaceDir,
};
const providerForAuth = resolveProviderIdForAuth(params.provider, aliasLookupParams);
const authProfileProviderForAuth = resolveProviderIdForAuth(
params.authProfileProvider ?? params.provider,
aliasLookupParams,
);
const harnessAuthProvider = resolveHarnessAuthProvider(params);
const harnessProviderForAuth = harnessAuthProvider
? resolveProviderIdForAuth(harnessAuthProvider, aliasLookupParams)
: undefined;
const harnessCanForwardProfile =
params.allowHarnessAuthProfileForwarding !== false &&
harnessProviderForAuth &&
harnessProviderForAuth === authProfileProviderForAuth;
const canForwardProfile =
providerForAuth === authProfileProviderForAuth || harnessCanForwardProfile;
return {
providerForAuth,
authProfileProviderForAuth,
...(harnessProviderForAuth ? { harnessAuthProvider: harnessProviderForAuth } : {}),
...(canForwardProfile ? { forwardedAuthProfileId: params.sessionAuthProfileId } : {}),
};
}
¤ Dauer der Verarbeitung: 0.17 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland