Skip to content

fix: address issue #5249 - #5252

Merged
cv merged 14 commits into
mainfrom
auto/fix-5249-all-platforms-cli-ux-nemohermes-name
Jun 24, 2026
Merged

fix: address issue #5249#5252
cv merged 14 commits into
mainfrom
auto/fix-5249-all-platforms-cli-ux-nemohermes-name

Conversation

@jason-ma-nv

@jason-ma-nv jason-ma-nv commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

For Hermes sandboxes, 'nemoclaw/nemohermes gateway-token' previously dead-ended on the OpenClaw-only 'not applicable' diagnostic, leaving Hermes users who followed generic dashboard-token quickstart patterns without a next step during Day0 verification. Added a notApplicableLines() helper in src/lib/gateway-token-command.ts that, for the 'hermes' agent, appends two Hermes-specific lines directing users to the supported dashboard auth path: 'For Hermes dashboard access, run: nemoclaw dashboard-url' and a note that Hermes dashboard auth is read from the in-sandbox config (~/.hermes/config.yaml), not a gateway token. Non-Hermes, non-OpenClaw agents retain the single explanatory line. The command still exits cleanly (exit 1, diagnostics on stderr via GatewayTokenCommandError.lines rendered by the token.ts caller's failWithLines).

Related Issue

Fixes #5249

Changes

  • Automated Claude Code fix selected by auto_fix/auto_fix_recent_issues.py.
  • See the commits on this branch for the exact file-level changes.

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
  • make 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)

Verification details reported by Claude Code:

  • Ran focused unit tests: npx vitest run src/lib/gateway-token-command.test.ts -> 14 passed (includes new assertions for /dashboard-url/ and /.hermes/config.yaml/ in the Hermes path, plus a new test asserting non-Hermes non-OpenClaw agents keep a single line)
  • Type-checked the CLI: npx tsc --noEmit -p tsconfig.cli.json -> clean (no errors)
  • Linted changed files: npx biome check src/lib/gateway-token-command.ts src/lib/gateway-token-command.test.ts -> no issues
  • Confirmed the ~/.hermes/config.yaml path matches the canonical form used across the codebase (agents/hermes/config/write-config.ts, messaging manifests) which resolves to /sandbox/.hermes/config.yaml inside the sandbox
  • Confirmed caller src/commands/sandbox/gateway/token.ts renders all error.lines via failWithLines, so the multi-line Hermes hint is surfaced to users
  • git diff src/lib/gateway-token-command.ts
  • git diff src/lib/gateway-token-command.test.ts
  • grep -rni 'hermes/config' (verify config path)
  • npx vitest run src/lib/gateway-token-command.test.ts
  • npx tsc --noEmit -p tsconfig.cli.json
  • npx biome check src/lib/gateway-token-command.ts src/lib/gateway-token-command.test.ts
  • git add src/lib/gateway-token-command.ts src/lib/gateway-token-command.test.ts && git commit

Signed-off-by: Jason Ma jama@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved “gateway-token” diagnostics when the command is not applicable: Hermes now shows a detailed, multi-line message (including the dashboard URL and ~/.hermes/config.yaml path), while other non-applicable agents show a single concise line.
  • Documentation

    • Updated Hermes browser-auth guidance to use nemohermes <name> dashboard-url and authenticate from ~/.hermes/config.yaml instead of using a gateway token.
  • Tests

    • Strengthened assertions to verify the exact diagnostic line contents and correct inclusion/exclusion of the Hermes URL.

For Hermes sandboxes, 'nemoclaw <name> gateway-token' dead-ended on the
OpenClaw-only 'not applicable' line, leaving users following generic
dashboard-token quickstart patterns without a next step during Day0
verification.

Surface a Hermes-specific hint that points at the supported dashboard
auth path (dashboard-url) and notes that Hermes dashboard auth is read
from the in-sandbox config (~/.hermes/config.yaml), not a gateway token.
Other non-OpenClaw agents keep the single explanatory line.

Closes #5249

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jason-ma-nv jason-ma-nv self-assigned this Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 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

Adds an agent-aware "not applicable" diagnostics helper used by the gateway-token command to emit Hermes-specific multi-line guidance (including dashboard URL and .hermes/config.yaml) while keeping single-line messages for other unsupported agents; tests and docs updated accordingly.

