Skip to content

feat(onboard): add GitHub Copilot provider (Refs #5799) - #6671

Closed
deepujain wants to merge 3 commits into
NVIDIA:mainfrom
deepujain:fix/5799-copilot-provider
Closed

feat(onboard): add GitHub Copilot provider (Refs #5799)#6671
deepujain wants to merge 3 commits into
NVIDIA:mainfrom
deepujain:fix/5799-copilot-provider

Conversation

@deepujain

@deepujain deepujain commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Refs #5799.

Current status: blocked on the OpenShell inference-provider contract. OpenShell v0.0.72 and current main do not accept Copilot as a cluster inference provider yet, so this branch should not merge as-is.

Adds GitHub Copilot provider wiring in onboarding, including aliases, model choices, docs, and token alias staging into COPILOT_GITHUB_TOKEN. The managed inference route is not merge-ready until OpenShell supports Copilot as an inference provider or NemoClaw uses a reviewed direct route.

Changes

  • Added the copilot provider key, github / github-copilot aliases, curated Copilot model choices, and provider-selection config.
  • Kept the existing provider menu order stable by appending Copilot after the established choices.
  • Documented Copilot in the inference provider guide and command reference.
  • Added regression coverage for provider registration args, credential alias staging, menu order, recovery mapping, and sandbox inference config.

Testing

  • npm run build:cli passed
  • npm run typecheck:cli passed
  • npm run source-shape:check passed
  • npm run lint passed, with the existing unrelated src/lib/onboard/child-exit-tracker.test.ts unused suppression warning
  • npm run --silent test -- test/onboard-provider-key-bridge.test.ts src/lib/onboard/provider-menu.test.ts src/lib/onboard/providers.test.ts src/lib/inference/config.test.ts test/onboard-resume-provider-recovery.test.ts passed
  • npm run --silent test -- src/lib/actions/inference-set-provider-alias.test.ts src/lib/actions/inference-set-compatible-provider.test.ts src/lib/actions/inference-set-local-provider.test.ts passed
  • npm run --silent test -- src/lib/registry-recovery-action.test.ts src/lib/actions/sandbox/policy-channel-conflict.test.ts src/lib/shields/index.test.ts src/lib/shields/timer.test.ts passed
  • npm test was attempted, but this local machine still fails unrelated broad-suite tests around missing Python yaml plus several long-running sandbox/base-image fixtures timing out. The Copilot/provider and affected onboard paths above are green.

Evidence it works

  • NEMOCLAW_PROVIDER=copilot is accepted and resolves to the github-copilot OpenShell provider name.
  • Provider registration and unit tests cover the intended Copilot mapping, but real onboarding remains blocked until OpenShell supports Copilot inference routing or NemoClaw uses a reviewed direct route.
  • GH_TOKEN and GITHUB_TOKEN are staged into COPILOT_GITHUB_TOKEN when the canonical env is not already set.
  • Existing Ollama/NIM/vLLM numeric menu choices remain stable after adding Copilot.

Signed-off-by: Deepak Jain deepujain@gmail.com

@copy-pr-bot

copy-pr-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

GitHub Copilot is added as a first-class inference provider with aliases, credential staging, onboarding menu support, managed inference routing, model metadata, tests, installer help, and documentation.

Changes

GitHub Copilot provider

Layer / File(s) Summary
Provider registration and credential staging
src/lib/onboard/providers.ts, src/lib/onboard/providers.test.ts
Registers Copilot aliases, metadata, endpoint, credential environment variables, token staging, exports, and profile tests.
Onboarding menu and selection flow
src/lib/onboard/provider-menu.ts, src/lib/onboard/provider-menu.test.ts, src/lib/onboard/provider-key-bridge.ts, test/onboard-*.test.ts, install.sh, scripts/install.sh
Adds Copilot to provider menus, stages GitHub token aliases before validation, updates recovery mapping and installer help, and tests the onboarding flow.
Inference configuration and model support
src/lib/inference/config.ts, src/lib/inference/config.test.ts, src/lib/inference/model-prompts.ts
Maps github-copilot to managed inference settings, defaults it to gpt-5.4, adds claude-sonnet-4-6, and verifies compatibility metadata.
Provider selection documentation
docs/inference/choose-inference-provider.mdx, docs/reference/commands.mdx
Documents Copilot support, hosted configuration, onboarding choices, aliases, and accepted token environment variables.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant buildInferenceProviderMenu
  participant stageRemoteProviderKeyBridge
  participant stageCopilotCredentialEnv
  User->>buildInferenceProviderMenu: select copilot
  buildInferenceProviderMenu->>stageRemoteProviderKeyBridge: pass Copilot credential environment
  stageRemoteProviderKeyBridge->>stageCopilotCredentialEnv: stage GH_TOKEN or GITHUB_TOKEN
  stageCopilotCredentialEnv-->>stageRemoteProviderKeyBridge: set COPILOT_GITHUB_TOKEN
Loading

Possibly related PRs

  • NVIDIA/NemoClaw#1794: Both changes update installer help text listing valid NEMOCLAW_PROVIDER values.

Suggested labels: area: providers, area: docs, area: cli

Suggested reviewers: jyaunches, prekshivyas, cjagwani, cv

🚥 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
Linked Issues check ✅ Passed The changes add Copilot selection, onboarding, auth aliasing, non-interactive support, docs, and tests, matching #5799's objectives.
Out of Scope Changes check ✅ Passed The diff stays focused on Copilot provider support and related docs/tests, with no clear unrelated feature additions.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding GitHub Copilot as an onboarding provider.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: cloud-onboard, inference-routing, network-policy, onboard-resume, onboard-repair
Optional E2E: None

Dispatch hint: cloud-onboard,inference-routing,network-policy,onboard-resume,onboard-repair

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: target/main
Head: HEAD
Confidence: high

Required E2E

  • cloud-onboard: Required validation floor for installer changes and a clean hosted onboarding flow.
  • inference-routing: Required validation floor for managed inference.local routing and provider configuration changes.
  • network-policy: Required validation floor for inference reachability and allow/deny behavior at the host-to-sandbox boundary.
  • onboard-resume: Required validation floor for provider recovery and persisted onboarding state convergence.
  • onboard-repair: Required validation floor for repair behavior after onboarding failures involving provider registration and credentials.

Optional E2E

  • None.

New E2E recommendations

  • GitHub Copilot hosted onboarding (high): No existing listed live job is provider-specific for the new OpenShell copilot profile. Unit tests cover alias precedence and configuration, but do not prove a GitHub token alias stages into COPILOT_GITHUB_TOKEN, OpenShell accepts the copilot profile, and a sandbox can complete a real routed inference request.
    • Suggested test: Add a trusted-secret live onboarding E2E lane for NEMOCLAW_PROVIDER=copilot that exercises COPILOT_GITHUB_TOKEN and GH_TOKEN/GITHUB_TOKEN alias staging, provider registration, sandbox creation, and a routed assistant inference request.

Dispatch hint

  • Workflow: .github/workflows/e2e.yaml
  • jobs input: cloud-onboard,inference-routing,network-policy,onboard-resume,onboard-repair

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

E2E Target Recommendation

Required E2E targets: cloud-onboard, inference-routing, network-policy, onboard-repair, onboard-resume
Optional E2E targets: None

Dispatch required E2E targets:

  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=cloud-onboard
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=inference-routing
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=network-policy
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-repair
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-resume

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: target/main
Head: HEAD
Confidence: high

Required E2E targets

  • cloud-onboard: Installer and platform changes must work on a clean supported host with the pinned runtime dependencies.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=cloud-onboard
  • inference-routing: Inference selection, reachability, and network policy must agree at the real host-to-sandbox boundary.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=inference-routing
  • network-policy: Inference selection, reachability, and network policy must agree at the real host-to-sandbox boundary.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=network-policy
  • onboard-repair: Onboarding and sandbox state must converge across persisted metadata, reported status, and the live runtime.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-repair
  • onboard-resume: Onboarding and sandbox state must converge across persisted metadata, reported status, and the live runtime.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-resume

Optional E2E targets

  • None.

Relevant changed files

  • install.sh
  • scripts/install.sh
  • src/lib/inference/config.ts
  • src/lib/inference/model-prompts.ts
  • src/lib/onboard/provider-key-bridge.ts
  • src/lib/onboard/provider-menu.ts
  • src/lib/onboard/providers.ts

@deepujain
deepujain force-pushed the fix/5799-copilot-provider branch 2 times, most recently from 131f743 to dbf2650 Compare July 11, 2026 04:51

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/lib/onboard/providers.test.ts (1)

191-204: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add coverage for the GITHUB_TOKEN fallback and GH_TOKEN-precedence case.

Only the GH_TOKEN-present and explicit-token cases are tested. COPILOT_CREDENTIAL_SOURCE_ENVS order (GH_TOKEN before GITHUB_TOKEN) implies a precedence contract that isn't exercised — e.g. staging when only GITHUB_TOKEN is set, and staging when both GH_TOKEN and GITHUB_TOKEN are set (to prove GH_TOKEN wins).

✅ Suggested additional cases
     withProviderEnv({ COPILOT_GITHUB_TOKEN: "explicit-token", GH_TOKEN: "ignored-token" }, () => {
       expect(stageCopilotCredentialEnv()).toBe(false);
       expect(process.env.COPILOT_GITHUB_TOKEN).toBe("explicit-token");
     });
+
+    withProviderEnv({ GITHUB_TOKEN: "fallback-token" }, () => {
+      expect(stageCopilotCredentialEnv()).toBe(true);
+      expect(process.env.COPILOT_GITHUB_TOKEN).toBe("fallback-token");
+    });
+
+    withProviderEnv({ GH_TOKEN: "gh-token", GITHUB_TOKEN: "github-token" }, () => {
+      expect(stageCopilotCredentialEnv()).toBe(true);
+      expect(process.env.COPILOT_GITHUB_TOKEN).toBe("gh-token");
+    });
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/onboard/providers.test.ts` around lines 191 - 204, Add test coverage
in the “stages GitHub token aliases into the Copilot credential env” test for
staging from only GITHUB_TOKEN and for both GH_TOKEN and GITHUB_TOKEN being set,
asserting staging succeeds and GH_TOKEN is selected according to
COPILOT_CREDENTIAL_SOURCE_ENVS order.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lib/onboard/providers.test.ts`:
- Around line 191-204: Add test coverage in the “stages GitHub token aliases
into the Copilot credential env” test for staging from only GITHUB_TOKEN and for
both GH_TOKEN and GITHUB_TOKEN being set, asserting staging succeeds and
GH_TOKEN is selected according to COPILOT_CREDENTIAL_SOURCE_ENVS order.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0bc29014-64b9-4495-b170-3b21f14e0d23

📥 Commits

Reviewing files that changed from the base of the PR and between e4d2e91 and 9d97355.

📒 Files selected for processing (12)
  • docs/inference/choose-inference-provider.mdx
  • docs/reference/commands.mdx
  • src/lib/inference/config.test.ts
  • src/lib/inference/config.ts
  • src/lib/inference/model-prompts.ts
  • src/lib/onboard.ts
  • src/lib/onboard/provider-menu.test.ts
  • src/lib/onboard/provider-menu.ts
  • src/lib/onboard/providers.test.ts
  • src/lib/onboard/providers.ts
  • test/onboard-resume-provider-recovery.test.ts
  • test/onboard-selection.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/onboard-provider-key-bridge.test.ts (1)

202-217: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a regression for legacy-key precedence.

This case only supplies GH_TOKEN, so it cannot detect whether the legacy provider-key path still runs after Copilot staging. Add a public-boundary scenario with both GH_TOKEN and NEMOCLAW_PROVIDER_KEY, then assert the documented credential precedence.

As per path instructions, test behavioral outcomes rather than only the happy-path implementation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/onboard-provider-key-bridge.test.ts` around lines 202 - 217, The
existing Copilot staging test does not cover precedence when both credential
sources are present. Update the scenario in runSetupNimBridgeScenario to provide
both GH_TOKEN and NEMOCLAW_PROVIDER_KEY, then assert the documented outcome and
credentialEnv/value showing which credential wins; keep assertions focused on
the public behavioral result rather than internal staging.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/onboard-provider-key-bridge.test.ts`:
- Around line 18-21: Update the spawned-scenario environment setup and its
tracked key list to include NEMOCLAW_PROVIDER_KEY, ensuring it is removed by
default from inherited environments and passed explicitly only by scenarios that
require it; verify the credential assertions remain deterministic through the
public bridge boundary.

---

Nitpick comments:
In `@test/onboard-provider-key-bridge.test.ts`:
- Around line 202-217: The existing Copilot staging test does not cover
precedence when both credential sources are present. Update the scenario in
runSetupNimBridgeScenario to provide both GH_TOKEN and NEMOCLAW_PROVIDER_KEY,
then assert the documented outcome and credentialEnv/value showing which
credential wins; keep assertions focused on the public behavioral result rather
than internal staging.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d4027232-c659-4748-ab9d-7489f9ae412b

📥 Commits

Reviewing files that changed from the base of the PR and between 9d97355 and dbf2650.

📒 Files selected for processing (12)
  • docs/inference/choose-inference-provider.mdx
  • docs/reference/commands.mdx
  • src/lib/inference/config.test.ts
  • src/lib/inference/config.ts
  • src/lib/inference/model-prompts.ts
  • src/lib/onboard/provider-key-bridge.ts
  • src/lib/onboard/provider-menu.test.ts
  • src/lib/onboard/provider-menu.ts
  • src/lib/onboard/providers.test.ts
  • src/lib/onboard/providers.ts
  • test/onboard-provider-key-bridge.test.ts
  • test/onboard-resume-provider-recovery.test.ts
✅ Files skipped from review due to trivial changes (3)
  • docs/inference/choose-inference-provider.mdx
  • test/onboard-resume-provider-recovery.test.ts
  • docs/reference/commands.mdx
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/lib/inference/model-prompts.ts
  • src/lib/onboard/provider-menu.ts
  • src/lib/inference/config.test.ts
  • src/lib/inference/config.ts
  • src/lib/onboard/providers.ts
  • src/lib/onboard/provider-menu.test.ts
  • src/lib/onboard/providers.test.ts

Comment thread test/onboard-provider-key-bridge.test.ts
@prekshivyas prekshivyas self-assigned this Jul 12, 2026
Fixes NVIDIA#5799

Signed-off-by: Deepak Jain <deepujain@gmail.com>
Signed-off-by: Deepak Jain <deepujain@gmail.com>
Signed-off-by: Deepak Jain <deepujain@gmail.com>
@deepujain
deepujain force-pushed the fix/5799-copilot-provider branch from 861b9c8 to 6ba6807 Compare July 12, 2026 16:39
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased on current main and kept the Copilot provider changes intact. Focused onboard/inference tests, source-shape, and lint/checks pass; refreshed PR checks are green.

@prekshivyas

Copy link
Copy Markdown
Collaborator

Blocking runtime issue before merge: NemoClaw always reaches openshell inference set --provider github-copilot for this remote-provider path, but pinned OpenShell v0.0.72 does not recognize provider type copilot as an inference provider; it is an agent credential/policy profile. Current OpenShell main still limits inference routing to openai, anthropic, nvidia, deepinfra, google-vertex-ai, and aws-bedrock. The command therefore fails even with --no-verify, so the current unit tests can be green while real onboarding is broken.

Primary evidence: OpenShell v0.0.72 inference type normalization and the current server rejection path.

This needs either upstream OpenShell inference support for Copilot, or a separately reviewed direct OpenClaw github-copilot route with the token-exchange network/credential boundary and a provider-specific live E2E. The existing installer assertions also need copilot added, but fixing those alone would hide this runtime blocker.

@cv cv added v0.0.82 and removed v0.0.82 labels Jul 12, 2026
@wscurran wscurran added area: docs Documentation, examples, guides, or docs build area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: providers Inference provider integrations and provider behavior feature PR adds or expands user-visible functionality needs: review PR is conflict-free and awaiting maintainer review labels Jul 12, 2026
@deepujain

Copy link
Copy Markdown
Contributor Author

Verified the OpenShell contract and this should stay blocked for now. The installer failure is only the provider-list assertion seeing copilot, but fixing that would make CI greener while real onboarding still hits an unsupported inference-provider path. I updated the PR body/title to use Refs instead of Fixes and removed the stale generated summary so the status is clearer.

@deepujain deepujain changed the title feat(onboard): add GitHub Copilot provider (Fixes #5799) feat(onboard): add GitHub Copilot provider (Refs #5799) Jul 13, 2026
@prekshivyas

Copy link
Copy Markdown
Collaborator

Closing this PR because the current implementation depends on a capability OpenShell does not provide. OpenShell's copilot profile is a standalone Copilot CLI credential/policy provider, not a cluster inference provider. NemoClaw onboarding reaches openshell inference set --provider github-copilot, but OpenShell v0.0.72 and current main reject provider type copilot for inference.local routing. Green unit tests or installer assertions cannot make real onboarding succeed.

This is not a rejection of #5799; that feature request should remain open. Copilot onboarding can return once there is an implemented architecture: either OpenShell supports Copilot cluster inference with the required authentication and routing contract, or NemoClaw adopts a reviewed direct OpenClaw Copilot route with explicit credential and network boundaries plus provider-specific live E2E coverage. A new PR, or this PR reopened if still applicable, can then target the actual supported contract.

The closure is based on the runtime architecture blocker, not CI status.

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

Labels

area: docs Documentation, examples, guides, or docs build area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: providers Inference provider integrations and provider behavior feature PR adds or expands user-visible functionality needs: review PR is conflict-free and awaiting maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants