Skip to content

fix(e2e): bind Hermes Discord websocket endpoint - #10296

Closed
cjagwani wants to merge 2 commits into
mainfrom
codex/fix-hermes-discord-websocket-binding-10155
Closed

fix(e2e): bind Hermes Discord websocket endpoint#10296
cjagwani wants to merge 2 commits into
mainfrom
codex/fix-hermes-discord-websocket-binding-10155

Conversation

@cjagwani

@cjagwani cjagwani commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Hermes Discord E2E now binds its fake Gateway credential provider to the WebSocket endpoint explicitly. Before this change, an HTTP and WebSocket endpoint sharing the same host and port could leave the credential on the wrong endpoint, causing OpenShell to close the native Discord Gateway connection before READY.

Related Issue

Part of #10155.

Changes

  • Require the policy-binding fixture to receive an endpoint protocol.
  • Pass websocket from the live Hermes Discord scenario.
  • Cover missing-protocol rejection and same-host/port protocol disambiguation.
  • Reuse the support-test invocation helper for the missing-protocol case.

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)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests 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: Codex reviewed the exact commit a21a881b4f23c21d51224545487efeef4882e926 against the nine-category security checklist. The change narrows credential binding to the WebSocket endpoint and the follow-up commit only centralizes a test invocation; it does not change credential values, redaction, endpoint access, or sandbox permissions. The exact-head PR Review Advisor Trust specialist and synthesis also completed with no findings. Verdict: PASS.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit: Not applicable
  • Station profile/scenario: Not applicable
  • Result: Not applicable
  • Supporting evidence: Not applicable

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable — all normal hooks passed for a21a881b4f23c21d51224545487efeef4882e926; the pre-push CLI build/typecheck passed after generating the clean worktree's ignored dist/ artifacts.
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — exact-head local evidence: Hermes Discord policy-binding support tests 3/3, codebase growth guardrails 32/32, Biome, and git diff --check; the exact-head PR Review Advisor completed all specialists and synthesis with high-confidence merge_as_is and no findings.
  • Applicable broad gate passed — exact-head ordinary CI passed, while the exact hermes-discord live E2E is waiting on the trusted catalogue-profile correction in fix(e2e): build changed sandbox images locally #10263; this PR remains draft until that live target passes.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run 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)

Documentation Writer Review

  • Documentation writer reviewed the exact change.
  • Result: no-docs-needed
  • Evidence: Exact HEAD a21a881b4f23c21d51224545487efeef4882e926 changes only three E2E fixture/live/support files and does not change shipped Hermes Discord behavior or user workflow.

Exact E2E Validation

  • Required selector: hermes-discord
  • Candidate commit: a21a881b4f23c21d51224545487efeef4882e926
  • Run 32915283135 attempt 1 stopped in Authenticate manual PR dispatch because the workflow token returned HTTP 403; the selector did not execute.
  • Run 32915283135 attempt 2 passed manual-PR authentication and matrix generation, but onboarding stopped before the Discord assertions because the reusable catalogue profile did not receive the trusted managed-image revision and GHCR correctly returned HTTP 404 for unpublished PR version v0.0.114-107-ga21a881b4.
  • Issue Fix E2E failures reproduced during PR #10113 qualification #10153 identifies PR fix(e2e): build changed sandbox images locally #10263 as the owning catalogue-profile correction. Its current head passes the focused workflow-boundary suites and is completing CI.
  • This PR remains draft until the exact-head selector passes.

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

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

copy-pr-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

@github-code-quality

github-code-quality Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit a21a881 in the codex/fix-hermes-dis... branch remains at 96%, unchanged from commit 28beb3d in the main branch.

TypeScript / code-coverage/cli

The overall line coverage in commit a21a881 in the codex/fix-hermes-dis... branch remains at 83%, unchanged from commit 28beb3d in the main branch.

Show a line coverage summary of the most impacted files.
File main 28beb3d codex/fix-hermes-dis... a21a881 +/-
src/lib/onboard...cker-journal.ts 75% 73% -2%
src/lib/onboard...er-gpu-patch.ts 81% 79% -2%
src/lib/onboard...eate-attempt.ts 90% 88% -2%
src/lib/onboard...trap/adapter.ts 71% 70% -1%
src/lib/policy/index.ts 68% 67% -1%
src/lib/onboard...ndbox-create.ts 89% 88% -1%
src/lib/onboard...uild-context.ts 74% 74% 0%
src/lib/onboard...eate-journal.ts 87% 90% +3%
src/lib/onboard...vider/docker.ts 85% 89% +4%
src/lib/onboard...er-gpu-route.ts 93% 97% +4%