Changes

Gateway-token agent-aware error messaging

Layer / File(s) Summary
Agent-aware diagnostic helper
src/lib/gateway-token-command.ts
notApplicableLines helper generates agent-specific "not applicable" diagnostics; Hermes receives multi-line guidance with dashboard URL and .hermes/config.yaml, other non-OpenClaw agents receive a single-line message.
Command integration
src/lib/gateway-token-command.ts
runGatewayTokenCommand now calls notApplicableLines(sandboxName, resolvedAgent) for non-OpenClaw agents, replacing the previous hardcoded single-line failure message.
Hermes and non-Hermes validation
src/lib/gateway-token-command.test.ts
Tests assert Hermes case returns agent-aware lines (contains "hermes", "OpenClaw", "not applicable", dashboard URL, .hermes/config.yaml; excludes OpenClaw-only guidance and stack traces) and non-Hermes case returns exactly one "not applicable" line without a dashboard URL.
Docs clarifications
docs/reference/commands-nemohermes.mdx, docs/reference/commands.mdx
Adds Hermes-specific note that browser dashboard access uses nemohermes <name> dashboard-url and that Hermes dashboard auth is read from ~/.hermes/config.yaml (not from a gateway token).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

area: docs

Suggested reviewers

  • cv
  • prekshivyas

Poem

🐰 I hopped through lines to make it right,
Hermes now gets clearer light.
Where tokens failed to show the way,
A dashboard hint will save the day.
🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: address issue #5249' is vague and does not clearly summarize the actual change (adding Hermes-specific diagnostic guidance for gateway-token). Use a more descriptive title like 'fix: improve gateway-token error message for Hermes sandboxes' to clarify the primary change.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully implements the coding requirements from issue #5249: it adds Hermes-specific error diagnostics directing users to dashboard-url and ~/.hermes/config.yaml, updates documentation, and adds comprehensive test coverage.
Out of Scope Changes check ✅ Passed All changes are directly related to addressing issue #5249: the helper function, error message updates, documentation changes, and test additions all focus on improving Hermes gateway-token guidance.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch auto/fix-5249-all-platforms-cli-ux-nemohermes-name

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

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: diagnostics-e2e, hermes-dashboard-e2e
Optional E2E: credential-sanitization-e2e

Dispatch hint: diagnostics-e2e,hermes-dashboard-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: medium

Required E2E

  • diagnostics-e2e: Closest existing installed-CLI/credential diagnostics coverage for a change to a credential-facing command. It exercises the packaged CLI and credential/diagnostic surfaces on a real sandbox, giving confidence that the command bundle and runtime dependencies still work outside unit tests.
  • hermes-dashboard-e2e: The changed Hermes gateway-token diagnostic sends users to dashboard-url and states that dashboard auth comes from /sandbox/.hermes/config.yaml. This job validates the Hermes dashboard-enabled onboard flow, forwarded dashboard reachability, and Hermes config path in a real sandbox.

Optional E2E

  • credential-sanitization-e2e: Optional adjacent credential-safety confidence because this PR touches a command that handles gateway auth tokens. This job focuses on credential redaction/sanitization rather than the gateway-token command itself.

New E2E recommendations

  • gateway-token command / multi-agent credential UX (high): No existing E2E appears to directly exercise nemoclaw <name> gateway-token or nemohermes <name> gateway-token. Add a focused E2E that creates or registers OpenClaw and Hermes sandboxes, asserts OpenClaw prints the token with the expected warning/quiet behavior, asserts Hermes exits non-zero with the multi-line alias-aware diagnostic and no oclif stack trace, and verifies dashboard-url remains the supported Hermes alternative.
    • Suggested test: gateway-token-agent-diagnostic-e2e

Dispatch hint

  • Workflow: nightly-e2e.yaml
  • jobs input: diagnostics-e2e,hermes-dashboard-e2e

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: None
Optional Vitest E2E scenarios: None

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • None. No dispatchable Vitest E2E scenario currently exercises the changed Hermes gateway-token diagnostic path. Existing live Vitest Hermes/dashboard jobs cover onboarding/status/dashboard behavior, and OpenClaw token-related jobs cover other token boundaries, but none invokes gateway-token for a Hermes sandbox; the changed surface is covered by unit tests in this PR rather than by a targeted Vitest E2E scenario.

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • src/lib/gateway-token-command.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

