Repository navigation
fix(hermes): surface upstream provider and clarify onboard menu - #5010
Conversation
Signed-off-by: Tinson Lai <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR records the selected upstream inference provider and model in Hermes configs ( ChangesHermes Upstream Metadata and Header
Sequence Diagram: sequenceDiagram
participant Onboard as Onboard/BuildEnv
participant ConfigBuilder as buildHermesConfig
participant HeaderBuilder as buildHermesUpstreamHeader
participant Writer as writeHermesConfig/composeSandboxConfigBody
Onboard->>ConfigBuilder: provide upstreamProvider + model
ConfigBuilder->>HeaderBuilder: read config._nemoclaw_upstream
HeaderBuilder->>Writer: return sanitized header string
Writer->>Sandbox: write final config.yaml (header + body)
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
Suggested Labels
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Tinson Lai <[email protected]>
E2E Advisor RecommendationRequired E2E: Dispatch hint: Auto-dispatched E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: Dispatch required scenario E2E:
Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/sandbox/config.ts (1)
32-47: ⚡ Quick winConsider adding a test to verify the mirror implementations stay in sync.
The comment acknowledges that this is a mirror of
agents/hermes/config/upstream-header.tsand explains the tsconfig/Dockerfile constraints. However, there's no automated check ensuring the two implementations produce identical output. Adding a test that compares the output of both functions for the same inputs would catch drift and reduce maintenance risk.🤖 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/sandbox/config.ts` around lines 32 - 47, Add a unit test that asserts the sandbox mirror function buildHermesUpstreamHeader returns identical output to the Hermes agent implementation in agents/hermes/config/upstream-header.ts for a variety of inputs; call buildHermesUpstreamHeader and the Hermes-side function with cases including no _nemoclaw_upstream, non-object _nemoclaw_upstream, upstream with only provider, only model, both provider and model, and empty strings, and fail the test if any outputs differ so any drift between the two implementations is caught automatically.
🤖 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/sandbox/config.ts`:
- Around line 32-47: Add a unit test that asserts the sandbox mirror function
buildHermesUpstreamHeader returns identical output to the Hermes agent
implementation in agents/hermes/config/upstream-header.ts for a variety of
inputs; call buildHermesUpstreamHeader and the Hermes-side function with cases
including no _nemoclaw_upstream, non-object _nemoclaw_upstream, upstream with
only provider, only model, both provider and model, and empty strings, and fail
the test if any outputs differ so any drift between the two implementations is
caught automatically.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ea6f7579-e5f2-4983-8bc7-cece81d165d5
📒 Files selected for processing (7)
agents/hermes/config/hermes-config.tsagents/hermes/config/upstream-header.tsagents/hermes/config/write-config.tssrc/lib/actions/inference-set.test.tssrc/lib/actions/inference-set.tssrc/lib/sandbox/config.tstest/generate-hermes-config.test.ts
Selective E2E Results — ✅ All requested jobs passedRun: 27180817415
|
There was a problem hiding this comment.
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 `@test/onboard-selection.test.ts`:
- Around line 939-943: The added assertion using assert.match(menuOutput,
/Select your inference provider:/, `${scenario.name}: expected
provider-selection header in menu output`) increases the test file size past the
CI budget; reduce file length by either removing the custom message or
shortening it, or by compacting nearby assertions into a single assertion—e.g.,
replace the three-argument assert.match call with a two-argument
assert.match(menuOutput, /Select your inference provider:/) (removing the
`${scenario.name}` message) or consolidate adjacent assertions around menuOutput
into one combined regex check; update the test that references menuOutput and
scenario.name accordingly (function/variable names: assert.match, menuOutput,
scenario.name).
🪄 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: 72417cb4-9dc1-4d40-a760-bd028d03f242
📒 Files selected for processing (4)
src/lib/onboard.tssrc/lib/onboard/providers.test.tssrc/lib/onboard/providers.tstest/onboard-selection.test.ts
✅ Files skipped from review due to trivial changes (2)
- src/lib/onboard/providers.ts
- src/lib/onboard.ts
PR Review AdvisorFindings: 2 needs attention, 3 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
Selective E2E Results — ✅ All requested jobs passedRun: 27180934419
|
…s, extract helper Signed-off-by: Tinson Lai <[email protected]>
…stream-visibility
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/lib/sandbox/hermes-upstream-header.parity.test.ts (1)
76-86: 💤 Low valueConsider clarifying the magic number 180.
The test asserts that each line is less than 180 characters, but the reasoning isn't documented. Based on the context snippet,
HEADER_VALUE_MAX_LENGTH = 128and the longest line prefix is# Upstream provider:(~21 chars), so the actual max line length is ~149 chars. A brief comment explaining this calculation would improve test maintainability.📝 Proposed clarification
it("length-caps each header value to keep the comment block bounded", () => { const header = buildHostHeader({ _nemoclaw_upstream: { provider: "x".repeat(1024), model: "y".repeat(1024), }, }); + // Max line ~149 chars: "# Upstream provider: " (21) + HEADER_VALUE_MAX_LENGTH (128) for (const line of header.split("\n")) { expect(line.length).toBeLessThan(180); } });🤖 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/sandbox/hermes-upstream-header.parity.test.ts` around lines 76 - 86, The test in hermes-upstream-header.parity.test.ts uses a magic number 180 for max line length; update the test around the it("length-caps...") block (the buildHostHeader call and subsequent loop) to include a short inline comment that explains how 180 was derived (e.g., HEADER_VALUE_MAX_LENGTH + length of the longest prefix like "# Upstream provider: " and any extra characters/spacing), referencing the HEADER_VALUE_MAX_LENGTH constant and the "# Upstream provider: " prefix so future readers can recompute the value if those parts change.
🤖 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/sandbox/hermes-upstream-header.parity.test.ts`:
- Around line 61-74: The test for buildHostHeader currently asserts no control
characters with a regex that omits CR, TAB and C1 controls; update the assertion
to match the actual sanitizer (/[\x00-\x1F\x7F-\x9F]/) so it verifies that all
characters the sanitizer removes (including \x09, \x0D and \x80-\x9F) are gone
from the header produced by buildHostHeader, i.e. replace the existing
expect(header).not.toMatch(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/) check with one
that asserts absence of /[\x00-\x1F\x7F-\x9F]/.
---
Nitpick comments:
In `@src/lib/sandbox/hermes-upstream-header.parity.test.ts`:
- Around line 76-86: The test in hermes-upstream-header.parity.test.ts uses a
magic number 180 for max line length; update the test around the
it("length-caps...") block (the buildHostHeader call and subsequent loop) to
include a short inline comment that explains how 180 was derived (e.g.,
HEADER_VALUE_MAX_LENGTH + length of the longest prefix like "# Upstream
provider: " and any extra characters/spacing), referencing the
HEADER_VALUE_MAX_LENGTH constant and the "# Upstream provider: " prefix so
future readers can recompute the value if those parts change.
🪄 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: e5e6ba80-1172-47c6-a97f-fd0ac97ddebd
📒 Files selected for processing (8)
agents/hermes/Dockerfileagents/hermes/config/build-env.tsagents/hermes/config/hermes-config.tsagents/hermes/config/upstream-header.tssrc/lib/onboard/dockerfile-patch.tssrc/lib/sandbox/config.tssrc/lib/sandbox/hermes-upstream-header.parity.test.tssrc/lib/sandbox/hermes-upstream-header.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/lib/sandbox/config.ts
Selective E2E Results — ❌ Some jobs failedRun: 27182725493
|
Signed-off-by: Tinson Lai <[email protected]>
Selective E2E Results — ❌ Some jobs failedRun: 27183294248
|
…pstream pairing Signed-off-by: Tinson Lai <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/onboard/dockerfile-patch.test.ts (1)
280-281: ⚡ Quick winAssert fallback matches
NEMOCLAW_PROVIDER_KEYexactly.At Line 280 and Line 281, this test can still pass if fallback writes the wrong upstream value (as long as it isn’t
old). Please assert the equality contract directly (upstreamProvider === providerKey) so regressions in fallback mapping are caught.Suggested test tightening
const patched = fs.readFileSync(dockerfilePath, "utf-8"); - expect(patched).toMatch(/^ARG NEMOCLAW_UPSTREAM_PROVIDER=.+$/m); - expect(patched).not.toContain("ARG NEMOCLAW_UPSTREAM_PROVIDER=old"); + const providerKey = patched.match(/^ARG NEMOCLAW_PROVIDER_KEY=(.+)$/m)?.[1]; + const upstreamProvider = patched.match(/^ARG NEMOCLAW_UPSTREAM_PROVIDER=(.+)$/m)?.[1]; + expect(providerKey).toBeDefined(); + expect(upstreamProvider).toBeDefined(); + expect(upstreamProvider).toBe(providerKey);🤖 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/dockerfile-patch.test.ts` around lines 280 - 281, The test currently only checks that the patched Dockerfile contains an ARG NEMOCLAW_UPSTREAM_PROVIDER line and that it is not "old", which allows incorrect fallbacks to slip through; update the assertions to assert exact equality between the produced upstream value and the expected provider key: locate the variable holding the patched output (patched) and the expected key constant (NEMOCLAW_PROVIDER_KEY or providerKey used in the test), then replace the loose regex/negation with an assertion that the ARG line equals `ARG NEMOCLAW_UPSTREAM_PROVIDER=${expectedKey}` (and you can keep the negative check for "old" if desired) so the fallback mapping is validated precisely.
🤖 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/dockerfile-patch.test.ts`:
- Around line 280-281: The test currently only checks that the patched
Dockerfile contains an ARG NEMOCLAW_UPSTREAM_PROVIDER line and that it is not
"old", which allows incorrect fallbacks to slip through; update the assertions
to assert exact equality between the produced upstream value and the expected
provider key: locate the variable holding the patched output (patched) and the
expected key constant (NEMOCLAW_PROVIDER_KEY or providerKey used in the test),
then replace the loose regex/negation with an assertion that the ARG line equals
`ARG NEMOCLAW_UPSTREAM_PROVIDER=${expectedKey}` (and you can keep the negative
check for "old" if desired) so the fallback mapping is validated precisely.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 682986c9-4a86-46a6-990f-b20498205efe
📒 Files selected for processing (6)
src/lib/actions/inference-set.test.tssrc/lib/onboard/dockerfile-patch.test.tssrc/lib/onboard/hermes-provider-label.test.tssrc/lib/onboard/providers.tssrc/lib/sandbox/compose-sandbox-config-body.test.tssrc/lib/sandbox/config.ts
✅ Files skipped from review due to trivial changes (2)
- src/lib/onboard/hermes-provider-label.test.ts
- src/lib/onboard/providers.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/lib/actions/inference-set.test.ts
- src/lib/sandbox/config.ts
Selective E2E Results — ✅ All requested jobs passedRun: 27184255190
|
… exactly in fallback Signed-off-by: Tinson Lai <[email protected]>
Selective E2E Results — ❌ Some jobs failedRun: 27184674469
|
Selective E2E Results — ✅ All requested jobs passedRun: 27184674469
|
## Summary - Add v0.0.62 release notes from Discussion #5100 and link release highlights to the relevant docs pages. - Document the release's GPU sandbox recreation, sandbox-side local inference verification, and Hermes dashboard port guard in the command and inference references. - Refresh generated NemoClaw user skills for the release-prep docs set. ## Source Summary - #4956 -> `docs/reference/commands.mdx`: Document CDI-first Docker GPU recreation behavior for Linux Docker-driver sandboxes. - #5024 -> `docs/inference/use-local-inference.mdx`: Document sandbox-runtime verification of the `inference.local` local inference route. - #5018 -> `docs/reference/commands.mdx`: Document Jetson/Tegra device-node group propagation for sandbox CUDA initialization. - #5012, #4763, #4706, #5030, #5015 -> `docs/about/release-notes.mdx`: Summarize onboarding and recovery reliability fixes, including the reserved Hermes API port guard. - #5017 and #5043 -> `docs/about/release-notes.mdx`, `docs/reference/commands.mdx`: Summarize mutable OpenClaw config recovery and host-side `agents list` coverage. - #5010 and #5016 -> `docs/about/release-notes.mdx`: Summarize Hermes upstream metadata visibility and WhatsApp QR rendering reliability. - #5045 and prior source docs in the v0.0.62 range -> `.agents/skills/`: Refresh generated user-skill references from the current docs source. ## Skipped - #5019 -> skipped for new prose because it touched `openclaw-sandbox-permissive.yaml`, which matches `docs/.docs-skip`. Existing source docs remain the source for generated skill synchronization. ## Verification - `python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix nemoclaw-user --doc-platform fern-mdx` - `npm run docs` (passes; Fern reports 0 errors and 1 hidden warning) - Pre-commit hooks passed during commit, including docs-to-skills verification, markdown lint, gitleaks, and skills YAML tests. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added `nemoclaw <name> agents list` command. * v0.0.62 release notes added summarizing onboarding and recovery improvements. * **Bug Fixes** * Improved GPU sandbox onboarding reliability (NVIDIA CDI path, Jetson/Tegra device handling). * Better local inference verification and recovery for Linux Docker-driver GPU sandboxes. * Quieter/earlier handling of onboarding drift and port collisions. * **Documentation** * Expanded GPU passthrough, inference verification, writable paths (`/dev/pts`), port 8642 restriction, and command examples. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Prekshi Vyas <[email protected]>
Summary
Two NemoHermes onboard/config visibility fixes. Record the upstream NemoClaw provider name and model as a
_nemoclaw_upstreamannotation block inside the Hermes sandboxconfig.yaml(with a matching YAML comment header) socat config.yamland the documentedgrep -E 'provider|model|api_mode'test pattern reveal the actual upstream route alongside Hermes' proxy-routingprovider: customtag. Rename the onboard inference-options header toSelect your inference provider:and expand the Hermes Provider menu label to list the Nous portal model families, so QA scripts can match the documented header and discover the Hermes-only families without selecting the entry first.Related Issue
Fixes #4972
Fixes #4973
Changes
Hermes config upstream visibility (#4972)
_nemoclaw_upstream: { provider, model }frombuildHermesConfigat image build time, sourced fromNEMOCLAW_PROVIDER_KEYandNEMOCLAW_MODEL.patchHermesInferenceConfigon everynemoclaw inference setso the annotation stays current after host-initiated routing changes.# Managed by NemoClaw — Hermes configuration, upstream provider, upstream model, proxy-rewrite note) on both write paths via a sharedbuildHermesUpstreamHeaderhelper, mirrored insrc/lib/sandbox/config.tsbecausetsconfig.src.jsonrootDir blocks anagents/import and the Hermes Dockerfile context cannot reachsrc/.Onboard provider menu clarity (#4973)
Inference options:header withSelect your inference provider:so existing QA scripts (awk '/Select your inference provider:|Choose \[/,/^$/') match the documented contract.Hermes Provider (Moonshot, Z-AI, MiniMax, Qwen, Xiaomi, …)so the Nous portal model families are discoverable at the menu level rather than only inside the model picker.Tests
_nemoclaw_upstreamblock and the raw YAML comment header onconfig.yaml._nemoclaw_upstreamblock survivesnemoclaw inference set.Hermes Providerand advertises all five named families.Select your inference provider:header.Type of Change
Verification
Signed-off-by: Tinson Lai [email protected]
Summary by CodeRabbit
New Features
UX Improvements
Tests