Updated August 26, 2026 00:57 UTC

@cjagwani

Copy link
Copy Markdown
Collaborator Author

Security review — b1fb0573150e6b203f078ef1abbdb23889d096ed

Verdict: PASS; no findings. Secrets/credentials: PASS. Input validation: PASS. Authentication/authorization: PASS. Dependencies: PASS. Error handling/logging: PASS. Cryptography/data protection: PASS (not applicable). Configuration: PASS. Security testing: PASS. Holistic posture: PASS.

The helper now requires an exact host, port, and protocol match and the live caller selects websocket. This narrows credential binding without changing secrets, redaction, allow rules, binaries, ports, or sandbox permissions. Reviewed in full: test/e2e/fixtures/hermes-discord-policy-binding.ts, test/e2e/live/hermes-discord.test.ts, and test/e2e/support/hermes-discord-policy-binding.test.ts.

@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression integration: discord Discord integration or channel behavior integration: hermes Hermes integration behavior labels Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Synthesis status: Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite for the commit under review.

Recommended E2E: None

Manual-only E2E: cloud-onboard, security-posture, hermes-discord, cloud-inference
The manual PR workflow does not run these selectors for the commit under review. Run them from reviewed code on main.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

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

Copy link
Copy Markdown
Collaborator Author

Handoff: #10281 now contains this PR's protocol-aware fake Hermes Discord credential binding and negative fixture coverage, plus the production inactive-preset correction required by #10153. #10281 is the composed candidate; these two PRs should not both merge.

No exact hermes-discord selector has passed yet, so #10281 stays draft until that branch E2E executes and passes. I am leaving this PR open for maintainer confirmation rather than closing it unilaterally.

cv pushed a commit that referenced this pull request Aug 27, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Hermes post-boot policy selection could retain repository-owned
messaging presets when `enabledChannels` did not include those channels.
The selector now removes those inactive presets, preserves same-name
custom presets, and retains required presets for enabled channels
without changing OpenClaw selection.

## Related Issue

Part of #10153.

Supersedes #10296. This PR preserves Charan Jagwani's protocol-aware
Hermes Discord fixture correction as commit
`3cf9274893309fa837c994ae15680ce9849ae185` and adds the production
inactive-preset correction.

## E2E Root-Cause Claim

E2E root cause: Hermes policy selection / post-boot preset
reconciliation / an inactive repository-owned messaging preset survives
the authoritative enabled-channel set and references an unattached
provider.

Source run: https://github.com/NVIDIA/NemoClaw/actions/runs/32869481833

Affected jobs:

- Hermes open egress, job 97873593428
- Hermes Discord rebuild, job 97873593660

Stable signature: `credential_binding references provider
'<sandbox>-slack-app', but that provider is not attached to the
sandbox`.

Scope: one root cause across two jobs. PR #10271 separately owns the
earlier equal-specificity Slack route ambiguity. The Hermes Slack API
HTTP 500 result is not part of this PR.

Focused E2E selectors:
`common-egress-agent-hermes-open-reference,hermes-discord`.

## Changes

- Derive repository-owned messaging preset names from the channel
manifest registry.
- Exclude inactive Hermes messaging presets from fresh suggestions,
recorded resume state, applied-preset preservation, and custom-list
reconciliation.
- Preserve same-name custom presets and existing OpenClaw behavior.
- Merge required presets for enabled Hermes messaging channels after
pruning inactive presets.
- Persist the selected preset list only after gateway synchronization
and post-sync readiness succeed, so failed removal remains retryable.
- Add regression coverage for empty enabled channels, Discord-only and
Google Chat selection, stale applied Slack state, custom ownership,
failed removal and resume, custom lists, and OpenClaw compatibility.

The shared pruner serves the fresh, resume, and custom selection
consumers. Separate filters at each call site would duplicate the
channel-to-preset authority. The focused suggestion, resume, selection,
and handler tests protect these paths.

## Type of Change

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