🤖 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 `@src/lib/gateway-token-command.ts`:
- Around line 57-76: The notApplicableLines function builds the Hermes
diagnostic message with an incorrect config path; update the third returned
string for agent === "hermes" to reference the in-sandbox Hermes config at
"/sandbox/.hermes/config.yaml" instead of "~/.hermes/config.yaml" so the message
accurately reflects the sandbox path (adjust the string literal returned by
notApplicableLines).
🪄 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: 79a2ee34-7922-469b-b747-89aa6c5f039d

📥 Commits

Reviewing files that changed from the base of the PR and between 3ac71fd and 314334b.

📒 Files selected for processing (2)
  • src/lib/gateway-token-command.test.ts
  • src/lib/gateway-token-command.ts

Comment thread src/lib/gateway-token-command.ts
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 8 test follow-ups
Since last review: 0 prior items resolved · 0 still apply · 0 new items found

Action checklist

  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
  • PRA-T3 Add or justify test follow-up: Runtime validation
  • PRA-T4 Add or justify test follow-up: Runtime validation
  • PRA-T5 Add or justify test follow-up: Acceptance clause
  • PRA-T6 Add or justify test follow-up: Acceptance clause
  • PRA-T7 Add or justify test follow-up: Acceptance clause
  • PRA-T8 Add or justify test follow-up: Acceptance clause
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — With a temporary sandbox registry entry containing `agent: hermes`, invoke the `nemohermes` CLI path for `hermes gateway-token --quiet` and assert exit code 1, empty stdout, stderr containing `nemohermes hermes dashboard-url`, and stderr containing `/sandbox/.hermes/config.yaml`.. The changed helper and oclif wrapper have strong unit coverage, including negative paths and alias-specific branding. A small runtime-level CLI validation would further prove the launcher env, registry lookup, stdout/stderr split, exit code, and exact user-visible text compose without mocks.
  • PRA-T2 Runtime validation — With the same temporary Hermes registry entry invoked through the default binary, run `nemoclaw hermes gateway-token --quiet` and assert exit code 1, empty stdout, stderr containing `nemoclaw hermes dashboard-url`, and stderr not containing `nemohermes hermes dashboard-url`.. The changed helper and oclif wrapper have strong unit coverage, including negative paths and alias-specific branding. A small runtime-level CLI validation would further prove the launcher env, registry lookup, stdout/stderr split, exit code, and exact user-visible text compose without mocks.
  • PRA-T3 Runtime validation — Add or identify exact production-copy unit coverage that the Hermes diagnostic emits `/sandbox/.hermes/config.yaml` and not the older `~/.hermes/config.yaml` wording; the current helper test's regex and the adapter fixture do not both prove the exact production string.. The changed helper and oclif wrapper have strong unit coverage, including negative paths and alias-specific branding. A small runtime-level CLI validation would further prove the launcher env, registry lookup, stdout/stderr split, exit code, and exact user-visible text compose without mocks.
  • PRA-T4 Runtime validation — If maintainers want full issue-level Day0 confidence, add a broader integration scenario that onboards or seeds a Hermes sandbox, verifies `nemoclaw list` reports `agent: hermes` and the dashboard loopback URL, verifies `nemohermes hermes dashboard-url --quiet` prints only the URL, then verifies `gateway-token --quiet` produces the unsupported-command hint.. The changed helper and oclif wrapper have strong unit coverage, including negative paths and alias-specific branding. A small runtime-level CLI validation would further prove the launcher env, registry lookup, stdout/stderr split, exit code, and exact user-visible text compose without mocks.
  • PRA-T5 Acceptance clause — 1. Ensure NemoClaw is installed and Docker is running. — add test evidence or identify existing coverage. This is reproduction setup, not behavior changed by this PR. The diff does not modify installer or Docker readiness paths, and this read-only review did not execute environment setup.
  • PRA-T6 Acceptance clause — 2. Run Hermes onboarding with the NemoHermes alias: — add test evidence or identify existing coverage. Full onboarding is outside the diff. Changed tests simulate the downstream state that matters for this command: a Hermes agent and the `nemohermes` invocation branding.
  • PRA-T7 Acceptance clause — NEMOCLAW_AGENT=hermes nemohermes onboard --name hermes — add test evidence or identify existing coverage. The PR does not change or run onboarding. `src/lib/gateway-token-command.test.ts` stubs `NEMOCLAW_INVOKED_AS=nemohermes` and `getSandboxAgent: () => "hermes"` to cover the gateway-token behavior after a Hermes sandbox exists.
  • PRA-T8 Acceptance clause — Select a Cloud API provider and the default NVIDIA model (e.g. `nvidia/nemotron-3-super-120b-a12b`) and complete the wizard. — add test evidence or identify existing coverage. Provider/model wizard behavior is outside the changed files; no provider selection or model default code is modified by this PR.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

