fix: replace device pod lease with api key
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user