diff --git a/.github/workflows/e2e-script.yaml b/.github/workflows/e2e-script.yaml index 177e30ff954..0f276757449 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 hosted inference source secret as the CI custom endpoint credential. + 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-internal." + required: false + type: string + default: hosted-custom brave_api_key: description: Pass the BRAVE_API_KEY secret to the script. required: false @@ -212,28 +217,48 @@ 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 }} + NEMOCLAW_E2E_INFERENCE_ROUTE: ${{ inputs.inference_route }} + HOSTED_NVIDIA_INFERENCE_API_KEY: ${{ secrets.NVIDIA_INFERENCE_API_KEY }} shell: bash run: | set -euo pipefail - if [ -z "${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 + case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in + 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 ${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 '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-ultra\n' - printf 'NEMOCLAW_COMPAT_MODEL=nvidia/nvidia/nemotron-3-ultra\n' - printf 'NEMOCLAW_PREFERRED_API=openai-completions\n' - printf 'COMPATIBLE_API_KEY=%s\n' "${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-ultra\n' + printf 'NEMOCLAW_COMPAT_MODEL=nvidia/nvidia/nemotron-3-ultra\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 value." >&2 + exit 1 + ;; + esac - name: Run E2E script uses: ./workflow-actions/.github/actions/run-e2e-script @@ -248,7 +273,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 4c4052f2569..2930cf7b9f8 100644 --- a/.github/workflows/nightly-e2e.yaml +++ b/.github/workflows/nightly-e2e.yaml @@ -376,6 +376,7 @@ jobs: /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"}' nvidia_api_key: true + inference_route: nvidia-internal github_token: true messaging_live_secrets: ${{ github.event_name != 'workflow_dispatch' || inputs.target_ref == '' }} secrets: @@ -764,8 +765,13 @@ jobs: /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"}' nvidia_api_key: true + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-default-secrets + 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 || '' }} # ── 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,8 +793,9 @@ jobs: /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"}' nvidia_api_key: true + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-internal-inference-secrets channels-stop-start-hermes-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -806,8 +813,9 @@ jobs: /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"}' nvidia_api_key: true + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-internal-inference-secrets brave-search-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -1196,8 +1204,9 @@ jobs: 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"}' nvidia_api_key: true + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-internal-inference-secrets hermes-slack-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -1694,8 +1703,9 @@ jobs: /tmp/nemoclaw-e2e-upgrade-install.log 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-internal github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-internal-inference-secrets openshell-gateway-upgrade-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && @@ -1752,8 +1762,9 @@ jobs: 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"}' nvidia_api_key: true + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-internal-inference-secrets rebuild-hermes-stale-base-e2e: if: >- github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || @@ -1768,8 +1779,9 @@ jobs: 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"}' nvidia_api_key: true + inference_route: nvidia-internal github_token: true - secrets: *nightly-e2e-default-secrets + secrets: *nightly-e2e-internal-inference-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 c83f6228c38..9fcfb863590 100644 --- a/test/e2e-script-workflow.test.ts +++ b/test/e2e-script-workflow.test.ts @@ -137,6 +137,67 @@ function envReferencesHostedInferenceSecret(env?: Record): boole ); } +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, +): InferenceExportResult { + const tempDir = mkdtempSync(path.join(tmpdir(), "nemoclaw-e2e-inference-export-")); + const githubEnv = path.join(tempDir, "github-env"); + writeFileSync(githubEnv, "", "utf8"); + try { + 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); + 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. @@ -919,36 +980,147 @@ 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 internal NVIDIA 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 internalInferenceJobs = 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", + ]); expect(workflowCall?.inputs?.nvidia_api_key).toMatchObject({ required: false, 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 as { secrets?: Record } | undefined)?.secrets + ?.NVIDIA_API_KEY, + ).toBeUndefined(); 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?.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-ultra"); - expect(exportStep?.run).toContain("NEMOCLAW_COMPAT_MODEL=nvidia/nvidia/nemotron-3-ultra"); - expect(exportStep?.run).toContain("NEMOCLAW_PREFERRED_API=openai-completions"); - expect(exportStep?.run).toContain("COMPATIBLE_API_KEY=%s"); + 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).toBeUndefined(); + expect(exportStep?.run).toContain('case "${NEMOCLAW_E2E_INFERENCE_ROUTE:-hosted-custom}" in'); + 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 ?? ""; + 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-ultra", + NEMOCLAW_COMPAT_MODEL: "nvidia/nvidia/nemotron-3-ultra", + NEMOCLAW_PREFERRED_API: "openai-completions", + COMPATIBLE_API_KEY: "hosted-compatible-key", + }); + expect(hostedEnv.NVIDIA_API_KEY).toBeUndefined(); + + const hostedEnvWithPublicSecret = runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "hosted-custom", + HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", + NVIDIA_API_KEY: "nvapi-public-build-key", + }); + expect(hostedEnvWithPublicSecret).toMatchObject(hostedEnv); + expect(hostedEnvWithPublicSecret.NVIDIA_API_KEY).toBeUndefined(); + + const internalInferenceEnv = runInferenceExportStep(script, { + NEMOCLAW_E2E_INFERENCE_ROUTE: "nvidia-internal", + HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", + }); + 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/nvidia/nemotron-3-ultra", + NEMOCLAW_COMPAT_MODEL: "nvidia/nvidia/nemotron-3-ultra", + NEMOCLAW_PREFERRED_API: "openai-completions", + COMPATIBLE_API_KEY: "hosted-compatible-key", + }); + 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", + 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", + HOSTED_NVIDIA_INFERENCE_API_KEY: "hosted-compatible-key", + }), + ).toThrow(); expect(hostedJobs.length).toBeGreaterThan(20); - for (const [name, job] of hostedJobs) { + 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-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]) => !internalInferenceJobs.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(); }); it("keeps rebuild fixture registry inference aligned with hosted custom inference", () => {