The gateway-token CLI hint now directs Hermes users to dashboard-url for
dashboard access (#5249). Align the reference docs so the Hermes
gateway-token note mirrors that guidance instead of only pointing at the
OpenAI-compatible API URL.

Signed-off-by: Jason Ma <jama@nvidia.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 12, 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 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

🤖 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 `@docs/reference/commands-nemohermes.mdx`:
- Line 625: Your change was applied to the generated variant
(commands-nemohermes.mdx) instead of the source; revert that edit in the
generated file and instead update the source commands.mdx with the new sentence
using the shared alias pattern ($$nemoclaw) so the phrasing applies across
aliases, then regenerate the variant docs by running npm run
docs:sync-agent-variants to ensure the generated file and CI are in sync.
🪄 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: 5dc253d3-8515-4231-816e-6ab2a39bab9e

📥 Commits

Reviewing files that changed from the base of the PR and between 314334b and 11ec7f5.

📒 Files selected for processing (2)
  • docs/reference/commands-nemohermes.mdx
  • docs/reference/commands.mdx
✅ Files skipped from review due to trivial changes (1)
  • docs/reference/commands.mdx

Comment thread docs/reference/commands-nemohermes.mdx Outdated
@cv cv added v0.0.65 and removed v0.0.64 labels Jun 12, 2026
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior labels Jun 12, 2026
@wscurran

Copy link
Copy Markdown
Contributor

@cv cv added v0.0.66 and removed v0.0.65 labels Jun 15, 2026
@github-code-quality

github-code-quality Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the auto/fix-5249-all-pl... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main auto/fix-5249-all-pl... 42d4a83 +/-
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 auto/fix-5249-all-pl... branch is 46%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main auto/fix-5249-all-pl... 42d4a83 +/-
src/lib/state/o...oard-session.ts 91%
src/lib/inference/local.ts 76%
src/lib/sandbox/config.ts 72%
src/lib/actions...dbox/rebuild.ts 67%
src/lib/onboard/preflight.ts 64%
src/lib/actions...licy-channel.ts 56%
src/lib/state/sandbox.ts 55%
src/lib/policy/index.ts 49%
src/lib/onboard...er-gpu-patch.ts 44%
src/lib/onboard.ts 18%

Updated June 24, 2026 14:25 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@cjagwani cjagwani assigned cjagwani and unassigned jason-ma-nv Jun 22, 2026
The PR's manual edit to docs/reference/commands.mdx:909 used the
canonical `my-assistant` placeholder, but the matching line in the
generated docs/reference/commands-nemohermes.mdx still carried
`<name>` from an earlier draft, so the docs preview job kept
failing the agent-variant sync check.

Run `npm run docs:sync-agent-variants` to re-derive the generated
file from source so the two stay aligned.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

@cjagwani cjagwani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approve, looks good end to end. The hermes branch only fires for the hermes agent, tests cover the three new substrings, and #5249's expected behavior is satisfied. Pushed a small regen to clear the preview CI drift after the source edit.

@cjagwani
cjagwani requested a review from cv June 22, 2026 18:21
cjagwani added 3 commits June 22, 2026 11:35
PR Review Advisor PRA-2 on #5252: the Hermes diagnostic at
notApplicableLines() hardcoded "nemoclaw" in the next-step hint, so a
user who launched through the nemohermes alias still got "nemoclaw
<name> dashboard-url" as the suggestion. The docs change in this PR
already says "nemohermes <name> dashboard-url", and
src/lib/cli/branding.ts already exposes the invoked CLI name via
NEMOCLAW_INVOKED_AS for exactly this reason.

Switch the helper to read getAgentBranding().cli at call time so the
hint matches whatever binary the user actually typed. Resolving at
call time (not module load) keeps the hint in sync with
NEMOCLAW_INVOKED_AS even when the env var is set after import.

Tests pin both alias paths: nemohermes invocation renders the
nemohermes hint, and nemoclaw invocation renders the nemoclaw hint.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
…h oclif wrapper

PR Review Advisor PRA-T3 on #5252 asked for end-to-end coverage of
the multi-line Hermes diagnostic at the oclif wrapper layer. The
existing per-helper test pins the line content and ordering; the
existing wrapper test pins the exit-code contract for a single-line
error. Neither covered the case the advisor flagged: multi-line
error survives intact through GatewayTokenCliCommand.run() with
every line written to console.error and no leaked oclif stack
trace.

Add a focused test that mocks runGatewayTokenCommand to throw the
three-line Hermes diagnostic, spies on console.error, and asserts
each line was written, process.exitCode is 1, and the captured
output never matches an ExitError / @oclif/core / at Object.exit
trace.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
The codebase-growth-guardrails CI check fails on PR test files that
add conditional statements (NemoClaw asserts deterministic tests).
The two new PRA-2 tests added in 47c5317 used a try/finally with
`if (previousInvokedAs === undefined) delete ... else assign ...`
to restore process.env.NEMOCLAW_INVOKED_AS, which tripped the guard
("up from 0 if statements").

Switch to vitest's built-in env stubbing: vi.stubEnv() sets the var
for the test and vi.unstubAllEnvs() restores all stubbed vars in
afterEach. No conditionals, deterministic restoration, and shorter
test bodies.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@cjagwani

Copy link
Copy Markdown
Collaborator

PR Advisor passes: no blocking findings, recommendation merge_as_is.

@cv cv added v0.0.67 and removed v0.0.66 labels Jun 23, 2026
The gateway-token 'not applicable' diagnostic and the commands reference
docs cited ~/.hermes/config.yaml -- the internal manifest target form --
rather than the resolved in-sandbox path /sandbox/.hermes/config.yaml that
users actually see and that the rest of the codebase/docs use. Aligns the
user-facing message and docs with the canonical path (addresses CodeRabbit
review on #5252).

Signed-off-by: Jason Ma <jama@nvidia.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jyaunches jyaunches added v0.0.68 and removed v0.0.67 labels Jun 24, 2026
@cjagwani
cjagwani requested a review from jyaunches June 24, 2026 14:22
@cjagwani

This comment was marked as outdated.

@cv
cv merged commit 1578899 into main Jun 24, 2026
33 checks passed
@cv
cv deleted the auto/fix-5249-all-platforms-cli-ux-nemohermes-name branch June 24, 2026 15:36
@miyoungc miyoungc mentioned this pull request Jun 25, 2026
21 tasks
cv pushed a commit that referenced this pull request Jun 25, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Refreshes the v0.0.68 docs with release notes, Microsoft Teams messaging
guidance, and generated support-matrix coverage.
Also corrects the Hermes generated command reference so `sessions
export` examples match Hermes-only behavior while keeping the shared
command heading compatible with CLI parity checks.

## Changes
- #5585 -> `docs/manage-sandboxes/messaging-channels.mdx`,
`docs/reference/platform-support.mdx`: Documents experimental Microsoft
Teams channel setup, Bot Framework credentials, webhook forwarding,
local `MSTEAMS_PORT` conflicts, and the generated integration support
row.
- #5526 -> `docs/reference/commands.mdx`,
`docs/reference/commands-nemohermes.mdx`: Keeps Hermes `sessions export`
examples on the supported single-JSONL export path while preserving the
canonical shared CLI heading.
- #5044 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for installer onboarding failure propagation.
- #5641 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for fresh recovery after pre-sandbox installer interruption.
- #5673 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for explicit deny-all messaging manifests.
- #5743 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for unsupported-agent channel-add rejection.
- #5252 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Hermes `gateway-token` dashboard guidance.
- #5659 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for local OpenClaw `agent` wrapper help.
- #5661 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for default extra-agent paths.
- #5669 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Deep Agents Code branding.
- #5672 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for hosted-compatible default model ID preservation.
- #5725 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Deep Agents Code sandbox liveness.
- #5644 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for DGX Spark managed-vLLM express install defaults.
- #5712 -> `docs/about/release-notes.mdx`,
`docs/reference/platform-support.mdx`: Adds v0.0.68 release-note
coverage for the canonical support matrix and updates the matrix source
with Teams.

## Type of Change

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

## Quality Gates
<!-- Check all that apply. For any "covered by existing tests", "not
applicable", or waiver entry, add a brief justification on the same line
or in the Changes section. -->
- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: docs-only release refresh;
no runtime code changed.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [ ] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — `npm
run docs` passed with 0 errors; Fern reported the existing light-mode
accent contrast warning.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

Additional verification:
- `python3 scripts/generate-platform-docs.py --check` passed.
- `npm run docs:sync-agent-variants` passed.
- `bash test/e2e/e2e-cloud-experimental/check-docs.sh --only-cli`
passed.
- `npm run docs` passed with 0 errors and one Fern theme warning:
light-mode accent contrast ratio is 2.41:1 and should be at least 3:1.
- `npm run build:cli` refreshed local untracked `dist/` artifacts after
rebase; no tracked files changed.
- `npm run typecheck:cli` passed.
- Normal commit and push hooks passed after the local CLI rebuild.

---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added **Microsoft Teams** as an experimental messaging channel,
including manifest-first onboarding, local port routing/conflict
handling, sandbox delivery controls, and policy preset support.

* **Documentation**
* Expanded messaging-channel setup for Teams (prerequisites,
credential/webhook setup, wizard flow, and add/remove commands).
* Updated reference docs for **agent-specific** session export examples
(OpenClaw vs Hermes).
* Refreshed platform support guidance and added the latest release-notes
entry.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added the NV QA Bugs found by the NVIDIA QA Team label Jun 26, 2026
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary
For Hermes sandboxes, 'nemoclaw/nemohermes <name> gateway-token'
previously dead-ended on the OpenClaw-only 'not applicable' diagnostic,
leaving Hermes users who followed generic dashboard-token quickstart
patterns without a next step during Day0 verification. Added a
notApplicableLines() helper in src/lib/gateway-token-command.ts that,
for the 'hermes' agent, appends two Hermes-specific lines directing
users to the supported dashboard auth path: 'For Hermes dashboard
access, run: nemoclaw <name> dashboard-url' and a note that Hermes
dashboard auth is read from the in-sandbox config
(~/.hermes/config.yaml), not a gateway token. Non-Hermes, non-OpenClaw
agents retain the single explanatory line. The command still exits
cleanly (exit 1, diagnostics on stderr via
GatewayTokenCommandError.lines rendered by the token.ts caller's
failWithLines).

## Related Issue
Fixes NVIDIA#5249

## Changes
- Automated Claude Code fix selected by
`auto_fix/auto_fix_recent_issues.py`.
- See the commits on this branch for the exact file-level changes.

## Type of Change
- [x] 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
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [ ] `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
- [ ] `make docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

Verification details reported by Claude Code:
- Ran focused unit tests: npx vitest run
src/lib/gateway-token-command.test.ts -> 14 passed (includes new
assertions for /dashboard-url/ and /.hermes/config.yaml/ in the Hermes
path, plus a new test asserting non-Hermes non-OpenClaw agents keep a
single line)
- Type-checked the CLI: npx tsc --noEmit -p tsconfig.cli.json -> clean
(no errors)
- Linted changed files: npx biome check src/lib/gateway-token-command.ts
src/lib/gateway-token-command.test.ts -> no issues
- Confirmed the ~/.hermes/config.yaml path matches the canonical form
used across the codebase (agents/hermes/config/write-config.ts,
messaging manifests) which resolves to /sandbox/.hermes/config.yaml
inside the sandbox
- Confirmed caller src/commands/sandbox/gateway/token.ts renders all
error.lines via failWithLines, so the multi-line Hermes hint is surfaced
to users
- `git diff src/lib/gateway-token-command.ts`
- `git diff src/lib/gateway-token-command.test.ts`
- `grep -rni 'hermes/config' (verify config path)`
- `npx vitest run src/lib/gateway-token-command.test.ts`
- `npx tsc --noEmit -p tsconfig.cli.json`
- `npx biome check src/lib/gateway-token-command.ts
src/lib/gateway-token-command.test.ts`
- `git add src/lib/gateway-token-command.ts
src/lib/gateway-token-command.test.ts && git commit`

---
<!-- DCO sign-off required by CI. Run: git config user.name && git
config user.email -->
Signed-off-by: Jason Ma <jama@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved “gateway-token” diagnostics when the command is not
applicable: Hermes now shows a detailed, multi-line message (including
the dashboard URL and `~/.hermes/config.yaml` path), while other
non-applicable agents show a single concise line.

* **Documentation**
* Updated Hermes browser-auth guidance to use `nemohermes <name>
dashboard-url` and authenticate from `~/.hermes/config.yaml` instead of
using a gateway token.

* **Tests**
* Strengthened assertions to verify the exact diagnostic line contents
and correct inclusion/exclusion of the Hermes URL.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jason Ma <jama@nvidia.com>
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Charan Jagwani <cjagwani@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Refreshes the v0.0.68 docs with release notes, Microsoft Teams messaging
guidance, and generated support-matrix coverage.
Also corrects the Hermes generated command reference so `sessions
export` examples match Hermes-only behavior while keeping the shared
command heading compatible with CLI parity checks.

## Changes
- NVIDIA#5585 -> `docs/manage-sandboxes/messaging-channels.mdx`,
`docs/reference/platform-support.mdx`: Documents experimental Microsoft
Teams channel setup, Bot Framework credentials, webhook forwarding,
local `MSTEAMS_PORT` conflicts, and the generated integration support
row.
- NVIDIA#5526 -> `docs/reference/commands.mdx`,
`docs/reference/commands-nemohermes.mdx`: Keeps Hermes `sessions export`
examples on the supported single-JSONL export path while preserving the
canonical shared CLI heading.
- NVIDIA#5044 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for installer onboarding failure propagation.
- NVIDIA#5641 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for fresh recovery after pre-sandbox installer interruption.
- NVIDIA#5673 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for explicit deny-all messaging manifests.
- NVIDIA#5743 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for unsupported-agent channel-add rejection.
- NVIDIA#5252 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Hermes `gateway-token` dashboard guidance.
- NVIDIA#5659 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for local OpenClaw `agent` wrapper help.
- NVIDIA#5661 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for default extra-agent paths.
- NVIDIA#5669 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Deep Agents Code branding.
- NVIDIA#5672 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for hosted-compatible default model ID preservation.
- NVIDIA#5725 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Deep Agents Code sandbox liveness.
- NVIDIA#5644 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for DGX Spark managed-vLLM express install defaults.
- NVIDIA#5712 -> `docs/about/release-notes.mdx`,
`docs/reference/platform-support.mdx`: Adds v0.0.68 release-note
coverage for the canonical support matrix and updates the matrix source
with Teams.

## Type of Change

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

## Quality Gates
<!-- Check all that apply. For any "covered by existing tests", "not
applicable", or waiver entry, add a brief justification on the same line
or in the Changes section. -->
- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: docs-only release refresh;
no runtime code changed.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [ ] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — `npm
run docs` passed with 0 errors; Fern reported the existing light-mode
accent contrast warning.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

Additional verification:
- `python3 scripts/generate-platform-docs.py --check` passed.
- `npm run docs:sync-agent-variants` passed.
- `bash test/e2e/e2e-cloud-experimental/check-docs.sh --only-cli`
passed.
- `npm run docs` passed with 0 errors and one Fern theme warning:
light-mode accent contrast ratio is 2.41:1 and should be at least 3:1.
- `npm run build:cli` refreshed local untracked `dist/` artifacts after
rebase; no tracked files changed.
- `npm run typecheck:cli` passed.
- Normal commit and push hooks passed after the local CLI rebuild.

---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added **Microsoft Teams** as an experimental messaging channel,
including manifest-first onboarding, local port routing/conflict
handling, sandbox delivery controls, and policy preset support.

* **Documentation**
* Expanded messaging-channel setup for Teams (prerequisites,
credential/webhook setup, wizard flow, and add/remove commands).
* Updated reference docs for **agent-specific** session export examples
(OpenClaw vs Hermes).
* Refreshed platform support guidance and added the latest release-notes
entry.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior NV QA Bugs found by the NVIDIA QA Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[All Platforms][CLI&UX] nemohermes <name> gateway-token misleading for Hermes agent

5 participants