fix(hermes): accept Langfuse credential placeholders - #7447
Conversation
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
📝 WalkthroughWalkthroughAdds a fail-closed Hermes Langfuse credential patcher, runs it during image builds, verifies raw and OpenShell placeholder credentials, and extends end-to-end, integrity, provisioning, replay, and permission coverage. ChangesHermes Langfuse credential handling
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant DockerBuild
participant CredentialPatcher
participant HermesLangfuse
participant PythonContract
DockerBuild->>CredentialPatcher: Verify SHA256 and execute patch
CredentialPatcher->>HermesLangfuse: Rewrite bundled validator
DockerBuild->>HermesLangfuse: Import patched module
HermesLangfuse->>PythonContract: Validate raw and resolver credentials
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 529a2a3 in the TypeScript / code-coverage/cliThe overall coverage in commit 529a2a3 in the Show a code coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
agents/hermes/Dockerfile (1)
141-160: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winIntegrity-pin the patcher before executing it.
This security-policy patcher is only made read-only, then executed at Lines 218-220. A modified build-context script can alter validator behavior before the later hash gates run. Add a dedicated SHA-256 check immediately after copying it and before invoking Node.
🤖 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 `@agents/hermes/Dockerfile` around lines 141 - 160, In the Hermes Dockerfile setup, add a dedicated SHA-256 integrity check for patch-hermes-langfuse-credentials.mts immediately after it is copied and before the Node invocation around the patcher execution. Validate it against the approved pinned digest and fail the image build on mismatch, before any later hash gates run.Source: Path instructions
🧹 Nitpick comments (1)
test/e2e/support/hermes-langfuse-credential-patch.test.ts (1)
84-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winVerify the CLI result through validator behavior.
The token-presence assertion can pass even if the written validator is semantically wrong. Read the patched file and run the same acceptance/rejection assertions through
runPythoninstead.As per path instructions, “Prefer observable outcomes through the public boundary over source-text … assertions.”
🤖 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/e2e/support/hermes-langfuse-credential-patch.test.ts` around lines 84 - 97, Update the test case around the patcher CLI invocation to validate behavior through the public validator boundary: read the patched fixture, execute it with runPython, and assert the expected acceptance and rejection outcomes instead of checking for the _LANGFUSE_OPENSHELL_KEYS token in source text. Preserve the existing runtime and patching assertions.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.
Outside diff comments:
In `@agents/hermes/Dockerfile`:
- Around line 141-160: In the Hermes Dockerfile setup, add a dedicated SHA-256
integrity check for patch-hermes-langfuse-credentials.mts immediately after it
is copied and before the Node invocation around the patcher execution. Validate
it against the approved pinned digest and fail the image build on mismatch,
before any later hash gates run.
---
Nitpick comments:
In `@test/e2e/support/hermes-langfuse-credential-patch.test.ts`:
- Around line 84-97: Update the test case around the patcher CLI invocation to
validate behavior through the public validator boundary: read the patched
fixture, execute it with runPython, and assert the expected acceptance and
rejection outcomes instead of checking for the _LANGFUSE_OPENSHELL_KEYS token in
source text. Preserve the existing runtime and patching assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 24039e3a-e59e-4de0-b716-572a357c5fe7
📒 Files selected for processing (3)
agents/hermes/Dockerfileagents/hermes/patch-langfuse-credentials.mtstest/e2e/support/hermes-langfuse-credential-patch.test.ts
PR Review Advisor — InformationalAdvisor assessment: Informational / high confidence Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: 2 optional E2E recommendations
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
ericksoa
left a comment
There was a problem hiding this comment.
Requesting changes on exact head 5c7ed7d87caca81dadd2de16ccfcfa5c7e8bdb75.
Two blockers:
-
The new
chmod 444 /usr/local/lib/nemoclaw/patch-hermes-langfuse-credentials.mtstarget is not staged by the Dockerfile replay fixtures. Exact-head CI shards 3, 5, and 7 fail, and focused local validation reproduced the same three failures intest/hermes-doctor-config-hash.test.ts,test/sandbox-rlimit-hooks.test.ts, andtest/sandbox-provisioning.test.ts. Please create and remap the new helper fixture in all three tests. -
The linked issue still says Langfuse support is pending maintainer scope approval and calls for a managed base-URL / endpoint-policy path plus live authentication, trace-ingestion, and credential-sanitization proof. This PR modifies every shipped Hermes image but explicitly omits that supported path, and
Fixes #7446would close the unresolved integration issue. Please record an explicit maintainer decision accepting this narrow prerequisite and keep #7446 open for the remaining contract, or complete the supported integration and live evidence before shipping the image patch.
Positive evidence: the exact-name placeholder validation is narrowly bound and fail-closed, the focused patch tests pass 3/3 on Node 22.23.1, and the actual amd64/arm64 sandbox image builds pass. No raw credentials or new dependencies were introduced.
…gfuse-credentials Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
…gfuse-credentials Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
|
Follow-up on exact head The original review findings are addressed. The normal CI matrix, self-hosted image/E2E checks, CodeQL, CodeRabbit, and both advisor lanes are clean; the canonical advisor ledger has 0 blockers, 0 warnings, and 0 suggestions. The required credentialed E2E evidence run remains blocking for shared runner/performance reasons:
These signatures reproduce the earlier evidence run and are outside this credentials patch. I have not added an unrelated runner/bootstrap workaround here. Approval remains withheld because the required Hermes live path never reached the code under review. |
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
|
@ericksoa Re-review requested for exact head Both requested-change blockers are addressed:
Exact-head evidence:
The required E2E gate remains red only on the previously documented external signatures: both Hermes lanes fail before Hermes starts because the hosted runner reports 0/32 GiB swap active and cannot remove the swapfile; OpenClaw |
Exact-head Hermes E2E + security posture: PASSTested PR head: I ran the live Hermes E2E target locally on Docker Desktop arm64 with the pinned OpenShell
Because the published pinned Hermes base is amd64-only, the supported changed-input path built Result: 1 passed, 0 failed, 0 skipped, 0 pending, 0 unhandled errors in 8m52s. Passed boundaries:
The risk signal records I then reran the same exact-head target in the dedicated workflow posture mode:
Result: 1 passed, 0 failed, 0 skipped, 0 pending, 0 unhandled errors in 3m55s. The target result records Both local runs used mock inference. The normal run covers the functional Hermes path; the posture run matches the dedicated lane's posture flags but does not substitute for its hosted-inference execution. This adds exact-head functional evidence but does not replace the required hosted gate. The hosted Hermes lanes still fail before Vitest while provisioning swap on the runner. Dependency #7444 moved setup to the trusted workflow and added five bounded post-activation observations, but its latest exact-head hosted child still could not see active swap after all five attempts. @ericksoa the requested Hermes functional and dedicated posture-mode E2E are now green on the exact PR head; the remaining red required check is the hosted runner-capacity dependency above. |
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
prekshivyas
left a comment
There was a problem hiding this comment.
Security review — PASS
Exact head: 80c8af2e02e36a1365a629a3bd3e3dd084387fae
- Secrets and credentials: PASS — raw Langfuse values remain outside the sandbox; only exact same-name OpenShell resolver placeholders are accepted.
- Input validation: PASS — public and secret names cannot be swapped, revision digits are bounded to 1–20, malformed or prefixed placeholders are rejected, and upstream source drift fails closed.
- Authentication and authorization: PASS — no auth or permission model changes.
- Dependencies: PASS — no dependency changes; the patch targets the already pinned Hermes runtime.
- Errors and logging: PASS — patch failures stop the image build and do not log credential material.
- Cryptography and data protection: PASS — the patcher is SHA-256 checked before execution and installed read-only; no cryptographic algorithm changes.
- Configuration security: PASS — no endpoint, network-policy, CLI, or supported onboarding surface is added.
- Security testing: PASS — behavior tests cover raw keys, exact placeholders, swapped/malformed values, bounded revisions, idempotence, source drift, duplicate source blocks, image runtime execution, integrity, and final modes.
- System security: PASS — runtime privileges and image ownership are unchanged; the merge resolution preserves the current BuildKit runtime-payload boundary.
Overall verdict: PASS, with no security findings. The narrow product-scope decision and removal condition remain tracked in #7446.
|
Exact-head finish-line evidence for
This PR does not touch OpenClaw onboarding or the shared performance budget. The changed Hermes credential path and both credential/security boundaries are green on the exact head. I have not changed or suppressed the performance guard. @ericksoa please re-review the stale requested-changes state. The original code/scope findings are addressed; the remaining red required check is the unrelated full-E2E performance/runner signal above. |
…gfuse-credentials
|
Exact-head finish-line evidence for
This PR does not change OpenClaw onboarding or the shared performance budget. The changed Hermes credential path and both credential/security boundaries are green on the exact head. I did not change or suppress the unrelated performance guard. @ericksoa please re-review the stale requested-changes state and either approve the addressed code/scope findings or record a maintainer waiver for the remaining unrelated |
ericksoa
left a comment
There was a problem hiding this comment.
Approved on exact head 529a2a31100affee3f3e1f15333ef3ab6192aeba against base 8fcd69c5aea8360d6f46f68b402cea16098c5443.
The original requested changes are addressed. Ordinary CI, image/self-hosted checks, CodeQL, CodeRabbit, and the canonical advisor ledger are clean. In selected E2E run 30118700018, hermes-e2e, Hermes security-posture, credential-sanitization, cloud-onboard, and OpenClaw security-posture passed.
The remaining required-check failure is OpenClaw full-e2e cold-onboard performance (269s versus the existing 228s budget on the retry), outside this PR’s seven Hermes-only files. This approval covers the reviewed code and scope; it does not waive the required check or authorize merge.
<!-- markdownlint-disable MD041 --> ## Summary Adds the canonical pre-tag `## v0.0.95` release entry to `docs/changelog/2026-07-24.mdx`, before the existing v0.0.94 entry. The entry summarizes approved user-visible changes merged since v0.0.94 and excludes internal-only prerequisites. ## Changes - Adds the v0.0.95 summary and detailed bullets for gateway lifecycle, recovery, state transfer, inference compatibility, sandbox security, Discord policy, and E2E evidence. - Links each user-facing theme to the most specific published documentation. - Records the release entry in the shared native changelog used by the OpenClaw, Hermes, and Deep Agents guides. Source summary: - [#7246](#7246), [#7228](#7228), [#7267](#7267), [#7489](#7489), [#7509](#7509), [#7351](#7351), and [#7290](#7290) -> `docs/changelog/2026-07-24.mdx`: Gateway authority, forward teardown and retry, managed recovery, Hermes restart recovery, scoped uninstall, and orphan-aware backup behavior. - [#7344](#7344) and [#7416](#7416) -> `docs/changelog/2026-07-24.mdx`: Atomic SQLite restore and host download verification. - [#7476](#7476), [#7347](#7347), [#7281](#7281), [#7485](#7485), [#7491](#7491), and [#7422](#7422) -> `docs/changelog/2026-07-24.mdx`: Windows Ollama reuse, CDI fallback, bounded OpenRouter connection setup, Nemotron-3 request compatibility, and managed Deep Agents retry and provider-error behavior. - [#6884](#6884), [#7481](#7481), [#6878](#6878), [#7467](#7467), [#7502](#7502), [#7503](#7503), [#7504](#7504), and [#7486](#7486) -> `docs/changelog/2026-07-24.mdx`: Trusted base-image overrides, local rebuild images, runtime validation, config preservation, reviewed package updates, and fewer final-image payload layers. - [#7303](#7303) -> `docs/changelog/2026-07-24.mdx`: Scoped Discord application-command management. - [#7488](#7488), [#7465](#7465), [#7497](#7497), [#7464](#7464), [#7501](#7501), [#7494](#7494), and [#7493](#7493) -> `docs/changelog/2026-07-24.mdx`: Selected-test risk signals, retry cleanup, full root-image validation, direct-main Hermes setup, executed PR-gate evidence, nightly history, and runner wait reporting. - [#7447](#7447) is an internal pinned-runtime prerequisite and is intentionally excluded from canonical supported-integration documentation. - [#7370](#7370) adds maintainer-only advisory reconciliation tooling and does not change supported user behavior. - [#7495](#7495) updates existing documentation and does not add a new v0.0.95 behavior claim. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [x] Existing tests cover changed behavior — justification: `test/changelog-docs.test.ts` validates the dated changelog structure, heading uniqueness, and published links. - [ ] Tests not applicable — justification: - [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: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: `docs/changelog/2026-07-24.mdx`; writing rules, documentation style, factual release meaning, and published links reviewed at exact head `58b02f2bf`. - Agent: Codex documentation writer reviewer <!-- docs-review-head-sha: 58b02f2 --> <!-- docs-review-agents-blob-sha: 9c9b36d --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: `npx vitest run test/changelog-docs.test.ts` passed 6 tests. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: - [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) — the build passed with 0 errors and 2 Fern warnings. - [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) --- Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a new v0.0.95 changelog entry above v0.0.94. * Documented improved externally supervised gateway lifecycle ownership. * Improved snapshot restore reliability and SQLite state handling. * Tightened CLI `backup-all` behavior and host artifact verification. * Updated Windows onboarding guidance (including Ollama service reuse and CDI directory fallback). * Noted inference compatibility fixes, deeper agent failure classification, stricter base-image validation, updated Discord bot command permissions, and refined E2E release automation evidence handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
Summary
Hermes 0.18.0 rejects NemoClaw's safe OpenShell credential placeholders before its Langfuse plugin can create the client. This change lets the pinned Hermes plugin accept only the exact public and secret Langfuse placeholders while keeping raw keys outside the sandbox and preserving Hermes's existing raw-key prefix checks.
Related Issue
Refs #7446
Scope
This is a narrow prerequisite for the already pinned Hermes runtime. It does not add a Langfuse SDK dependency, endpoint policy, CLI flag, managed onboarding flow, or canonical supported-integration documentation. Issue #7446 remains open for the supported integration contract and tracks removal of this patch when pinned Hermes provides equivalent exact-name placeholder support upstream.
Changes
HERMES_LANGFUSE_PUBLIC_KEYonly toLANGFUSE_PUBLIC_KEYandHERMES_LANGFUSE_SECRET_KEYonly toLANGFUSE_SECRET_KEY.Type of Change
Quality Gates
Documentation Writer Review
no-docs-neededWRITING.mdanddocs/CONTRIBUTING.md. This pinned-Hermes image-build compatibility patch changes no command, configuration schema, API, policy, or supported workflow. Existing docs already classify Hermes Langfuse settings as startup-only configuration. Comments and test titles clearly state the fail-closed and credential-binding contracts. Targeted tests passed 3/3 and 80/80;git diff --checkpassed.DGX Station Hardware Evidence
Not applicable —
scripts/prepare-dgx-station-host.shis unchanged.Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passednpm run typecheck:clipassedgit diff --check origin/main...HEADpassednpm run docsbuilds without warnings (doc changes only)Signed-off-by: Prekshi Vyas prekshiv@nvidia.com