Repository navigation
fix(hermes): harden runtime env refresh after Slack alias fix - #5866
Conversation
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughHermes runtime plan validation, ChangesHermes runtime config and messaging aliases
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Auto-dispatched E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
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. |
Selective E2E Results — ✅ All requested jobs passedRun: 28248424518
|
Vitest E2E Scenario Results — ❌ Some jobs failedRun: 28250126970
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@agents/hermes/Dockerfile`:
- Around line 190-194: The baked runtime-plan validation in the Dockerfile is
only checking `runtimeSetup.envAliases`, which is weaker than the shared reduced
schema used by `isRuntimeSetup` in `src/lib/messaging/plan-validation.ts`.
Update the inline `node -e` guard in the Hermes Dockerfile to validate the full
reduced `runtimeSetup` shape, including `nodePreloads` and `secretScans` as
arrays, or reuse the shared validator logic so the build-time check matches the
runtime contract.
In `@agents/hermes/runtime-config-guard.py`:
- Around line 486-497: Validate runtime-plan environment keys before they are
collected for .env rewrites: in the credentialBindings / replacements handling
around provider_env_keys, envKey, and _upsert_env_assignments, reject any
nonconforming key syntax instead of only checking for str. Add a strict
validation step for both providerEnvKey and envKey before adding them to
provider_env_keys or replacements, and raise UnsafePathError for malformed
values so injected newlines or extra assignment text cannot reach
_upsert_env_assignments.
🪄 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: f8267a15-1487-463b-af7d-5f2d20be48dd
📒 Files selected for processing (6)
agents/hermes/Dockerfileagents/hermes/runtime-config-guard.pyagents/hermes/start.shsrc/lib/messaging/channels/slack/manifest.tssrc/lib/onboard/messaging-channel-setup.tstest/hermes-runtime-api-key.test.ts
✅ Files skipped from review due to trivial changes (1)
- src/lib/messaging/channels/slack/manifest.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- agents/hermes/start.sh
Selective E2E Results — ❌ Some jobs failedRun: 28253062860
|
Selective E2E Results — ❌ Some jobs failedRun: 28253745422
|
Selective E2E Results — ✅ All requested jobs passedRun: 28254250074
|
Selective E2E Results —
|
| Job | Result |
|---|---|
| hermes-slack-e2e | ✅ success |
| messaging-providers-e2e |
Selective E2E Results — ✅ All requested jobs passedRun: 28254600990
|
Vitest E2E Scenario Results — ✅ All requested jobs passedRun: 28254723646
|
Selective E2E Results — ❌ Some jobs failedRun: 28254722229
|
Vitest E2E Scenario Results — ✅ All requested jobs passedRun: 28253906739
|
Selective E2E Results — ✅ All requested jobs passedRun: 28255315482
|
Selective E2E Results — ✅ All requested jobs passedRun: 28256971788
|
Selective E2E Results — ✅ All requested jobs passedRun: 28258210953
|
cv
left a comment
There was a problem hiding this comment.
LGTM after addressing any feedback comments
Selective E2E Results — ✅ All requested jobs passedRun: 28258459688
|
Selective E2E Results — ✅ All requested jobs passedRun: 28258609730
|
Vitest E2E Scenario Results — ✅ All requested jobs passedRun: 28258609595
|
Selective E2E Results — ✅ All requested jobs passedRun: 28260303384
|
PR Review Advisor (Nemotron Ultra) — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Findings index
Review findings by urgency: 0 required fixes, 0 items to resolve/justify, 4 in-scope improvements
|
Vitest E2E Scenario Results — ✅ All requested jobs passedRun: 28260362077
|
Selective E2E Results — ✅ All requested jobs passedRun: 28260362458
|
Selective E2E Results — ✅ All requested jobs passedRun: 28261402858
|
Vitest E2E Scenario Results — ✅ All requested jobs passedRun: 28261593247
|
Selective E2E Results — ✅ All requested jobs passedRun: 28261593349
|
Selective E2E Results — ✅ All requested jobs passedRun: 28262699029
|
Selective E2E Results — ✅ All requested jobs passedRun: 28262837403
|
Vitest E2E Scenario Results — ✅ All requested jobs passedRun: 28262837335
|
…#5866) ## Summary - follow up merged PR NVIDIA#5837 by addressing the PR Review Advisor source-of-truth/security/test follow-ups - restrict Hermes provider-placeholder fallback to runtime-plan credential bindings once a reduced runtime plan is present, avoiding arbitrary `.env` key rewrites such as `API_SERVER_KEY` - keep the useful PR NVIDIA#5866 pieces: shared `.env` upsert/dedupe helper, duplicate `API_SERVER_KEY` cleanup without reminting, missing provider placeholder append, and no-op hash stability - document the Slack alias compatibility boundary in the Slack manifest and assert the baked Hermes runtime-plan artifact is safe/reduced in the image - fix the current main TypeScript compile regression in `detectMessagingChannelsFromEnv` by passing the manifest list to `getMessagingManifestAvailabilityContext` ## Validation - `python3 -m py_compile agents/hermes/runtime-config-guard.py` - `npm run build:cli` - `npm test -- --run test/hermes-runtime-api-key.test.ts test/messaging-build-applier.test.ts src/lib/messaging/compiler/manifest-compiler.test.ts` ## Notes - Full pre-push `test-cli` was attempted but hit unrelated local-environment failures/timeouts (missing `../nemoclaw/dist/blueprint/private-networks.js`, missing `nemoclaw/node_modules/json5`, local Docker/OpenShell/CLI timeout tests). Targeted tests and TypeScript build pass. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved messaging channel availability detection using the built-in channel manifest list. * Prevents duplicate `.env` entries by upserting targeted `KEY=VALUE` assignments while preserving the first occurrence. * Fixes Hermes runtime API key refresh flow so “updated” outcomes succeed correctly. * Tightens runtime placeholder/env-key validation to reject malformed or unsafe updates before any `.env` rewrite. * **Documentation** * Clarified Slack runtime placeholder alias behavior with compatibility-boundary guidance. * **Tests / CI** * Expanded Hermes runtime placeholder refresh and strict-hash assertions with deterministic fixtures, including negative and deduplication scenarios. * Added a functional check that the runtime plan artifact is not written when messaging isn’t configured. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
.envkey rewrites such asAPI_SERVER_KEY.envupsert/dedupe helper, duplicateAPI_SERVER_KEYcleanup without reminting, missing provider placeholder append, and no-op hash stabilitydetectMessagingChannelsFromEnvby passing the manifest list togetMessagingManifestAvailabilityContextValidation
python3 -m py_compile agents/hermes/runtime-config-guard.pynpm run build:clinpm test -- --run test/hermes-runtime-api-key.test.ts test/messaging-build-applier.test.ts src/lib/messaging/compiler/manifest-compiler.test.tsNotes
test-cliwas attempted but hit unrelated local-environment failures/timeouts (missing../nemoclaw/dist/blueprint/private-networks.js, missingnemoclaw/node_modules/json5, local Docker/OpenShell/CLI timeout tests). Targeted tests and TypeScript build pass.Summary by CodeRabbit
.enventries by upserting targetedKEY=VALUEassignments while preserving the first occurrence..envrewrite.