From b6ad81f4aee74e43d3295f994062cb6beb396d7f Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 18:57:07 -0400 Subject: [PATCH 01/12] ci(e2e): route shared jobs to NVIDIA endpoints --- .github/workflows/e2e-script.yaml | 32 ++++++++++++--- .github/workflows/nightly-e2e.yaml | 20 +++++----- .../support-tests/hosted-inference.test.ts | 4 +- test/e2e-script-workflow.test.ts | 40 +++++++++++++++++-- test/e2e/lib/ci-compatible-inference.sh | 12 +++--- 5 files changed, 82 insertions(+), 26 deletions(-) diff --git a/.github/workflows/e2e-script.yaml b/.github/workflows/e2e-script.yaml index 0b729fead78..944617583dc 100644 --- a/.github/workflows/e2e-script.yaml +++ b/.github/workflows/e2e-script.yaml @@ -58,7 +58,7 @@ on: type: string default: "" nvidia_api_key: - description: Pass the hosted inference source secret as the CI custom endpoint credential. + description: Pass the NVIDIA inference credential to the script. Defaults to hosted custom inference unless env_json selects cloud/build. required: false type: boolean default: false @@ -80,6 +80,8 @@ on: secrets: NVIDIA_INFERENCE_API_KEY: required: false + NVIDIA_API_KEY: + required: false BRAVE_API_KEY: required: false DOCKERHUB_USERNAME: @@ -212,27 +214,46 @@ jobs: echo "::warning::Docker Hub login failed after 3 attempts; continuing with anonymous pulls." fi - - name: Export hosted CI inference environment + - name: Export CI inference environment if: ${{ inputs.nvidia_api_key }} env: - NVIDIA_INFERENCE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }} + HOSTED_NVIDIA_INFERENCE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }} + NVIDIA_BUILD_API_KEY: ${{ secrets.NVIDIA_API_KEY }} shell: bash run: | set -euo pipefail - if [ -z "${NVIDIA_INFERENCE_API_KEY:-}" ]; then + case "${NEMOCLAW_PROVIDER:-}" in + build|cloud) + nvidia_key="${NVIDIA_BUILD_API_KEY:-${HOSTED_NVIDIA_INFERENCE_API_KEY:-}}" + if [[ -z "${nvidia_key}" || "${nvidia_key}" != nvapi-* ]]; then + echo "::error::NVIDIA_API_KEY or NVIDIA_INFERENCE_API_KEY nvapi-* secret is required for NVIDIA Build CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 + exit 1 + fi + { + printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${nvidia_key}" + printf 'NVIDIA_API_KEY=%s\n' "${nvidia_key}" + printf 'NEMOCLAW_MODEL=%s\n' "${NEMOCLAW_MODEL:-nvidia/nemotron-3-super-120b-a12b}" + printf 'NEMOCLAW_PREFERRED_API=%s\n' "${NEMOCLAW_PREFERRED_API:-openai-completions}" + } >> "$GITHUB_ENV" + exit 0 + ;; + esac + + if [ -z "${HOSTED_NVIDIA_INFERENCE_API_KEY:-}" ]; then echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for hosted CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 exit 1 fi { + printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" printf 'NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1\n' printf 'NEMOCLAW_PROVIDER=custom\n' printf 'NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1\n' printf 'NEMOCLAW_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' printf 'NEMOCLAW_COMPAT_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' printf 'NEMOCLAW_PREFERRED_API=openai-completions\n' - printf 'COMPATIBLE_API_KEY=%s\n' "${NVIDIA_INFERENCE_API_KEY}" + printf 'COMPATIBLE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" } >> "$GITHUB_ENV" - name: Run E2E script @@ -248,7 +269,6 @@ jobs: env: BRAVE_API_KEY: ${{ inputs.brave_api_key && secrets.BRAVE_API_KEY || '' }} GITHUB_TOKEN: ${{ inputs.github_token && github.token || '' }} - NVIDIA_INFERENCE_API_KEY: ${{ inputs.nvidia_api_key && secrets.NVIDIA_INFERENCE_API_KEY || '' }} TELEGRAM_BOT_TOKEN_REAL: ${{ inputs.messaging_live_secrets && secrets.TELEGRAM_BOT_TOKEN_REAL || '' }} TELEGRAM_CHAT_ID_E2E: ${{ inputs.messaging_live_secrets && secrets.TELEGRAM_CHAT_ID_E2E || '' }} DISCORD_BOT_TOKEN_REAL: ${{ inputs.messaging_live_secrets && secrets.DISCORD_BOT_TOKEN_REAL || '' }} diff --git a/.github/workflows/nightly-e2e.yaml b/.github/workflows/nightly-e2e.yaml index db76a3cf1bf..01e36991d30 100644 --- a/.github/workflows/nightly-e2e.yaml +++ b/.github/workflows/nightly-e2e.yaml @@ -207,6 +207,7 @@ jobs: github_token: true secrets: &nightly-e2e-default-secrets NVIDIA_INFERENCE_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_INFERENCE_API_KEY || '' }} + NVIDIA_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_API_KEY || '' }} BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} DOCKERHUB_USERNAME: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }} DOCKERHUB_TOKEN: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }} @@ -374,12 +375,13 @@ jobs: artifact_path: | /tmp/nemoclaw-e2e-install.log /tmp/nemoclaw-e2e-whatsapp-*.log - env_json: '{"DISCORD_BOT_TOKEN":"test-fake-discord-token-e2e","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-msg-provider","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-e2e","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-e2e"}' + env_json: '{"DISCORD_BOT_TOKEN":"test-fake-discord-token-e2e","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-msg-provider","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-e2e","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-e2e","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' nvidia_api_key: true github_token: true messaging_live_secrets: ${{ github.event_name != 'workflow_dispatch' || inputs.target_ref == '' }} secrets: NVIDIA_INFERENCE_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_INFERENCE_API_KEY || '' }} + NVIDIA_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_API_KEY || '' }} BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} DOCKERHUB_USERNAME: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }} DOCKERHUB_TOKEN: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }} @@ -762,7 +764,7 @@ jobs: /tmp/nc-remove.log /tmp/nc-rebuild-add.log /tmp/nc-rebuild-remove.log - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-channels-add-remove","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-add-remove-e2e"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-channels-add-remove","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-add-remove-e2e","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' nvidia_api_key: true github_token: true secrets: *nightly-e2e-default-secrets @@ -785,7 +787,7 @@ jobs: /tmp/nemoclaw-e2e-install.log /tmp/nemoclaw-e2e-channels-*-install.log /tmp/nc-channels-*.log - env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"openclaw","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator"}' + env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"openclaw","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' nvidia_api_key: true github_token: true secrets: *nightly-e2e-default-secrets @@ -804,7 +806,7 @@ jobs: /tmp/nemoclaw-e2e-install.log /tmp/nemoclaw-e2e-channels-*-install.log /tmp/nc-channels-*.log - env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator"}' + env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' nvidia_api_key: true github_token: true secrets: *nightly-e2e-default-secrets @@ -836,7 +838,7 @@ jobs: timeout_minutes: 120 artifact_name: "common-egress-agent-e2e-logs" artifact_path: "/tmp/nemoclaw-e2e-common-egress-*.log" - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_RECREATE_SANDBOX":"1"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_RECREATE_SANDBOX":"1","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' nvidia_api_key: true github_token: true secrets: *nightly-e2e-default-secrets @@ -1194,7 +1196,7 @@ jobs: timeout_minutes: 60 artifact_name: "hermes-discord-e2e-install-log" artifact_path: "/tmp/nemoclaw-e2e-hermes-discord-install.log" - env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-hermes-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_IDS":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_RECREATE_SANDBOX":"1","NEMOCLAW_SANDBOX_NAME":"e2e-hermes-discord"}' + env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-hermes-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_IDS":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_RECREATE_SANDBOX":"1","NEMOCLAW_SANDBOX_NAME":"e2e-hermes-discord","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' nvidia_api_key: true github_token: true secrets: *nightly-e2e-default-secrets @@ -1692,7 +1694,7 @@ jobs: artifact_path: | /tmp/nemoclaw-e2e-old-install.log /tmp/nemoclaw-e2e-upgrade-install.log - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-upgrade-stale"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-upgrade-stale","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' nvidia_api_key: true github_token: true secrets: *nightly-e2e-default-secrets @@ -1750,7 +1752,7 @@ jobs: timeout_minutes: 60 artifact_name: "rebuild-hermes-install-log" artifact_path: "/tmp/nemoclaw-e2e-install.log" - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' nvidia_api_key: true github_token: true secrets: *nightly-e2e-default-secrets @@ -1766,7 +1768,7 @@ jobs: timeout_minutes: 60 artifact_name: "rebuild-hermes-stale-base-install-log" artifact_path: "/tmp/nemoclaw-e2e-install.log" - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_HERMES_STALE_BASE_REBUILD_E2E":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm-base"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_HERMES_STALE_BASE_REBUILD_E2E":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm-base","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' nvidia_api_key: true github_token: true secrets: *nightly-e2e-default-secrets diff --git a/test/e2e-scenario/support-tests/hosted-inference.test.ts b/test/e2e-scenario/support-tests/hosted-inference.test.ts index 8a21df80667..e594feb04b6 100644 --- a/test/e2e-scenario/support-tests/hosted-inference.test.ts +++ b/test/e2e-scenario/support-tests/hosted-inference.test.ts @@ -119,7 +119,7 @@ describe("hosted inference E2E config", () => { expect(calls).not.toContain("Bearer"); }); - it("uses a lightweight nvapi reachability probe without /models or auth", () => { + it("uses the NVIDIA Endpoints reachability probe for nvapi cloud routes", () => { const { result, calls } = runHostedProbe({ env: { NVIDIA_INFERENCE_API_KEY: "nvapi-test-key", @@ -129,7 +129,7 @@ describe("hosted inference E2E config", () => { }); expect(result.status).toBe(0); - expect(calls).toContain("ARG:https://inference-api.nvidia.com/v1"); + expect(calls).toContain("ARG:https://integrate.api.nvidia.com/v1"); expect(calls).not.toContain("/models"); expect(calls).not.toContain("Authorization"); expect(calls).not.toContain("Bearer"); diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index 1da46728c7b..b561e614a06 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -49,6 +49,7 @@ const TRUSTED_REF_GUARD = "github.event_name != 'workflow_dispatch' || inputs.ta const GUARDED_HOSTED_INFERENCE_SECRET = `\${{ (${TRUSTED_REF_GUARD}) && secrets.NVIDIA_INFERENCE_API_KEY || '' }}`; const GUARDED_PUBLIC_NVIDIA_SECRET = `\${{ (${TRUSTED_REF_GUARD}) && secrets.NVIDIA_API_KEY || '' }}`; const RAW_HOSTED_INFERENCE_SECRET = "${{ secrets.NVIDIA_INFERENCE_API_KEY }}"; +const RAW_PUBLIC_NVIDIA_SECRET = "${{ secrets.NVIDIA_API_KEY }}"; function timingSummary( phases: Record = { "nemoclaw.onboard.phase.preflight": 1000 }, @@ -396,6 +397,7 @@ describe("E2E reusable workflow contract", () => { const reusableJobs = reusableNightlyJobs(nightlyWorkflow); const defaultSecrets = { NVIDIA_INFERENCE_API_KEY: GUARDED_HOSTED_INFERENCE_SECRET, + NVIDIA_API_KEY: GUARDED_PUBLIC_NVIDIA_SECRET, BRAVE_API_KEY: "${{ secrets.BRAVE_API_KEY }}", DOCKERHUB_USERNAME: "${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }}", @@ -905,14 +907,25 @@ describe("E2E reusable workflow contract", () => { expect(exportStep?.run).toContain('>> "$GITHUB_ENV"'); }); - it("routes reusable hosted inference jobs through the hosted custom endpoint", () => { + it("routes reusable NVIDIA-key jobs through explicit hosted or NVIDIA Build env", () => { const exportStep = runnerWorkflow.jobs.run.steps.find( - (step) => step.name === "Export hosted CI inference environment", + (step) => step.name === "Export CI inference environment", ); const workflowCall = runnerWorkflow.on?.workflow_call ?? runnerWorkflow.true?.workflow_call; const hostedJobs = reusableNightlyJobs(nightlyWorkflow).filter( ([, job]) => String(job.with?.nvidia_api_key) === "true", ); + const nvidiaBuildJobs = new Set([ + "messaging-providers-e2e", + "channels-add-remove-e2e", + "channels-stop-start-openclaw-e2e", + "channels-stop-start-hermes-e2e", + "common-egress-agent-e2e", + "hermes-discord-e2e", + "upgrade-stale-sandbox-e2e", + "rebuild-hermes-e2e", + "rebuild-hermes-stale-base-e2e", + ]); expect(workflowCall?.inputs?.nvidia_api_key).toMatchObject({ required: false, @@ -920,9 +933,19 @@ describe("E2E reusable workflow contract", () => { default: false, }); expect(workflowCall?.inputs?.nvidia_secret_as_compatible_api_key).toBeUndefined(); + expect(workflowCall?.secrets?.NVIDIA_API_KEY).toMatchObject({ required: false }); expect(exportStep?.if).toBe("${{ inputs.nvidia_api_key }}"); - expect(exportStep?.env?.NVIDIA_INFERENCE_API_KEY).toBe(RAW_HOSTED_INFERENCE_SECRET); - expect(exportStep?.run).toContain("withheld for workflow_dispatch target_ref runs"); + expect(exportStep?.env?.HOSTED_NVIDIA_INFERENCE_API_KEY).toBe(RAW_HOSTED_INFERENCE_SECRET); + expect(exportStep?.env?.NVIDIA_BUILD_API_KEY).toBe(RAW_PUBLIC_NVIDIA_SECRET); + expect(exportStep?.run).toContain('case "${NEMOCLAW_PROVIDER:-}" in'); + expect(exportStep?.run).toContain("build|cloud)"); + expect(exportStep?.run).toContain( + "NVIDIA_API_KEY or NVIDIA_INFERENCE_API_KEY nvapi-* secret is required", + ); + expect(exportStep?.run).toContain("NVIDIA_INFERENCE_API_KEY=%s"); + expect(exportStep?.run).toContain("NVIDIA_API_KEY=%s"); + expect(exportStep?.run).toContain("NEMOCLAW_MODEL=%s"); + expect(exportStep?.run).toContain("nvidia/nemotron-3-super-120b-a12b"); expect(exportStep?.run).toContain("NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1"); expect(exportStep?.run).toContain("NEMOCLAW_PROVIDER=custom"); expect(exportStep?.run).toContain("NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1"); @@ -934,6 +957,15 @@ describe("E2E reusable workflow contract", () => { expect(hostedJobs.length).toBeGreaterThan(20); for (const [name, job] of hostedJobs) { expect(job.with?.nvidia_secret_as_compatible_api_key, name).toBeUndefined(); + const envJson = JSON.parse(job.with?.env_json ?? "{}") as Record; + if (nvidiaBuildJobs.has(name)) { + expect(envJson.NEMOCLAW_PROVIDER, name).toBe("cloud"); + expect(envJson.NEMOCLAW_MODEL, name).toBe("nvidia/nemotron-3-super-120b-a12b"); + expect(envJson.NEMOCLAW_PREFERRED_API, name).toBe("openai-completions"); + } else { + expect(envJson.NEMOCLAW_PROVIDER, name).not.toBe("cloud"); + expect(envJson.NEMOCLAW_MODEL, name).not.toBe("nvidia/nemotron-3-super-120b-a12b"); + } } }); diff --git a/test/e2e/lib/ci-compatible-inference.sh b/test/e2e/lib/ci-compatible-inference.sh index 01ae3c99328..319378b5044 100755 --- a/test/e2e/lib/ci-compatible-inference.sh +++ b/test/e2e/lib/ci-compatible-inference.sh @@ -2,13 +2,15 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# CI-only hosted inference shim: live E2E lanes use the repository's -# NVIDIA_INFERENCE_API_KEY secret against the hosted OpenAI-compatible endpoint -# at inference-api.nvidia.com. Keep this helper in test/e2e so the -# product-facing provider/default endpoint remain unchanged. +# CI-only inference shim: live E2E lanes can use the repository's +# NVIDIA_INFERENCE_API_KEY secret either against the hosted OpenAI-compatible +# endpoint at inference-api.nvidia.com or the built-in NVIDIA Endpoints route at +# integrate.api.nvidia.com. Keep this helper in test/e2e so product-facing +# provider/default endpoint behavior remains explicit. NEMOCLAW_E2E_COMPATIBLE_INFERENCE_MODEL_DEFAULT="nvidia/nvidia/nemotron-3-super-v3" NEMOCLAW_E2E_HOSTED_INFERENCE_PROVIDER_DEFAULT="compatible-endpoint" +NEMOCLAW_E2E_NVIDIA_INFERENCE_ENDPOINT_DEFAULT="https://integrate.api.nvidia.com/v1" NEMOCLAW_E2E_NVIDIA_INFERENCE_MODEL_DEFAULT="nvidia/nemotron-3-super-120b-a12b" nemoclaw_e2e_using_compatible_inference() { @@ -49,7 +51,7 @@ nemoclaw_e2e_hosted_inference_base_url() { if nemoclaw_e2e_using_compatible_inference; then printf '%s' "${NEMOCLAW_ENDPOINT_URL:-https://inference-api.nvidia.com/v1}" else - printf '%s' "https://inference-api.nvidia.com/v1" + printf '%s' "$NEMOCLAW_E2E_NVIDIA_INFERENCE_ENDPOINT_DEFAULT" fi } From 36a00a23e3fac8eb6b1e425077fff738f42ff56c Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 19:21:23 -0400 Subject: [PATCH 02/12] ci(e2e): make shared inference route explicit --- .github/workflows/e2e-script.yaml | 60 ++++++++------ .github/workflows/nightly-e2e.yaml | 46 ++++++----- test/e2e-script-workflow.test.ts | 124 +++++++++++++++++++++++------ 3 files changed, 164 insertions(+), 66 deletions(-) diff --git a/.github/workflows/e2e-script.yaml b/.github/workflows/e2e-script.yaml index 944617583dc..4c6b13428cc 100644 --- a/.github/workflows/e2e-script.yaml +++ b/.github/workflows/e2e-script.yaml @@ -58,10 +58,15 @@ on: type: string default: "" nvidia_api_key: - description: Pass the NVIDIA inference credential to the script. Defaults to hosted custom inference unless env_json selects cloud/build. + description: Pass the NVIDIA inference credential to the script. required: false type: boolean default: false + inference_route: + description: "Inference route to export when nvidia_api_key is true: hosted-custom or nvidia-build." + required: false + type: string + default: hosted-custom brave_api_key: description: Pass the BRAVE_API_KEY secret to the script. required: false @@ -217,44 +222,49 @@ jobs: - name: Export CI inference environment if: ${{ inputs.nvidia_api_key }} env: + NEMOCLAW_E2E_INFERENCE_ROUTE: ${{ inputs.inference_route }} HOSTED_NVIDIA_INFERENCE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }} NVIDIA_BUILD_API_KEY: ${{ secrets.NVIDIA_API_KEY }} shell: bash run: | set -euo pipefail - case "${NEMOCLAW_PROVIDER:-}" in - build|cloud) - nvidia_key="${NVIDIA_BUILD_API_KEY:-${HOSTED_NVIDIA_INFERENCE_API_KEY:-}}" - if [[ -z "${nvidia_key}" || "${nvidia_key}" != nvapi-* ]]; then - echo "::error::NVIDIA_API_KEY or NVIDIA_INFERENCE_API_KEY nvapi-* secret is required for NVIDIA Build CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 + case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in + nvidia-build) + if [[ -z "${NVIDIA_BUILD_API_KEY:-}" || "${NVIDIA_BUILD_API_KEY}" != nvapi-* ]]; then + echo "::error::NVIDIA_API_KEY nvapi-* secret is required for NVIDIA Build CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 exit 1 fi { - printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${nvidia_key}" - printf 'NVIDIA_API_KEY=%s\n' "${nvidia_key}" + printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${NVIDIA_BUILD_API_KEY}" + printf 'NVIDIA_API_KEY=%s\n' "${NVIDIA_BUILD_API_KEY}" + printf 'NEMOCLAW_PROVIDER=cloud\n' printf 'NEMOCLAW_MODEL=%s\n' "${NEMOCLAW_MODEL:-nvidia/nemotron-3-super-120b-a12b}" printf 'NEMOCLAW_PREFERRED_API=%s\n' "${NEMOCLAW_PREFERRED_API:-openai-completions}" } >> "$GITHUB_ENV" - exit 0 ;; - esac - - if [ -z "${HOSTED_NVIDIA_INFERENCE_API_KEY:-}" ]; then - echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for hosted CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 - exit 1 - fi + hosted-custom) + if [ -z "${HOSTED_NVIDIA_INFERENCE_API_KEY:-}" ]; then + echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for hosted CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 + exit 1 + fi - { - printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" - printf 'NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1\n' - printf 'NEMOCLAW_PROVIDER=custom\n' - printf 'NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1\n' - printf 'NEMOCLAW_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' - printf 'NEMOCLAW_COMPAT_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' - printf 'NEMOCLAW_PREFERRED_API=openai-completions\n' - printf 'COMPATIBLE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" - } >> "$GITHUB_ENV" + { + printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" + printf 'NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1\n' + printf 'NEMOCLAW_PROVIDER=custom\n' + printf 'NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1\n' + printf 'NEMOCLAW_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' + printf 'NEMOCLAW_COMPAT_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' + printf 'NEMOCLAW_PREFERRED_API=openai-completions\n' + printf 'COMPATIBLE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" + } >> "$GITHUB_ENV" + ;; + *) + echo "::error::Unsupported inference_route: ${NEMOCLAW_E2E_INFERENCE_ROUTE}" >&2 + exit 1 + ;; + esac - name: Run E2E script uses: ./workflow-actions/.github/actions/run-e2e-script diff --git a/.github/workflows/nightly-e2e.yaml b/.github/workflows/nightly-e2e.yaml index 01e36991d30..5c4f4ab5353 100644 --- a/.github/workflows/nightly-e2e.yaml +++ b/.github/workflows/nightly-e2e.yaml @@ -207,7 +207,6 @@ jobs: github_token: true secrets: &nightly-e2e-default-secrets NVIDIA_INFERENCE_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_INFERENCE_API_KEY || '' }} - NVIDIA_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_API_KEY || '' }} BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} DOCKERHUB_USERNAME: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }} DOCKERHUB_TOKEN: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }} @@ -375,12 +374,12 @@ jobs: artifact_path: | /tmp/nemoclaw-e2e-install.log /tmp/nemoclaw-e2e-whatsapp-*.log - env_json: '{"DISCORD_BOT_TOKEN":"test-fake-discord-token-e2e","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-msg-provider","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-e2e","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-e2e","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' + env_json: '{"DISCORD_BOT_TOKEN":"test-fake-discord-token-e2e","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-msg-provider","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-e2e","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-e2e","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' nvidia_api_key: true + inference_route: nvidia-build github_token: true messaging_live_secrets: ${{ github.event_name != 'workflow_dispatch' || inputs.target_ref == '' }} secrets: - NVIDIA_INFERENCE_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_INFERENCE_API_KEY || '' }} NVIDIA_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_API_KEY || '' }} BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} DOCKERHUB_USERNAME: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }} @@ -764,10 +763,15 @@ jobs: /tmp/nc-remove.log /tmp/nc-rebuild-add.log /tmp/nc-rebuild-remove.log - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-channels-add-remove","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-add-remove-e2e","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-channels-add-remove","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-add-remove-e2e","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' nvidia_api_key: true + inference_route: nvidia-build github_token: true - secrets: *nightly-e2e-default-secrets + secrets: &nightly-e2e-nvidia-build-secrets + NVIDIA_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_API_KEY || '' }} + BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} + DOCKERHUB_USERNAME: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }} + DOCKERHUB_TOKEN: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }} # ── Channels stop/start lifecycle E2E (#3462) ─────────────────────── # Regression coverage for #3453 (stop must disable across rebuild), #3381 # (start must re-attach from cached credentials). Sharded by agent so the @@ -787,10 +791,11 @@ jobs: /tmp/nemoclaw-e2e-install.log /tmp/nemoclaw-e2e-channels-*-install.log /tmp/nc-channels-*.log - env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"openclaw","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' + env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"openclaw","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' nvidia_api_key: true + inference_route: nvidia-build github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-nvidia-build-secrets channels-stop-start-hermes-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -806,10 +811,11 @@ jobs: /tmp/nemoclaw-e2e-install.log /tmp/nemoclaw-e2e-channels-*-install.log /tmp/nc-channels-*.log - env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' + env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' nvidia_api_key: true + inference_route: nvidia-build github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-nvidia-build-secrets brave-search-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -838,7 +844,7 @@ jobs: timeout_minutes: 120 artifact_name: "common-egress-agent-e2e-logs" artifact_path: "/tmp/nemoclaw-e2e-common-egress-*.log" - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_RECREATE_SANDBOX":"1","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_RECREATE_SANDBOX":"1"}' nvidia_api_key: true github_token: true secrets: *nightly-e2e-default-secrets @@ -1196,10 +1202,11 @@ jobs: timeout_minutes: 60 artifact_name: "hermes-discord-e2e-install-log" artifact_path: "/tmp/nemoclaw-e2e-hermes-discord-install.log" - env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-hermes-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_IDS":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_RECREATE_SANDBOX":"1","NEMOCLAW_SANDBOX_NAME":"e2e-hermes-discord","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' + env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-hermes-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_IDS":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_RECREATE_SANDBOX":"1","NEMOCLAW_SANDBOX_NAME":"e2e-hermes-discord","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' nvidia_api_key: true + inference_route: nvidia-build github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-nvidia-build-secrets hermes-slack-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -1694,10 +1701,11 @@ jobs: artifact_path: | /tmp/nemoclaw-e2e-old-install.log /tmp/nemoclaw-e2e-upgrade-install.log - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-upgrade-stale","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-upgrade-stale","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' nvidia_api_key: true + inference_route: nvidia-build github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-nvidia-build-secrets openshell-gateway-upgrade-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && @@ -1752,10 +1760,11 @@ jobs: timeout_minutes: 60 artifact_name: "rebuild-hermes-install-log" artifact_path: "/tmp/nemoclaw-e2e-install.log" - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' nvidia_api_key: true + inference_route: nvidia-build github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-nvidia-build-secrets rebuild-hermes-stale-base-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -1768,10 +1777,11 @@ jobs: timeout_minutes: 60 artifact_name: "rebuild-hermes-stale-base-install-log" artifact_path: "/tmp/nemoclaw-e2e-install.log" - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_HERMES_STALE_BASE_REBUILD_E2E":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm-base","NEMOCLAW_PROVIDER":"cloud","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b","NEMOCLAW_PREFERRED_API":"openai-completions"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_HERMES_STALE_BASE_REBUILD_E2E":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm-base","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' nvidia_api_key: true + inference_route: nvidia-build github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-nvidia-build-secrets double-onboard-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index b561e614a06..8b0dbf47bdf 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -138,6 +138,37 @@ function envReferencesHostedInferenceSecret(env?: Record): boole ); } +function runInferenceExportStep( + script: string, + env: Record, +): Record { + const tempDir = mkdtempSync(path.join(tmpdir(), "nemoclaw-e2e-inference-export-")); + const githubEnv = path.join(tempDir, "github-env"); + writeFileSync(githubEnv, "", "utf8"); + try { + execFileSync("bash", ["-c", script], { + encoding: "utf8", + env: { + PATH: process.env.PATH ?? "", + GITHUB_ENV: githubEnv, + ...env, + }, + }); + return Object.fromEntries( + readFileSync(githubEnv, "utf8") + .trim() + .split("\n") + .filter(Boolean) + .map((line) => { + const index = line.indexOf("="); + return [line.slice(0, index), line.slice(index + 1)]; + }), + ); + } finally { + rmSync(tempDir, { recursive: true, force: true }); + } +} + // Direct legacy bash E2Es are being migrated toward Vitest coverage. Keep the // top-level shell suite frozen so new coverage starts in the newer E2E surface // unless maintainers intentionally update this allowlist. @@ -397,6 +428,13 @@ describe("E2E reusable workflow contract", () => { const reusableJobs = reusableNightlyJobs(nightlyWorkflow); const defaultSecrets = { NVIDIA_INFERENCE_API_KEY: GUARDED_HOSTED_INFERENCE_SECRET, + BRAVE_API_KEY: "${{ secrets.BRAVE_API_KEY }}", + DOCKERHUB_USERNAME: + "${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }}", + DOCKERHUB_TOKEN: + "${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }}", + }; + const nvidiaBuildSecrets = { NVIDIA_API_KEY: GUARDED_PUBLIC_NVIDIA_SECRET, BRAVE_API_KEY: "${{ secrets.BRAVE_API_KEY }}", DOCKERHUB_USERNAME: @@ -404,6 +442,15 @@ describe("E2E reusable workflow contract", () => { DOCKERHUB_TOKEN: "${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }}", }; + const nvidiaBuildJobs = new Set([ + "channels-add-remove-e2e", + "channels-stop-start-openclaw-e2e", + "channels-stop-start-hermes-e2e", + "hermes-discord-e2e", + "upgrade-stale-sandbox-e2e", + "rebuild-hermes-e2e", + "rebuild-hermes-stale-base-e2e", + ]); const messagingLiveSecrets = { TELEGRAM_BOT_TOKEN_REAL: `\${{ (${TRUSTED_REF_GUARD}) && secrets.TELEGRAM_BOT_TOKEN_REAL || '' }}`, TELEGRAM_CHAT_ID_E2E: `\${{ (${TRUSTED_REF_GUARD}) && secrets.TELEGRAM_CHAT_ID_E2E || '' }}`, @@ -418,8 +465,10 @@ describe("E2E reusable workflow contract", () => { for (const [name, job] of reusableJobs) { const expectsLiveMessaging = name === "messaging-providers-e2e"; const expectedSecrets = expectsLiveMessaging - ? { ...defaultSecrets, ...messagingLiveSecrets } - : defaultSecrets; + ? { ...nvidiaBuildSecrets, ...messagingLiveSecrets } + : nvidiaBuildJobs.has(name) + ? nvidiaBuildSecrets + : defaultSecrets; expect(job.secrets, name).toEqual(expectedSecrets); expect(job.with?.messaging_live_secrets ?? false, name).toBe( expectsLiveMessaging @@ -920,7 +969,6 @@ describe("E2E reusable workflow contract", () => { "channels-add-remove-e2e", "channels-stop-start-openclaw-e2e", "channels-stop-start-hermes-e2e", - "common-egress-agent-e2e", "hermes-discord-e2e", "upgrade-stale-sandbox-e2e", "rebuild-hermes-e2e", @@ -932,41 +980,71 @@ describe("E2E reusable workflow contract", () => { type: "boolean", default: false, }); + expect(workflowCall?.inputs?.inference_route).toMatchObject({ + required: false, + type: "string", + default: "hosted-custom", + }); expect(workflowCall?.inputs?.nvidia_secret_as_compatible_api_key).toBeUndefined(); expect(workflowCall?.secrets?.NVIDIA_API_KEY).toMatchObject({ required: false }); expect(exportStep?.if).toBe("${{ inputs.nvidia_api_key }}"); + expect(exportStep?.env?.NEMOCLAW_E2E_INFERENCE_ROUTE).toBe("${{ inputs.inference_route }}"); expect(exportStep?.env?.HOSTED_NVIDIA_INFERENCE_API_KEY).toBe(RAW_HOSTED_INFERENCE_SECRET); expect(exportStep?.env?.NVIDIA_BUILD_API_KEY).toBe(RAW_PUBLIC_NVIDIA_SECRET); - expect(exportStep?.run).toContain('case "${NEMOCLAW_PROVIDER:-}" in'); - expect(exportStep?.run).toContain("build|cloud)"); - expect(exportStep?.run).toContain( - "NVIDIA_API_KEY or NVIDIA_INFERENCE_API_KEY nvapi-* secret is required", - ); - expect(exportStep?.run).toContain("NVIDIA_INFERENCE_API_KEY=%s"); - expect(exportStep?.run).toContain("NVIDIA_API_KEY=%s"); - expect(exportStep?.run).toContain("NEMOCLAW_MODEL=%s"); - expect(exportStep?.run).toContain("nvidia/nemotron-3-super-120b-a12b"); - expect(exportStep?.run).toContain("NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1"); - expect(exportStep?.run).toContain("NEMOCLAW_PROVIDER=custom"); - expect(exportStep?.run).toContain("NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1"); - expect(exportStep?.run).toContain("NEMOCLAW_MODEL=nvidia/nvidia/nemotron-3-super-v3"); - expect(exportStep?.run).toContain("NEMOCLAW_COMPAT_MODEL=nvidia/nvidia/nemotron-3-super-v3"); - expect(exportStep?.run).toContain("NEMOCLAW_PREFERRED_API=openai-completions"); - expect(exportStep?.run).toContain("COMPATIBLE_API_KEY=%s"); + expect(exportStep?.run).toContain('case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in'); + expect(exportStep?.run).toContain("nvidia-build)"); + expect(exportStep?.run).toContain("NVIDIA_API_KEY nvapi-* secret is required"); + expect(exportStep?.run).toContain("hosted-custom)"); + expect(exportStep?.run).toContain("Unsupported inference_route"); + + const script = exportStep?.run ?? ""; + const hostedEnv = runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "hosted-custom", + HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", + }); + expect(hostedEnv).toMatchObject({ + NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", + NEMOCLAW_E2E_USE_HOSTED_INFERENCE: "1", + NEMOCLAW_PROVIDER: "custom", + NEMOCLAW_ENDPOINT_URL: "https://inference-api.nvidia.com/v1", + NEMOCLAW_MODEL: "nvidia/nvidia/nemotron-3-super-v3", + NEMOCLAW_COMPAT_MODEL: "nvidia/nvidia/nemotron-3-super-v3", + NEMOCLAW_PREFERRED_API: "openai-completions", + COMPATIBLE_API_KEY: "hosted-compatible-key", + }); + expect(hostedEnv.NVIDIA_API_KEY).toBeUndefined(); + + const nvidiaBuildEnv = runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-build", + NVIDIA_BUILD_API_KEY: "nvapi-build-key", + }); + expect(nvidiaBuildEnv).toMatchObject({ + NVIDIA_INFERENCE_API_KEY: "nvapi-build-key", + NVIDIA_API_KEY: "nvapi-build-key", + NEMOCLAW_PROVIDER: "cloud", + NEMOCLAW_MODEL: "nvidia/nemotron-3-super-120b-a12b", + NEMOCLAW_PREFERRED_API: "openai-completions", + }); + expect(nvidiaBuildEnv.COMPATIBLE_API_KEY).toBeUndefined(); + expect(nvidiaBuildEnv.NEMOCLAW_E2E_USE_HOSTED_INFERENCE).toBeUndefined(); + expect(nvidiaBuildEnv.NEMOCLAW_ENDPOINT_URL).toBeUndefined(); + expect(nvidiaBuildEnv.NEMOCLAW_COMPAT_MODEL).toBeUndefined(); expect(hostedJobs.length).toBeGreaterThan(20); for (const [name, job] of hostedJobs) { expect(job.with?.nvidia_secret_as_compatible_api_key, name).toBeUndefined(); const envJson = JSON.parse(job.with?.env_json ?? "{}") as Record; if (nvidiaBuildJobs.has(name)) { - expect(envJson.NEMOCLAW_PROVIDER, name).toBe("cloud"); + expect(job.with?.inference_route, name).toBe("nvidia-build"); expect(envJson.NEMOCLAW_MODEL, name).toBe("nvidia/nemotron-3-super-120b-a12b"); - expect(envJson.NEMOCLAW_PREFERRED_API, name).toBe("openai-completions"); + expect(envJson.NEMOCLAW_PROVIDER, name).toBeUndefined(); + expect(envJson.NEMOCLAW_PREFERRED_API, name).toBeUndefined(); } else { - expect(envJson.NEMOCLAW_PROVIDER, name).not.toBe("cloud"); - expect(envJson.NEMOCLAW_MODEL, name).not.toBe("nvidia/nemotron-3-super-120b-a12b"); + expect(job.with?.inference_route, name).toBeUndefined(); } } + + expect(nightlyWorkflow.jobs["common-egress-agent-e2e"].with?.inference_route).toBeUndefined(); }); it("keeps rebuild fixture registry inference aligned with hosted custom inference", () => { From 35eceb5d006169bed1717b2d5f8b9778ddc87e09 Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 19:26:19 -0400 Subject: [PATCH 03/12] test(e2e): keep inference route checks linear --- test/e2e-script-workflow.test.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index 8b0dbf47bdf..6a348a5abc2 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -1031,17 +1031,18 @@ describe("E2E reusable workflow contract", () => { expect(nvidiaBuildEnv.NEMOCLAW_COMPAT_MODEL).toBeUndefined(); expect(hostedJobs.length).toBeGreaterThan(20); - for (const [name, job] of hostedJobs) { - expect(job.with?.nvidia_secret_as_compatible_api_key, name).toBeUndefined(); + for (const name of nvidiaBuildJobs) { + const job = nightlyWorkflow.jobs[name]; const envJson = JSON.parse(job.with?.env_json ?? "{}") as Record; - if (nvidiaBuildJobs.has(name)) { - expect(job.with?.inference_route, name).toBe("nvidia-build"); - expect(envJson.NEMOCLAW_MODEL, name).toBe("nvidia/nemotron-3-super-120b-a12b"); - expect(envJson.NEMOCLAW_PROVIDER, name).toBeUndefined(); - expect(envJson.NEMOCLAW_PREFERRED_API, name).toBeUndefined(); - } else { - expect(job.with?.inference_route, name).toBeUndefined(); - } + expect(job.with?.nvidia_secret_as_compatible_api_key, name).toBeUndefined(); + expect(job.with?.inference_route, name).toBe("nvidia-build"); + expect(envJson.NEMOCLAW_MODEL, name).toBe("nvidia/nemotron-3-super-120b-a12b"); + expect(envJson.NEMOCLAW_PROVIDER, name).toBeUndefined(); + expect(envJson.NEMOCLAW_PREFERRED_API, name).toBeUndefined(); + } + for (const [name, job] of hostedJobs.filter(([name]) => !nvidiaBuildJobs.has(name))) { + expect(job.with?.nvidia_secret_as_compatible_api_key, name).toBeUndefined(); + expect(job.with?.inference_route, name).toBeUndefined(); } expect(nightlyWorkflow.jobs["common-egress-agent-e2e"].with?.inference_route).toBeUndefined(); From a621ad3f3dfd410b24cc6785c09856f459a5d198 Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 19:31:25 -0400 Subject: [PATCH 04/12] test(e2e): type workflow call secrets --- test/e2e-script-workflow.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index 6a348a5abc2..8ed4d3ad563 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -986,7 +986,10 @@ describe("E2E reusable workflow contract", () => { default: "hosted-custom", }); expect(workflowCall?.inputs?.nvidia_secret_as_compatible_api_key).toBeUndefined(); - expect(workflowCall?.secrets?.NVIDIA_API_KEY).toMatchObject({ required: false }); + expect( + (workflowCall as { secrets?: Record } | undefined)?.secrets + ?.NVIDIA_API_KEY, + ).toMatchObject({ required: false }); expect(exportStep?.if).toBe("${{ inputs.nvidia_api_key }}"); expect(exportStep?.env?.NEMOCLAW_E2E_INFERENCE_ROUTE).toBe("${{ inputs.inference_route }}"); expect(exportStep?.env?.HOSTED_NVIDIA_INFERENCE_API_KEY).toBe(RAW_HOSTED_INFERENCE_SECRET); From 966ded533c77527b0b558906136094889ec125ff Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 19:43:53 -0400 Subject: [PATCH 05/12] test(e2e): cover build route guardrails --- .github/workflows/e2e-script.yaml | 6 ++++ test/e2e-script-workflow.test.ts | 38 +++++++++++++++++++++++++ test/e2e/lib/ci-compatible-inference.sh | 11 ++++--- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-script.yaml b/.github/workflows/e2e-script.yaml index 4c6b13428cc..3482ce3f4ed 100644 --- a/.github/workflows/e2e-script.yaml +++ b/.github/workflows/e2e-script.yaml @@ -231,6 +231,10 @@ jobs: case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in nvidia-build) + # Build route source of truth: callers pass secrets.NVIDIA_API_KEY into + # NVIDIA_BUILD_API_KEY. Mirror it to NVIDIA_INFERENCE_API_KEY only for + # legacy script compatibility until converted scripts accept the + # canonical NVIDIA_API_KEY or stop preflighting the legacy env name. if [[ -z "${NVIDIA_BUILD_API_KEY:-}" || "${NVIDIA_BUILD_API_KEY}" != nvapi-* ]]; then echo "::error::NVIDIA_API_KEY nvapi-* secret is required for NVIDIA Build CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 exit 1 @@ -244,6 +248,8 @@ jobs: } >> "$GITHUB_ENV" ;; hosted-custom) + # Hosted custom route remains on secrets.NVIDIA_INFERENCE_API_KEY and + # never exports NVIDIA_API_KEY, even if the Build secret is present. if [ -z "${HOSTED_NVIDIA_INFERENCE_API_KEY:-}" ]; then echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for hosted CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 exit 1 diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index 8ed4d3ad563..09ee088648f 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -443,6 +443,7 @@ describe("E2E reusable workflow contract", () => { "${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }}", }; const nvidiaBuildJobs = new Set([ + "messaging-providers-e2e", "channels-add-remove-e2e", "channels-stop-start-openclaw-e2e", "channels-stop-start-hermes-e2e", @@ -996,6 +997,8 @@ describe("E2E reusable workflow contract", () => { expect(exportStep?.env?.NVIDIA_BUILD_API_KEY).toBe(RAW_PUBLIC_NVIDIA_SECRET); expect(exportStep?.run).toContain('case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in'); expect(exportStep?.run).toContain("nvidia-build)"); + expect(exportStep?.run).toContain("Build route source of truth"); + expect(exportStep?.run).toContain("Mirror it to NVIDIA_INFERENCE_API_KEY only for"); expect(exportStep?.run).toContain("NVIDIA_API_KEY nvapi-* secret is required"); expect(exportStep?.run).toContain("hosted-custom)"); expect(exportStep?.run).toContain("Unsupported inference_route"); @@ -1017,6 +1020,14 @@ describe("E2E reusable workflow contract", () => { }); expect(hostedEnv.NVIDIA_API_KEY).toBeUndefined(); + const hostedEnvWithBuildSecret = runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "hosted-custom", + HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", + NVIDIA_BUILD_API_KEY: "nvapi-build-key", + }); + expect(hostedEnvWithBuildSecret).toMatchObject(hostedEnv); + expect(hostedEnvWithBuildSecret.NVIDIA_API_KEY).toBeUndefined(); + const nvidiaBuildEnv = runInferenceExportStep(script, { NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-build", NVIDIA_BUILD_API_KEY: "nvapi-build-key", @@ -1033,6 +1044,26 @@ describe("E2E reusable workflow contract", () => { expect(nvidiaBuildEnv.NEMOCLAW_ENDPOINT_URL).toBeUndefined(); expect(nvidiaBuildEnv.NEMOCLAW_COMPAT_MODEL).toBeUndefined(); + expect(() => + runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-build", + NVIDIA_BUILD_API_KEY: "", + }), + ).toThrow(); + expect(() => + runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-build", + NVIDIA_BUILD_API_KEY: "hosted-compatible-key", + }), + ).toThrow(); + expect(() => + runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "unsupported-route", + HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", + NVIDIA_BUILD_API_KEY: "nvapi-build-key", + }), + ).toThrow(); + expect(hostedJobs.length).toBeGreaterThan(20); for (const name of nvidiaBuildJobs) { const job = nightlyWorkflow.jobs[name]; @@ -1049,6 +1080,13 @@ describe("E2E reusable workflow contract", () => { } expect(nightlyWorkflow.jobs["common-egress-agent-e2e"].with?.inference_route).toBeUndefined(); + + const compatibleInferenceShim = readFileSync("test/e2e/lib/ci-compatible-inference.sh", "utf8"); + expect(compatibleInferenceShim).toContain("nvidia-build lanes source secrets.NVIDIA_API_KEY"); + expect(compatibleInferenceShim).toContain("temporary"); + expect(compatibleInferenceShim).toContain( + "compatibility bridge for legacy E2E script preflights", + ); }); it("keeps rebuild fixture registry inference aligned with hosted custom inference", () => { diff --git a/test/e2e/lib/ci-compatible-inference.sh b/test/e2e/lib/ci-compatible-inference.sh index 319378b5044..d3076f730e3 100755 --- a/test/e2e/lib/ci-compatible-inference.sh +++ b/test/e2e/lib/ci-compatible-inference.sh @@ -2,10 +2,13 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# CI-only inference shim: live E2E lanes can use the repository's -# NVIDIA_INFERENCE_API_KEY secret either against the hosted OpenAI-compatible -# endpoint at inference-api.nvidia.com or the built-in NVIDIA Endpoints route at -# integrate.api.nvidia.com. Keep this helper in test/e2e so product-facing +# CI-only inference shim. hosted-custom lanes source the repository's +# NVIDIA_INFERENCE_API_KEY secret for the hosted OpenAI-compatible endpoint at +# inference-api.nvidia.com. nvidia-build lanes source secrets.NVIDIA_API_KEY and +# the reusable workflow mirrors it to NVIDIA_INFERENCE_API_KEY as a temporary +# compatibility bridge for legacy E2E script preflights; remove that mirror once +# converted scripts consume NVIDIA_API_KEY directly or stop preflighting the +# legacy env name. Keep this helper in test/e2e so product-facing # provider/default endpoint behavior remains explicit. NEMOCLAW_E2E_COMPATIBLE_INFERENCE_MODEL_DEFAULT="nvidia/nvidia/nemotron-3-super-v3" From a55a232d1b00a90f5706e3b1d74c5be05aeca700 Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 19:51:03 -0400 Subject: [PATCH 06/12] test(e2e): avoid source-shape assertions --- test/e2e-script-workflow.test.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index 09ee088648f..25d13a0b7a5 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -1080,13 +1080,6 @@ describe("E2E reusable workflow contract", () => { } expect(nightlyWorkflow.jobs["common-egress-agent-e2e"].with?.inference_route).toBeUndefined(); - - const compatibleInferenceShim = readFileSync("test/e2e/lib/ci-compatible-inference.sh", "utf8"); - expect(compatibleInferenceShim).toContain("nvidia-build lanes source secrets.NVIDIA_API_KEY"); - expect(compatibleInferenceShim).toContain("temporary"); - expect(compatibleInferenceShim).toContain( - "compatibility bridge for legacy E2E script preflights", - ); }); it("keeps rebuild fixture registry inference aligned with hosted custom inference", () => { From 9db0d440356f38da3d35f3ae3510ee5c41eaa2fd Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 20:25:15 -0400 Subject: [PATCH 07/12] ci(e2e): route shared jobs to internal inference --- .github/workflows/e2e-script.yaml | 35 ++++--- .github/workflows/nightly-e2e.yaml | 50 +++++----- .../support-tests/hosted-inference.test.ts | 4 +- test/e2e-script-workflow.test.ts | 93 +++++++------------ test/e2e/lib/ci-compatible-inference.sh | 15 +-- 5 files changed, 83 insertions(+), 114 deletions(-) diff --git a/.github/workflows/e2e-script.yaml b/.github/workflows/e2e-script.yaml index 3482ce3f4ed..80550ebbdac 100644 --- a/.github/workflows/e2e-script.yaml +++ b/.github/workflows/e2e-script.yaml @@ -63,7 +63,7 @@ on: type: boolean default: false inference_route: - description: "Inference route to export when nvidia_api_key is true: hosted-custom or nvidia-build." + description: "Inference route to export when nvidia_api_key is true: hosted-custom or nvidia-internal." required: false type: string default: hosted-custom @@ -85,8 +85,6 @@ on: secrets: NVIDIA_INFERENCE_API_KEY: required: false - NVIDIA_API_KEY: - required: false BRAVE_API_KEY: required: false DOCKERHUB_USERNAME: @@ -224,32 +222,33 @@ jobs: env: NEMOCLAW_E2E_INFERENCE_ROUTE: ${{ inputs.inference_route }} HOSTED_NVIDIA_INFERENCE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }} - NVIDIA_BUILD_API_KEY: ${{ secrets.NVIDIA_API_KEY }} shell: bash run: | set -euo pipefail case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in - nvidia-build) - # Build route source of truth: callers pass secrets.NVIDIA_API_KEY into - # NVIDIA_BUILD_API_KEY. Mirror it to NVIDIA_INFERENCE_API_KEY only for - # legacy script compatibility until converted scripts accept the - # canonical NVIDIA_API_KEY or stop preflighting the legacy env name. - if [[ -z "${NVIDIA_BUILD_API_KEY:-}" || "${NVIDIA_BUILD_API_KEY}" != nvapi-* ]]; then - echo "::error::NVIDIA_API_KEY nvapi-* secret is required for NVIDIA Build CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 + nvidia-internal) + # Internal hosted route source of truth: callers pass the repository + # NVIDIA_INFERENCE_API_KEY secret to the OpenAI-compatible internal + # inference endpoint. COMPATIBLE_API_KEY is an env alias required by + # the custom provider runtime, not a separate secret value. + if [ -z "${HOSTED_NVIDIA_INFERENCE_API_KEY:-}" ]; then + echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for internal CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 exit 1 fi { - printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${NVIDIA_BUILD_API_KEY}" - printf 'NVIDIA_API_KEY=%s\n' "${NVIDIA_BUILD_API_KEY}" - printf 'NEMOCLAW_PROVIDER=cloud\n' - printf 'NEMOCLAW_MODEL=%s\n' "${NEMOCLAW_MODEL:-nvidia/nemotron-3-super-120b-a12b}" - printf 'NEMOCLAW_PREFERRED_API=%s\n' "${NEMOCLAW_PREFERRED_API:-openai-completions}" + printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" + printf 'NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1\n' + printf 'NEMOCLAW_PROVIDER=custom\n' + printf 'NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1\n' + printf 'NEMOCLAW_MODEL=nvidia/nemotron-3-super-v3\n' + printf 'NEMOCLAW_COMPAT_MODEL=nvidia/nemotron-3-super-v3\n' + printf 'NEMOCLAW_PREFERRED_API=openai-completions\n' + printf 'COMPATIBLE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" } >> "$GITHUB_ENV" ;; hosted-custom) - # Hosted custom route remains on secrets.NVIDIA_INFERENCE_API_KEY and - # never exports NVIDIA_API_KEY, even if the Build secret is present. + # Hosted custom route remains the default legacy CI route. if [ -z "${HOSTED_NVIDIA_INFERENCE_API_KEY:-}" ]; then echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for hosted CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 exit 1 diff --git a/.github/workflows/nightly-e2e.yaml b/.github/workflows/nightly-e2e.yaml index 5c4f4ab5353..afafbf79230 100644 --- a/.github/workflows/nightly-e2e.yaml +++ b/.github/workflows/nightly-e2e.yaml @@ -374,13 +374,13 @@ jobs: artifact_path: | /tmp/nemoclaw-e2e-install.log /tmp/nemoclaw-e2e-whatsapp-*.log - env_json: '{"DISCORD_BOT_TOKEN":"test-fake-discord-token-e2e","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-msg-provider","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-e2e","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-e2e","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' + env_json: '{"DISCORD_BOT_TOKEN":"test-fake-discord-token-e2e","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-msg-provider","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-e2e","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-e2e"}' nvidia_api_key: true - inference_route: nvidia-build + inference_route: nvidia-internal github_token: true messaging_live_secrets: ${{ github.event_name != 'workflow_dispatch' || inputs.target_ref == '' }} secrets: - NVIDIA_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_API_KEY || '' }} + NVIDIA_INFERENCE_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_INFERENCE_API_KEY || '' }} BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} DOCKERHUB_USERNAME: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }} DOCKERHUB_TOKEN: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }} @@ -763,12 +763,12 @@ jobs: /tmp/nc-remove.log /tmp/nc-rebuild-add.log /tmp/nc-rebuild-remove.log - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-channels-add-remove","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-add-remove-e2e","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-channels-add-remove","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-add-remove-e2e"}' nvidia_api_key: true - inference_route: nvidia-build + inference_route: nvidia-internal github_token: true - secrets: &nightly-e2e-nvidia-build-secrets - NVIDIA_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_API_KEY || '' }} + secrets: &nightly-e2e-internal-inference-secrets + NVIDIA_INFERENCE_API_KEY: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.NVIDIA_INFERENCE_API_KEY || '' }} BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }} DOCKERHUB_USERNAME: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }} DOCKERHUB_TOKEN: ${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }} @@ -791,11 +791,11 @@ jobs: /tmp/nemoclaw-e2e-install.log /tmp/nemoclaw-e2e-channels-*-install.log /tmp/nc-channels-*.log - env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"openclaw","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' + env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"openclaw","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator"}' nvidia_api_key: true - inference_route: nvidia-build + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-nvidia-build-secrets + secrets: *nightly-e2e-internal-inference-secrets channels-stop-start-hermes-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -811,11 +811,11 @@ jobs: /tmp/nemoclaw-e2e-install.log /tmp/nemoclaw-e2e-channels-*-install.log /tmp/nc-channels-*.log - env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' + env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-stop-start-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_ID":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_CHANNELS_STOP_START_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_SANDBOX_NAME":"e2e-channels-stop-start","SLACK_ALLOWED_USERS":"U0123456789,U09ABCDEFGH","SLACK_APP_TOKEN":"xapp-fake-slack-app-token-stop-start-e2e","SLACK_BOT_TOKEN":"xoxb-fake-slack-token-stop-start-e2e","TELEGRAM_ALLOWED_IDS":"123456789","TELEGRAM_BOT_TOKEN":"test-fake-telegram-token-stop-start-e2e","WECHAT_ACCOUNT_ID":"e2e-fake-account-stop-start","WECHAT_ALLOWED_IDS":"wxid_stopstart_operator","WECHAT_BASE_URL":"https://ilinkai.wechat.com","WECHAT_BOT_TOKEN":"test-fake-wechat-token-stop-start-e2e","WECHAT_USER_ID":"wxid_stopstart_operator"}' nvidia_api_key: true - inference_route: nvidia-build + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-nvidia-build-secrets + secrets: *nightly-e2e-internal-inference-secrets brave-search-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -1202,11 +1202,11 @@ jobs: timeout_minutes: 60 artifact_name: "hermes-discord-e2e-install-log" artifact_path: "/tmp/nemoclaw-e2e-hermes-discord-install.log" - env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-hermes-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_IDS":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_RECREATE_SANDBOX":"1","NEMOCLAW_SANDBOX_NAME":"e2e-hermes-discord","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' + env_json: '{"DISCORD_ALLOWED_IDS":"1005536447329222676","DISCORD_BOT_TOKEN":"test-fake-discord-token-hermes-e2e","DISCORD_REQUIRE_MENTION":"0","DISCORD_SERVER_IDS":"1491590992753590594","NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_POLICY_TIER":"open","NEMOCLAW_RECREATE_SANDBOX":"1","NEMOCLAW_SANDBOX_NAME":"e2e-hermes-discord"}' nvidia_api_key: true - inference_route: nvidia-build + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-nvidia-build-secrets + secrets: *nightly-e2e-internal-inference-secrets hermes-slack-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -1701,11 +1701,11 @@ jobs: artifact_path: | /tmp/nemoclaw-e2e-old-install.log /tmp/nemoclaw-e2e-upgrade-install.log - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-upgrade-stale","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-upgrade-stale"}' nvidia_api_key: true - inference_route: nvidia-build + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-nvidia-build-secrets + secrets: *nightly-e2e-internal-inference-secrets openshell-gateway-upgrade-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && @@ -1760,11 +1760,11 @@ jobs: timeout_minutes: 60 artifact_name: "rebuild-hermes-install-log" artifact_path: "/tmp/nemoclaw-e2e-install.log" - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm"}' nvidia_api_key: true - inference_route: nvidia-build + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-nvidia-build-secrets + secrets: *nightly-e2e-internal-inference-secrets rebuild-hermes-stale-base-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -1777,11 +1777,11 @@ jobs: timeout_minutes: 60 artifact_name: "rebuild-hermes-stale-base-install-log" artifact_path: "/tmp/nemoclaw-e2e-install.log" - env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_HERMES_STALE_BASE_REBUILD_E2E":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm-base","NEMOCLAW_MODEL":"nvidia/nemotron-3-super-120b-a12b"}' + env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_AGENT":"hermes","NEMOCLAW_HERMES_STALE_BASE_REBUILD_E2E":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_SANDBOX_NAME":"e2e-rebuild-hm-base"}' nvidia_api_key: true - inference_route: nvidia-build + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-nvidia-build-secrets + secrets: *nightly-e2e-internal-inference-secrets double-onboard-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && diff --git a/test/e2e-scenario/support-tests/hosted-inference.test.ts b/test/e2e-scenario/support-tests/hosted-inference.test.ts index e594feb04b6..8a21df80667 100644 --- a/test/e2e-scenario/support-tests/hosted-inference.test.ts +++ b/test/e2e-scenario/support-tests/hosted-inference.test.ts @@ -119,7 +119,7 @@ describe("hosted inference E2E config", () => { expect(calls).not.toContain("Bearer"); }); - it("uses the NVIDIA Endpoints reachability probe for nvapi cloud routes", () => { + it("uses a lightweight nvapi reachability probe without /models or auth", () => { const { result, calls } = runHostedProbe({ env: { NVIDIA_INFERENCE_API_KEY: "nvapi-test-key", @@ -129,7 +129,7 @@ describe("hosted inference E2E config", () => { }); expect(result.status).toBe(0); - expect(calls).toContain("ARG:https://integrate.api.nvidia.com/v1"); + expect(calls).toContain("ARG:https://inference-api.nvidia.com/v1"); expect(calls).not.toContain("/models"); expect(calls).not.toContain("Authorization"); expect(calls).not.toContain("Bearer"); diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index 25d13a0b7a5..09fac34baf1 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -434,24 +434,6 @@ describe("E2E reusable workflow contract", () => { DOCKERHUB_TOKEN: "${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }}", }; - const nvidiaBuildSecrets = { - NVIDIA_API_KEY: GUARDED_PUBLIC_NVIDIA_SECRET, - BRAVE_API_KEY: "${{ secrets.BRAVE_API_KEY }}", - DOCKERHUB_USERNAME: - "${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_USERNAME || '' }}", - DOCKERHUB_TOKEN: - "${{ (github.event_name != 'workflow_dispatch' || inputs.target_ref == '') && secrets.DOCKERHUB_TOKEN || '' }}", - }; - const nvidiaBuildJobs = new Set([ - "messaging-providers-e2e", - "channels-add-remove-e2e", - "channels-stop-start-openclaw-e2e", - "channels-stop-start-hermes-e2e", - "hermes-discord-e2e", - "upgrade-stale-sandbox-e2e", - "rebuild-hermes-e2e", - "rebuild-hermes-stale-base-e2e", - ]); const messagingLiveSecrets = { TELEGRAM_BOT_TOKEN_REAL: `\${{ (${TRUSTED_REF_GUARD}) && secrets.TELEGRAM_BOT_TOKEN_REAL || '' }}`, TELEGRAM_CHAT_ID_E2E: `\${{ (${TRUSTED_REF_GUARD}) && secrets.TELEGRAM_CHAT_ID_E2E || '' }}`, @@ -466,10 +448,8 @@ describe("E2E reusable workflow contract", () => { for (const [name, job] of reusableJobs) { const expectsLiveMessaging = name === "messaging-providers-e2e"; const expectedSecrets = expectsLiveMessaging - ? { ...nvidiaBuildSecrets, ...messagingLiveSecrets } - : nvidiaBuildJobs.has(name) - ? nvidiaBuildSecrets - : defaultSecrets; + ? { ...defaultSecrets, ...messagingLiveSecrets } + : defaultSecrets; expect(job.secrets, name).toEqual(expectedSecrets); expect(job.with?.messaging_live_secrets ?? false, name).toBe( expectsLiveMessaging @@ -957,7 +937,7 @@ describe("E2E reusable workflow contract", () => { expect(exportStep?.run).toContain('>> "$GITHUB_ENV"'); }); - it("routes reusable NVIDIA-key jobs through explicit hosted or NVIDIA Build env", () => { + it("routes reusable NVIDIA-key jobs through explicit hosted or internal NVIDIA env", () => { const exportStep = runnerWorkflow.jobs.run.steps.find( (step) => step.name === "Export CI inference environment", ); @@ -965,7 +945,7 @@ describe("E2E reusable workflow contract", () => { const hostedJobs = reusableNightlyJobs(nightlyWorkflow).filter( ([, job]) => String(job.with?.nvidia_api_key) === "true", ); - const nvidiaBuildJobs = new Set([ + const internalInferenceJobs = new Set([ "messaging-providers-e2e", "channels-add-remove-e2e", "channels-stop-start-openclaw-e2e", @@ -990,16 +970,16 @@ describe("E2E reusable workflow contract", () => { expect( (workflowCall as { secrets?: Record } | undefined)?.secrets ?.NVIDIA_API_KEY, - ).toMatchObject({ required: false }); + ).toBeUndefined(); expect(exportStep?.if).toBe("${{ inputs.nvidia_api_key }}"); expect(exportStep?.env?.NEMOCLAW_E2E_INFERENCE_ROUTE).toBe("${{ inputs.inference_route }}"); expect(exportStep?.env?.HOSTED_NVIDIA_INFERENCE_API_KEY).toBe(RAW_HOSTED_INFERENCE_SECRET); - expect(exportStep?.env?.NVIDIA_BUILD_API_KEY).toBe(RAW_PUBLIC_NVIDIA_SECRET); + expect(exportStep?.env?.NVIDIA_BUILD_API_KEY).toBeUndefined(); expect(exportStep?.run).toContain('case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in'); - expect(exportStep?.run).toContain("nvidia-build)"); - expect(exportStep?.run).toContain("Build route source of truth"); - expect(exportStep?.run).toContain("Mirror it to NVIDIA_INFERENCE_API_KEY only for"); - expect(exportStep?.run).toContain("NVIDIA_API_KEY nvapi-* secret is required"); + expect(exportStep?.run).toContain("nvidia-internal)"); + expect(exportStep?.run).toContain( + "NVIDIA_INFERENCE_API_KEY secret is required for internal CI inference", + ); expect(exportStep?.run).toContain("hosted-custom)"); expect(exportStep?.run).toContain("Unsupported inference_route"); @@ -1020,61 +1000,56 @@ describe("E2E reusable workflow contract", () => { }); expect(hostedEnv.NVIDIA_API_KEY).toBeUndefined(); - const hostedEnvWithBuildSecret = runInferenceExportStep(script, { + const hostedEnvWithPublicSecret = runInferenceExportStep(script, { NEMOCLAW_E2E_INFERENCE_ROUTE: "hosted-custom", HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", - NVIDIA_BUILD_API_KEY: "nvapi-build-key", + NVIDIA_API_KEY: "nvapi-public-build-key", }); - expect(hostedEnvWithBuildSecret).toMatchObject(hostedEnv); - expect(hostedEnvWithBuildSecret.NVIDIA_API_KEY).toBeUndefined(); + expect(hostedEnvWithPublicSecret).toMatchObject(hostedEnv); + expect(hostedEnvWithPublicSecret.NVIDIA_API_KEY).toBeUndefined(); - const nvidiaBuildEnv = runInferenceExportStep(script, { - NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-build", - NVIDIA_BUILD_API_KEY: "nvapi-build-key", + const internalInferenceEnv = runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-internal", + HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", }); - expect(nvidiaBuildEnv).toMatchObject({ - NVIDIA_INFERENCE_API_KEY: "nvapi-build-key", - NVIDIA_API_KEY: "nvapi-build-key", - NEMOCLAW_PROVIDER: "cloud", - NEMOCLAW_MODEL: "nvidia/nemotron-3-super-120b-a12b", + expect(internalInferenceEnv).toMatchObject({ + NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", + NEMOCLAW_E2E_USE_HOSTED_INFERENCE: "1", + NEMOCLAW_PROVIDER: "custom", + NEMOCLAW_ENDPOINT_URL: "https://inference-api.nvidia.com/v1", + NEMOCLAW_MODEL: "nvidia/nemotron-3-super-v3", + NEMOCLAW_COMPAT_MODEL: "nvidia/nemotron-3-super-v3", NEMOCLAW_PREFERRED_API: "openai-completions", + COMPATIBLE_API_KEY: "hosted-compatible-key", }); - expect(nvidiaBuildEnv.COMPATIBLE_API_KEY).toBeUndefined(); - expect(nvidiaBuildEnv.NEMOCLAW_E2E_USE_HOSTED_INFERENCE).toBeUndefined(); - expect(nvidiaBuildEnv.NEMOCLAW_ENDPOINT_URL).toBeUndefined(); - expect(nvidiaBuildEnv.NEMOCLAW_COMPAT_MODEL).toBeUndefined(); + expect(internalInferenceEnv.NVIDIA_API_KEY).toBeUndefined(); expect(() => runInferenceExportStep(script, { - NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-build", - NVIDIA_BUILD_API_KEY: "", - }), - ).toThrow(); - expect(() => - runInferenceExportStep(script, { - NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-build", - NVIDIA_BUILD_API_KEY: "hosted-compatible-key", + NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-internal", + HOSTED_NVIDIA_INFERENCE_API_KEY: "", }), ).toThrow(); expect(() => runInferenceExportStep(script, { NEMOCLAW_E2E_INFERENCE_ROUTE: "unsupported-route", HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", - NVIDIA_BUILD_API_KEY: "nvapi-build-key", }), ).toThrow(); expect(hostedJobs.length).toBeGreaterThan(20); - for (const name of nvidiaBuildJobs) { + for (const name of internalInferenceJobs) { const job = nightlyWorkflow.jobs[name]; const envJson = JSON.parse(job.with?.env_json ?? "{}") as Record; expect(job.with?.nvidia_secret_as_compatible_api_key, name).toBeUndefined(); - expect(job.with?.inference_route, name).toBe("nvidia-build"); - expect(envJson.NEMOCLAW_MODEL, name).toBe("nvidia/nemotron-3-super-120b-a12b"); + expect(job.with?.inference_route, name).toBe("nvidia-internal"); + expect(job.secrets?.NVIDIA_INFERENCE_API_KEY, name).toBe(GUARDED_HOSTED_INFERENCE_SECRET); + expect(job.secrets?.NVIDIA_API_KEY, name).toBeUndefined(); + expect(envJson.NEMOCLAW_MODEL, name).toBeUndefined(); expect(envJson.NEMOCLAW_PROVIDER, name).toBeUndefined(); expect(envJson.NEMOCLAW_PREFERRED_API, name).toBeUndefined(); } - for (const [name, job] of hostedJobs.filter(([name]) => !nvidiaBuildJobs.has(name))) { + for (const [name, job] of hostedJobs.filter(([name]) => !internalInferenceJobs.has(name))) { expect(job.with?.nvidia_secret_as_compatible_api_key, name).toBeUndefined(); expect(job.with?.inference_route, name).toBeUndefined(); } diff --git a/test/e2e/lib/ci-compatible-inference.sh b/test/e2e/lib/ci-compatible-inference.sh index d3076f730e3..01ae3c99328 100755 --- a/test/e2e/lib/ci-compatible-inference.sh +++ b/test/e2e/lib/ci-compatible-inference.sh @@ -2,18 +2,13 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# CI-only inference shim. hosted-custom lanes source the repository's -# NVIDIA_INFERENCE_API_KEY secret for the hosted OpenAI-compatible endpoint at -# inference-api.nvidia.com. nvidia-build lanes source secrets.NVIDIA_API_KEY and -# the reusable workflow mirrors it to NVIDIA_INFERENCE_API_KEY as a temporary -# compatibility bridge for legacy E2E script preflights; remove that mirror once -# converted scripts consume NVIDIA_API_KEY directly or stop preflighting the -# legacy env name. Keep this helper in test/e2e so product-facing -# provider/default endpoint behavior remains explicit. +# CI-only hosted inference shim: live E2E lanes use the repository's +# NVIDIA_INFERENCE_API_KEY secret against the hosted OpenAI-compatible endpoint +# at inference-api.nvidia.com. Keep this helper in test/e2e so the +# product-facing provider/default endpoint remain unchanged. NEMOCLAW_E2E_COMPATIBLE_INFERENCE_MODEL_DEFAULT="nvidia/nvidia/nemotron-3-super-v3" NEMOCLAW_E2E_HOSTED_INFERENCE_PROVIDER_DEFAULT="compatible-endpoint" -NEMOCLAW_E2E_NVIDIA_INFERENCE_ENDPOINT_DEFAULT="https://integrate.api.nvidia.com/v1" NEMOCLAW_E2E_NVIDIA_INFERENCE_MODEL_DEFAULT="nvidia/nemotron-3-super-120b-a12b" nemoclaw_e2e_using_compatible_inference() { @@ -54,7 +49,7 @@ nemoclaw_e2e_hosted_inference_base_url() { if nemoclaw_e2e_using_compatible_inference; then printf '%s' "${NEMOCLAW_ENDPOINT_URL:-https://inference-api.nvidia.com/v1}" else - printf '%s' "$NEMOCLAW_E2E_NVIDIA_INFERENCE_ENDPOINT_DEFAULT" + printf '%s' "https://inference-api.nvidia.com/v1" fi } From 9e109d196817f4915346981248305b068243d475 Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 20:32:53 -0400 Subject: [PATCH 08/12] test(e2e): remove stale public secret constant --- test/e2e-script-workflow.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index 09fac34baf1..b42fcf32a9a 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -49,7 +49,6 @@ const TRUSTED_REF_GUARD = "github.event_name != 'workflow_dispatch' || inputs.ta const GUARDED_HOSTED_INFERENCE_SECRET = `\${{ (${TRUSTED_REF_GUARD}) && secrets.NVIDIA_INFERENCE_API_KEY || '' }}`; const GUARDED_PUBLIC_NVIDIA_SECRET = `\${{ (${TRUSTED_REF_GUARD}) && secrets.NVIDIA_API_KEY || '' }}`; const RAW_HOSTED_INFERENCE_SECRET = "${{ secrets.NVIDIA_INFERENCE_API_KEY }}"; -const RAW_PUBLIC_NVIDIA_SECRET = "${{ secrets.NVIDIA_API_KEY }}"; function timingSummary( phases: Record = { "nemoclaw.onboard.phase.preflight": 1000 }, From 0df0d0c2a962039f003702e9519abdd274898237 Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 20:53:48 -0400 Subject: [PATCH 09/12] ci(e2e): use hosted internal model alias --- .github/workflows/e2e-script.yaml | 4 ++-- test/e2e-script-workflow.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-script.yaml b/.github/workflows/e2e-script.yaml index 80550ebbdac..ee27038bc28 100644 --- a/.github/workflows/e2e-script.yaml +++ b/.github/workflows/e2e-script.yaml @@ -241,8 +241,8 @@ jobs: printf 'NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1\n' printf 'NEMOCLAW_PROVIDER=custom\n' printf 'NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1\n' - printf 'NEMOCLAW_MODEL=nvidia/nemotron-3-super-v3\n' - printf 'NEMOCLAW_COMPAT_MODEL=nvidia/nemotron-3-super-v3\n' + printf 'NEMOCLAW_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' + printf 'NEMOCLAW_COMPAT_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' printf 'NEMOCLAW_PREFERRED_API=openai-completions\n' printf 'COMPATIBLE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" } >> "$GITHUB_ENV" diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index b42fcf32a9a..769f35178f9 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -1016,8 +1016,8 @@ describe("E2E reusable workflow contract", () => { NEMOCLAW_E2E_USE_HOSTED_INFERENCE: "1", NEMOCLAW_PROVIDER: "custom", NEMOCLAW_ENDPOINT_URL: "https://inference-api.nvidia.com/v1", - NEMOCLAW_MODEL: "nvidia/nemotron-3-super-v3", - NEMOCLAW_COMPAT_MODEL: "nvidia/nemotron-3-super-v3", + NEMOCLAW_MODEL: "nvidia/nvidia/nemotron-3-super-v3", + NEMOCLAW_COMPAT_MODEL: "nvidia/nvidia/nemotron-3-super-v3", NEMOCLAW_PREFERRED_API: "openai-completions", COMPATIBLE_API_KEY: "hosted-compatible-key", }); From ffcb9b2c798c8118aa418152b1fbf058f1248582 Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 21:01:23 -0400 Subject: [PATCH 10/12] ci(e2e): document internal route equivalence --- .github/workflows/e2e-script.yaml | 31 ++++++++----------------------- test/e2e-script-workflow.test.ts | 14 +++++++++----- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/.github/workflows/e2e-script.yaml b/.github/workflows/e2e-script.yaml index ee27038bc28..c40a8a2fc3e 100644 --- a/.github/workflows/e2e-script.yaml +++ b/.github/workflows/e2e-script.yaml @@ -227,30 +227,15 @@ jobs: set -euo pipefail case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in - nvidia-internal) - # Internal hosted route source of truth: callers pass the repository - # NVIDIA_INFERENCE_API_KEY secret to the OpenAI-compatible internal - # inference endpoint. COMPATIBLE_API_KEY is an env alias required by - # the custom provider runtime, not a separate secret value. + nvidia-internal|hosted-custom) + # Source of truth: both labels intentionally export the same + # internal hosted-compatible runtime env. `hosted-custom` remains + # the default legacy route; `nvidia-internal` is only an explicit + # caller-selection label for jobs moved away from public NVIDIA + # Endpoints/Build after HTTP 429s. Remove the split once those jobs + # no longer need an auditable opt-in label. if [ -z "${HOSTED_NVIDIA_INFERENCE_API_KEY:-}" ]; then - echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for internal CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 - exit 1 - fi - { - printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" - printf 'NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1\n' - printf 'NEMOCLAW_PROVIDER=custom\n' - printf 'NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1\n' - printf 'NEMOCLAW_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' - printf 'NEMOCLAW_COMPAT_MODEL=nvidia/nvidia/nemotron-3-super-v3\n' - printf 'NEMOCLAW_PREFERRED_API=openai-completions\n' - printf 'COMPATIBLE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" - } >> "$GITHUB_ENV" - ;; - hosted-custom) - # Hosted custom route remains the default legacy CI route. - if [ -z "${HOSTED_NVIDIA_INFERENCE_API_KEY:-}" ]; then - echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for hosted CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 + echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for ${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom} CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 exit 1 fi diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index 769f35178f9..a078073f62f 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -975,11 +975,9 @@ describe("E2E reusable workflow contract", () => { expect(exportStep?.env?.HOSTED_NVIDIA_INFERENCE_API_KEY).toBe(RAW_HOSTED_INFERENCE_SECRET); expect(exportStep?.env?.NVIDIA_BUILD_API_KEY).toBeUndefined(); expect(exportStep?.run).toContain('case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in'); - expect(exportStep?.run).toContain("nvidia-internal)"); - expect(exportStep?.run).toContain( - "NVIDIA_INFERENCE_API_KEY secret is required for internal CI inference", - ); - expect(exportStep?.run).toContain("hosted-custom)"); + expect(exportStep?.run).toContain("nvidia-internal|hosted-custom)"); + expect(exportStep?.run).toContain("both labels intentionally export the same"); + expect(exportStep?.run).toContain("Remove the split once those jobs"); expect(exportStep?.run).toContain("Unsupported inference_route"); const script = exportStep?.run ?? ""; @@ -1023,6 +1021,12 @@ describe("E2E reusable workflow contract", () => { }); expect(internalInferenceEnv.NVIDIA_API_KEY).toBeUndefined(); + expect(() => + runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "hosted-custom", + HOSTED_NVIDIA_INFERENCE_API_KEY: "", + }), + ).toThrow(); expect(() => runInferenceExportStep(script, { NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-internal", From 0f0dae3dd9c6e3ccf1777d967b375abba31d2872 Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 21:09:30 -0400 Subject: [PATCH 11/12] ci(e2e): harden inference env export --- .github/workflows/e2e-script.yaml | 6 ++- test/e2e-script-workflow.test.ts | 88 ++++++++++++++++++++++++------- 2 files changed, 73 insertions(+), 21 deletions(-) diff --git a/.github/workflows/e2e-script.yaml b/.github/workflows/e2e-script.yaml index c40a8a2fc3e..491db4b1241 100644 --- a/.github/workflows/e2e-script.yaml +++ b/.github/workflows/e2e-script.yaml @@ -238,6 +238,10 @@ jobs: echo "::error::NVIDIA_INFERENCE_API_KEY secret is required for ${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom} CI inference; it is withheld for workflow_dispatch target_ref runs." >&2 exit 1 fi + if [[ "${HOSTED_NVIDIA_INFERENCE_API_KEY}" == *$'\n'* || "${HOSTED_NVIDIA_INFERENCE_API_KEY}" == *$'\r'* ]]; then + echo "::error::NVIDIA_INFERENCE_API_KEY secret must be a single-line value before export to GITHUB_ENV." >&2 + exit 1 + fi { printf 'NVIDIA_INFERENCE_API_KEY=%s\n' "${HOSTED_NVIDIA_INFERENCE_API_KEY}" @@ -251,7 +255,7 @@ jobs: } >> "$GITHUB_ENV" ;; *) - echo "::error::Unsupported inference_route: ${NEMOCLAW_E2E_INFERENCE_ROUTE}" >&2 + echo "::error::Unsupported inference_route value." >&2 exit 1 ;; esac diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index a078073f62f..c2dc30d672e 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -137,37 +137,66 @@ function envReferencesHostedInferenceSecret(env?: Record): boole ); } -function runInferenceExportStep( +type InferenceExportResult = { + env: Record; + stderr: string; + failed: boolean; +}; + +function parseGithubEnv(pathname: string): Record { + return Object.fromEntries( + readFileSync(pathname, "utf8") + .trim() + .split("\n") + .filter(Boolean) + .map((line) => { + const index = line.indexOf("="); + return [line.slice(0, index), line.slice(index + 1)]; + }), + ); +} + +function runInferenceExportStepRaw( script: string, env: Record, -): Record { +): InferenceExportResult { const tempDir = mkdtempSync(path.join(tmpdir(), "nemoclaw-e2e-inference-export-")); const githubEnv = path.join(tempDir, "github-env"); writeFileSync(githubEnv, "", "utf8"); try { - execFileSync("bash", ["-c", script], { - encoding: "utf8", - env: { - PATH: process.env.PATH ?? "", - GITHUB_ENV: githubEnv, - ...env, - }, - }); - return Object.fromEntries( - readFileSync(githubEnv, "utf8") - .trim() - .split("\n") - .filter(Boolean) - .map((line) => { - const index = line.indexOf("="); - return [line.slice(0, index), line.slice(index + 1)]; - }), - ); + try { + execFileSync("bash", ["-c", script], { + encoding: "utf8", + env: { + PATH: process.env.PATH ?? "", + GITHUB_ENV: githubEnv, + ...env, + }, + }); + return { env: parseGithubEnv(githubEnv), stderr: "", failed: false }; + } catch (error) { + return { + env: parseGithubEnv(githubEnv), + stderr: error && typeof error === "object" && "stderr" in error ? String(error.stderr) : "", + failed: true, + }; + } } finally { rmSync(tempDir, { recursive: true, force: true }); } } +function runInferenceExportStep( + script: string, + env: Record, +): Record { + const result = runInferenceExportStepRaw(script, env); + if (result.failed) { + throw new Error(result.stderr || "Inference export step failed"); + } + return result.env; +} + // Direct legacy bash E2Es are being migrated toward Vitest coverage. Keep the // top-level shell suite frozen so new coverage starts in the newer E2E surface // unless maintainers intentionally update this allowlist. @@ -1033,6 +1062,25 @@ describe("E2E reusable workflow contract", () => { HOSTED_NVIDIA_INFERENCE_API_KEY: "", }), ).toThrow(); + + const multilineSecretResult = runInferenceExportStepRaw(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-internal", + HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key\nINJECTED_ENV=1", + }); + expect(multilineSecretResult.failed).toBe(true); + expect(multilineSecretResult.stderr).toContain("secret must be a single-line value"); + expect(multilineSecretResult.env.NVIDIA_INFERENCE_API_KEY).toBeUndefined(); + expect(multilineSecretResult.env.COMPATIBLE_API_KEY).toBeUndefined(); + expect(multilineSecretResult.env.INJECTED_ENV).toBeUndefined(); + + const unsupportedRouteResult = runInferenceExportStepRaw(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "unsupported-route\n::error::injected", + HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", + }); + expect(unsupportedRouteResult.failed).toBe(true); + expect(unsupportedRouteResult.stderr).toContain("Unsupported inference_route value."); + expect(unsupportedRouteResult.stderr).not.toContain("unsupported-route"); + expect(unsupportedRouteResult.stderr).not.toContain("injected"); expect(() => runInferenceExportStep(script, { NEMOCLAW_E2E_INFERENCE_ROUTE: "unsupported-route", From c3981e5f942770b3cc184b2f0edf75b11dda85cd Mon Sep 17 00:00:00 2001 From: Julie Yaunches Date: Tue, 23 Jun 2026 21:11:04 -0400 Subject: [PATCH 12/12] test(e2e): keep export helper linear --- test/e2e-script-workflow.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e-script-workflow.test.ts b/test/e2e-script-workflow.test.ts index c2dc30d672e..7fe7ef25cf8 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -191,9 +191,10 @@ function runInferenceExportStep( env: Record, ): Record { const result = runInferenceExportStepRaw(script, env); - if (result.failed) { - throw new Error(result.stderr || "Inference export step failed"); - } + result.failed && + (() => { + throw new Error(result.stderr || "Inference export step failed"); + })(); return result.env; }