## Quality Gates

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior. Justification:
- [ ] Tests not applicable. Justification:
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded. Reviewer/approval link/justification: Codex Desktop
independently reviewed all nine security categories at commit under
review `f53c448bdb2bc04a99c7ef7059821cec886a4eda`; result `PASS` with no
findings. The latest commit is a signed empty child of
`39aaae46641a133818622f441d63410905b4f574` with the identical reviewed
tree. The selector narrows repository-owned Hermes messaging presets to
enabled channels, preserves same-name custom policies, restores required
presets after pruning, and persists the selection only after live
synchronization and readiness succeed. The change does not expose
credentials or widen hosts, providers, methods, protocols, or policy
authority.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer.
Check name, approval link, and follow-up issue: None accepted. Current
exact-head checks are still in progress.

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit: Not applicable
- Station profile/scenario: Not applicable
- Result: Not applicable
- Supporting evidence: Not applicable

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] `npm run validate:pr` passed for the unchanged effective patch at
`0273a1deb451f2c106658c27d7d0482eb9f913f9`. Commit under review
`f53c448bdb2bc04a99c7ef7059821cec886a4eda` is a signed empty child with
the identical tree, based on current main
`803a587752aef1896c659f0ed7373d501b3b4b24`.
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above. For the unchanged effective patch, 177
focused deterministic tests and the added rebuild regression passed 1/1.
The CLI build and typecheck, repository checks, `npm run validate:pr`,
`npm run docs` with 0 errors and 2 existing warnings, and `git diff
--check` passed. The current signed empty child has the identical tree
and stable patch ID.
- [ ] Applicable broad gate passed. Not run because this change affects
one policy-selection failure class; the focused suite and `npm run
validate:pr` passed.
- [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)
- [ ] 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)

## Documentation Writer Review

- [x] Documentation writer subagent reviewed the completed changes
- Result: `docs-updated`
- Evidence: Reviewed the complete 24-file effective diff at commit under
review `f53c448bdb2bc04a99c7ef7059821cec886a4eda` against base SHA
`803a587752aef1896c659f0ed7373d501b3b4b24`. The latest PR commit is a
signed empty child of `39aaae46641a133818622f441d63410905b4f574` with
the same tree, and the stable patch ID matches the previously corrected
diff. The four changed documentation pages accurately limit inactive
built-in messaging preset removal and exact custom-policy preservation
to Hermes. Shared onboarding guidance accurately states that skip mode
applies required presets for enabled channels. The diagnostic, comments,
and behavior-oriented test titles match the implementation. The supplied
CLI build and typecheck, repository checks, `npm run validate:pr`, docs
build with 0 errors and 2 existing warnings, focused deterministic
tests, rebuild regression, and fresh `git diff --check` passed.
- Agent: Codex documentation writer subagent (`/root/docs_review_10270`)
<!-- docs-review-head-sha: f53c448 -->
<!-- docs-review-agents-blob-sha:
281e79f -->

---
Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com>


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

* **Bug Fixes**
* Improved Hermes onboarding and sandbox rebuilds by removing inactive
built-in messaging presets.
* Preserves enabled-channel and custom presets, including custom presets
sharing names with inactive channels.
  * Added Google Chat support to channel-based preset selection.
* Improved interrupted onboarding recovery, persistence failures, and
retry behavior.
* Preserves required presets in custom and skip modes for enabled
messaging channels.
* **Documentation**
* Clarified messaging-channel behavior during onboarding and sandbox
recovery.
* **Tests**
* Expanded coverage for onboarding, rebuilds, resume selection, custom
ownership, retries, and supported channels.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com>
Co-authored-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com>
Co-authored-by: Charan Jagwani <cjagwani@nvidia.com>
Co-authored-by: Aaron Erickson <aerickson@nvidia.com>
@prekshivyas

Copy link
Copy Markdown
Collaborator

Closing as superseded by merged PR #10281. That PR incorporated this protocol-aware Hermes Discord WebSocket credential-binding correction, together with the production inactive-preset fix, and its exact Hermes E2E selectors passed before merge.

Keeping this draft open would leave duplicate ownership of changes already delivered on main. Thank you for isolating and validating the original correction.

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

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression integration: discord Discord integration or channel behavior integration: hermes Hermes integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants