From bc0a9f9d16fd278b98e3313e9fea5a548de53139 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 2 Jun 2026 08:19:03 +0800 Subject: [PATCH] fix: keep agentrun transient env within schema --- internal/cloud/code-agent-agentrun-adapter.ts | 3 --- internal/cloud/server-agent-chat.test.ts | 7 +------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/internal/cloud/code-agent-agentrun-adapter.ts b/internal/cloud/code-agent-agentrun-adapter.ts index a7d1d1c8..46f672cd 100644 --- a/internal/cloud/code-agent-agentrun-adapter.ts +++ b/internal/cloud/code-agent-agentrun-adapter.ts @@ -472,13 +472,10 @@ function buildAgentRunRunnerJobInput({ env, traceId, commandId }) { function buildAgentRunTransientEnv(env = process.env) { const entries = []; for (const name of [ - "HWLAB_DEVICE_POD_API_URL", - "HWLAB_CLOUD_API_URL", "HWLAB_RUNTIME_API_URL", "HWLAB_RUNTIME_WEB_URL", "HWLAB_RUNTIME_NAMESPACE", "HWLAB_RUNTIME_LANE", - "HWLAB_RUNTIME_ENDPOINT_SOURCE", "HWLAB_RUNTIME_ENDPOINT_LOCKED", "HWLAB_CODE_AGENT_ASSEMBLED_RUNTIME", "HWLAB_DEVICE_POD_SESSION_TOKEN" diff --git a/internal/cloud/server-agent-chat.test.ts b/internal/cloud/server-agent-chat.test.ts index 2a3dc754..0dc41cab 100644 --- a/internal/cloud/server-agent-chat.test.ts +++ b/internal/cloud/server-agent-chat.test.ts @@ -194,28 +194,23 @@ test("cloud api /v1/agent/chat delegates v0.2 turns to AgentRun v0.1 over adapte if (request.method === "POST" && url.pathname === "/api/v1/runs/run_hwlab_adapter/runner-jobs") { assert.equal(body.commandId, "cmd_hwlab_adapter"); assert.deepEqual(body.transientEnv.map((entry) => entry.name), [ - "HWLAB_DEVICE_POD_API_URL", - "HWLAB_CLOUD_API_URL", "HWLAB_RUNTIME_API_URL", "HWLAB_RUNTIME_WEB_URL", "HWLAB_RUNTIME_NAMESPACE", "HWLAB_RUNTIME_LANE", - "HWLAB_RUNTIME_ENDPOINT_SOURCE", "HWLAB_RUNTIME_ENDPOINT_LOCKED", "HWLAB_CODE_AGENT_ASSEMBLED_RUNTIME", "HWLAB_DEVICE_POD_SESSION_TOKEN" ]); const transientEnv = Object.fromEntries(body.transientEnv.map((entry) => [entry.name, entry.value])); - assert.equal(transientEnv.HWLAB_DEVICE_POD_API_URL, "http://hwlab-cloud-web.hwlab-v02.svc.cluster.local:8080"); - assert.equal(transientEnv.HWLAB_CLOUD_API_URL, "http://hwlab-cloud-web.hwlab-v02.svc.cluster.local:8080"); assert.equal(transientEnv.HWLAB_RUNTIME_API_URL, "http://hwlab-cloud-web.hwlab-v02.svc.cluster.local:8080"); assert.equal(transientEnv.HWLAB_RUNTIME_WEB_URL, "http://hwlab-cloud-web.hwlab-v02.svc.cluster.local:8080"); assert.equal(transientEnv.HWLAB_RUNTIME_NAMESPACE, "hwlab-v02"); assert.equal(transientEnv.HWLAB_RUNTIME_LANE, "v02"); - assert.equal(transientEnv.HWLAB_RUNTIME_ENDPOINT_SOURCE, "runtime-namespace"); assert.equal(transientEnv.HWLAB_RUNTIME_ENDPOINT_LOCKED, "1"); assert.equal(transientEnv.HWLAB_CODE_AGENT_ASSEMBLED_RUNTIME, "1"); assert.equal(transientEnv.HWLAB_DEVICE_POD_SESSION_TOKEN, "test-device-pod-session-token"); + assert.ok(body.transientEnv.length <= 8); return send({ action: "create-kubernetes-job", runId: "run_hwlab_adapter",