Skip to content

fix(ci): prefer completions for hosted inference#5395

Merged
cv merged 3 commits into
mainfrom
codex/fix-hosted-ci-completions
Jun 13, 2026
Merged

fix(ci): prefer completions for hosted inference#5395
cv merged 3 commits into
mainfrom
codex/fix-hosted-ci-completions

Conversation

@cv

@cv cv commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Default hosted CI compatible-inference setup to openai-completions so installer and onboard E2E lanes avoid the stricter Responses streaming probe against inference-api.nvidia.com. Explicit NEMOCLAW_PREFERRED_API overrides are still preserved.

Changes

  • Set NEMOCLAW_PREFERRED_API=openai-completions in hosted CI workflow env blocks and the reusable E2E export step.
  • Default the hosted inference staging helper and E2E shell helper to Chat Completions unless callers already set NEMOCLAW_PREFERRED_API.
  • Updated provider helper and workflow contract tests to lock in the hosted CI inference API preference.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Chores

    • CI/workflows updated to set a default preferred hosted-inference API to OpenAI completions and propagate it to relevant E2E/nightly jobs and test runs.
    • Test and helper scripts now export that default when configuring CI-compatible inference.
  • New Features

    • E2E dispatch planning now detects jobs blocked by withheld hosted-inference secrets and reports/skips them with clearer reasons.
  • Tests

    • Added/updated tests to validate the new environment configuration and dispatch behavior.

@cv cv self-assigned this Jun 13, 2026
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 86afac18-05f4-449f-9438-2aae1779d69f

📥 Commits

Reviewing files that changed from the base of the PR and between afd45a3 and 4854280.

📒 Files selected for processing (2)
  • test/e2e-advisor-dispatch.test.ts
  • tools/e2e-advisor/dispatch.mts

📝 Walkthrough

Walkthrough

This PR defaults and preserves NEMOCLAW_PREFERRED_API="openai-completions" in hosted-inference staging, updates the test harness and workflow contract tests, propagates the variable into multiple CI workflow job environments and a CI helper script, and extends the e2e-advisor dispatch planner and tests to account for jobs blocked by withheld hosted-inference secrets when dispatching with an empty target_ref.

Changes

NEMOCLAW_PREFERRED_API hosted inference configuration

