fix: replace device pod lease with api key

This commit is contained in:
Codex
2026-06-02 18:11:32 +08:00
parent 332b17193a
commit bacfa24289
19 changed files with 170 additions and 535 deletions
+4 -4
View File
@@ -166,9 +166,9 @@ async function codeAgentChatExecutionOptions(options = {}, params = {}) {
}
async function codeAgentDevicePodAuthEnv(options = {}, env = process.env) {
if (typeof options.accessController?.createCodeAgentDevicePodSession !== "function") return {};
const auth = await options.accessController.createCodeAgentDevicePodSession();
if (!auth?.token) return {};
if (typeof options.accessController?.createCodeAgentDevicePodApiKey !== "function") return {};
const auth = await options.accessController.createCodeAgentDevicePodApiKey();
if (!auth?.apiKey) return {};
const runtimeNamespace = runtimeNamespaceForEnv(env);
const runtimeLane = runtimeLaneForNamespace(runtimeNamespace) ?? runtimeLaneForEnv(env);
const inClusterApiUrl = internalCodeAgentApiUrl(env, runtimeNamespace);
@@ -191,7 +191,7 @@ async function codeAgentDevicePodAuthEnv(options = {}, env = process.env) {
HWLAB_RUNTIME_ENDPOINT_SOURCE: codeAgentAgentRunAdapterEnabled(env) ? "runtime-namespace" : "runtime-env",
HWLAB_RUNTIME_ENDPOINT_LOCKED: "1",
HWLAB_CODE_AGENT_ASSEMBLED_RUNTIME: "1",
HWLAB_DEVICE_POD_SESSION_TOKEN: auth.token
HWLAB_DEVICE_POD_API_KEY: auth.apiKey
};
}