Merge pull request #677 from pikasTech/fix/v02-runtime-resolver-672

fix: keep agentrun transient env within schema
This commit is contained in:
Lyon
2026-06-02 08:19:55 +08:00
committed by GitHub
2 changed files with 1 additions and 9 deletions
@@ -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"
+1 -6
View File
@@ -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",