Layer / File(s) Summary
Core hosted-inference env staging
src/lib/onboard/providers.ts
stageHostedInferenceSourceSecretEnv() now stages NEMOCLAW_PREFERRED_API from the environment or defaults to "openai-completions" when unset.
Unit tests and test harness
src/lib/onboard/providers.test.ts
withProviderEnv adds NEMOCLAW_PREFERRED_API to the test isolation set. New unit test verifies stageHostedInferenceSourceSecretEnv() preserves an explicitly provided value.
Workflow contract assertions
test/e2e-script-workflow.test.ts
Adds checks asserting NEMOCLAW_PREFERRED_API="openai-completions" in credential-migration Vitest, reusable hosted-inference routing, and direct hosted-secret routing tests.
CI workflow environment configuration
.github/workflows/e2e-script.yaml, .github/workflows/e2e-vitest-scenarios.yaml, .github/workflows/nightly-e2e.yaml
Multiple E2E jobs (TUI chat correlation, issue #4434, token rotation, sandbox ops, credential migration, onboard repair/resume/negative-paths, runtime overrides, credential sanitization, telegram injection, launchable-smoke) now export NEMOCLAW_PREFERRED_API: openai-completions in their step/job environments.
CI-compatible inference helper script
test/e2e/lib/ci-compatible-inference.sh
nemoclaw_e2e_configure_compatible_inference now exports NEMOCLAW_PREFERRED_API defaulting to "openai-completions" unless already set.
E2E-advisor test updates
test/e2e-advisor-dispatch.test.ts
Nightly fixture gains cloud-onboard-e2e and launchable-smoke-e2e; tests added to assert dispatch filtering and specialized skip reasons when recommended jobs are blocked by withheld hosted-inference secrets.
e2e-advisor dispatch planner
tools/e2e-advisor/dispatch.mts
Planner parses jobs into {id, targetRefSecretBlocked}, computes targetRefSecretBlockedJobs, excludes them when target_ref is empty, adds DispatchPlan.targetRefSecretBlockedJobs?: string[], and renders blocked-job lines in summaries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5374: Modifies the CI-compatible inference helper usage that the updated test/e2e/lib/ci-compatible-inference.sh interacts with.
  • NVIDIA/NemoClaw#5385: Also modifies src/lib/onboard/providers.ts hosted-inference staging logic; closely related code paths.

Suggested labels

area: ci, area: e2e

Suggested reviewers

  • prekshivyas

Poem

🐇 A rabbit hops through CI at night,
Setting preferences tidy and right,
"openai-completions" whispers the breeze,
Across workflows, scripts, and tests with ease,
Hooray — the staged API sleeps sound and bright!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(ci): prefer completions for hosted inference' directly and clearly describes the main change: setting a preference for completions API in hosted CI inference setup.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-hosted-ci-completions

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-code-quality

github-code-quality Bot commented Jun 13, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the branch is 96%. Coverage data for the branch is not yet available.

Show a code coverage summary of the most covered files.
File 7ec4e87 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the branch is 44%. Coverage data for the branch is not yet available.

Show a code coverage summary of the most covered files.
File 7ec4e87 +/-
src/lib/state/o...oard-session.ts 90%
src/lib/inference/local.ts 77%
src/lib/sandbox/config.ts 72%
src/lib/inference/nim.ts 72%
src/lib/onboard/preflight.ts 64%
src/lib/state/sandbox.ts 55%
src/lib/onboard...er-gpu-patch.ts 50%
src/lib/actions...licy-channel.ts 49%
src/lib/policy/index.ts 48%
src/lib/onboard.ts 17%

Updated June 13, 2026 18:36 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: cloud-inference-e2e, credential-migration-e2e
Optional E2E: cloud-onboard-e2e, launchable-smoke-e2e, credential-migration-vitest

Dispatch hint: cloud-inference-e2e,credential-migration-e2e

Auto-dispatched E2E: cloud-inference-e2e, credential-migration-e2e via nightly-e2e.yaml at 7ec4e876484beaa661a6c42ce67af7f82e8bc200nightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • cloud-inference-e2e (high): Most direct live coverage for the hosted compatible inference route changed here: installs/onboards a sandbox, configures hosted inference through the reusable e2e-script workflow, and verifies inference.local chat completions end-to-end.
  • credential-migration-e2e (high): Covers the credential/onboard path affected by provider staging and validates a direct nightly job environment using the hosted custom endpoint and COMPATIBLE_API_KEY migration into the OpenShell gateway.

Optional E2E

  • cloud-onboard-e2e (high): Useful broader confidence for public installer/onboard behavior and the reusable hosted-inference environment, including sandbox health and security checks.
  • launchable-smoke-e2e (high): Useful representative direct-workflow smoke test for hosted inference env wiring in the launchable install path, but less focused than cloud-inference and credential-migration for this PR.
  • credential-migration-vitest (high): Optional if validating the separate vitest-scenarios workflow wiring is desired; it runs the same live credential migration scenario whose hosted-inference environment was edited.

New E2E recommendations

  • None.

Dispatch hint

  • Workflow: nightly-e2e.yaml
  • jobs input: cloud-inference-e2e,credential-migration-e2e

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: credential-migration-vitest, ubuntu-repo-cloud-openclaw
Optional Vitest E2E scenarios: None

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=credential-migration-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • credential-migration-vitest: The PR changes the discrete free-standing Vitest credential migration job in e2e-vitest-scenarios.yaml by adding NEMOCLAW_PREFERRED_API to the live hosted-inference environment for test/e2e-scenario/live/credential-migration.test.ts, so dispatch that job directly.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=credential-migration-vitest
  • ubuntu-repo-cloud-openclaw: The provider staging code now defaults hosted inference to NEMOCLAW_PREFERRED_API=openai-completions. The live-supported ubuntu repo cloud OpenClaw scenario is the smallest registry-backed Vitest scenario that exercises non-interactive cloud OpenClaw onboarding through the hosted NVIDIA_INFERENCE_API_KEY path.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • .github/workflows/e2e-vitest-scenarios.yaml
  • src/lib/onboard/providers.ts

@github-actions

This comment was marked as outdated.

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 0 worth checking, 0 nice ideas
Since last review: 0 prior items resolved, 0 still apply, 0 new items found

Consider writing more tests for
  • **Runtime validation** — Run one hosted CI inference lane with `NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1` and confirm the live probe posts to `/v1/chat/completions` rather than `/v1/responses`.. Unit and workflow contract coverage is good for env propagation, override preservation, and dispatch filtering, but the changed behavior still crosses live hosted inference, installer/onboard, and sandbox E2E paths that static tests cannot fully prove.
  • **Runtime validation** — Add shell-helper coverage that sources `test/e2e/lib/ci-compatible-inference.sh` with `NVIDIA_INFERENCE_API_KEY=repo-hosted-key`, `NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1`, and `NEMOCLAW_PREFERRED_API=openai-responses`, then asserts `nemoclaw_e2e_configure_compatible_inference` preserves `openai-responses`.. Unit and workflow contract coverage is good for env propagation, override preservation, and dispatch filtering, but the changed behavior still crosses live hosted inference, installer/onboard, and sandbox E2E paths that static tests cannot fully prove.
  • **Runtime validation** — Add advisor-dispatch contract coverage using the real `.github/workflows/nightly-e2e.yaml`, recommending a current reusable `nvidia_api_key: true` job such as `cloud-e2e`, and assert it lands in `targetRefSecretBlockedJobs` for PR target-ref dispatch.. Unit and workflow contract coverage is good for env propagation, override preservation, and dispatch filtering, but the changed behavior still crosses live hosted inference, installer/onboard, and sandbox E2E paths that static tests cannot fully prove.

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ❌ Some jobs failed

Run: 27475345243
Target ref: 485428015ed1e8c335ef99e4132a38e0bfd391a4
Workflow ref: main
Requested jobs: cloud-onboard-e2e
Summary: 0 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard-e2e ❌ failure

Failed jobs: cloud-onboard-e2e. Check run artifacts for logs.

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ❌ Some jobs failed

Run: 27475525245
Target ref: 7ec4e876484beaa661a6c42ce67af7f82e8bc200
Workflow ref: main
Requested jobs: cloud-inference-e2e,credential-migration-e2e
Summary: 1 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
cloud-inference-e2e ❌ failure
credential-migration-e2e ✅ success

Failed jobs: cloud-inference-e2e. Check run artifacts for logs.

@cv cv merged commit eb81160 into main Jun 13, 2026
41 checks passed
@cv cv deleted the codex/fix-hosted-ci-completions branch June 13, 2026 18:39
@cv cv added the v0.0.65 Release target label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.65 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant