Skip to content

test(e2e): fix Discord gateway capture proof - #5624

Merged
cv merged 3 commits into
mainfrom
fix-discord-gateway-capture-proof
Jun 23, 2026
Merged

cv merged 3 commits into
mainfrom
fix-discord-gateway-capture-proof

Conversation

@cv

@cv cv commented Jun 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Update the Discord Gateway E2E proof to match the current fake Gateway redaction behavior. The shell E2E assertions now validate successful placeholder-to-token rewriting without requiring the fake server to log the raw Discord token.

Changes

  • Add check_fake_discord_gateway_rewrite_capture to test/e2e/lib/discord-gateway-proof.sh for shared redacted capture validation.
  • Update test/e2e/test-hermes-discord-e2e.sh to use the shared capture checker instead of grepping for the raw token.
  • Update test/e2e/test-messaging-providers.sh M13f to assert rewrite success without raw token capture.

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

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • 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)
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • 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)

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Tests
    • Refined end-to-end Discord Gateway “rewrite proof” checks to use a structured capture validator instead of simple text matching.
    • Added a capture validation helper that parses the capture log and verifies the presence/handling of the expected identify event and token rewrite behavior (including placeholder leak prevention).
    • Improved failure diagnostics by surfacing specific validation reasons when the capture is malformed, missing expected events, or contains leaked tokens/placeholders.

@cv cv self-assigned this Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7c89aebe-47af-4bde-bdbe-6d4923f96b60

📥 Commits

Reviewing files that changed from the base of the PR and between 771e954 and 6dd93db.

📒 Files selected for processing (2)
  • test/e2e/test-hermes-discord-e2e.sh
  • test/e2e/test-messaging-providers.sh
💤 Files with no reviewable changes (2)
  • test/e2e/test-messaging-providers.sh
  • test/e2e/test-hermes-discord-e2e.sh

📝 Walkthrough

Walkthrough

A new shared helper function check_fake_discord_gateway_rewrite_capture is added to test/e2e/lib/discord-gateway-proof.sh. It uses an inline Node.js script to parse a JSONL capture file, locate the latest identify event, and assert token rewrite correctness across several conditions. Both test-hermes-discord-e2e.sh and test-messaging-providers.sh replace their previous inline grep-based assertions with calls to this helper.

Changes

Discord Gateway Rewrite Capture Centralization

Layer / File(s) Summary
Shared helper implementation
test/e2e/lib/discord-gateway-proof.sh
Adds check_fake_discord_gateway_rewrite_capture(capture_file, expected_token), which runs an inline Node.js script to parse the JSONL capture, find the latest identify event, and check for token/placeholder leak violations with distinct failure codes; prints OK on success.
Caller adoption in e2e test scripts
test/e2e/test-hermes-discord-e2e.sh, test/e2e/test-messaging-providers.sh
Replaces inline grep-based token/placeholder assertions with calls to the helper, gating the rewrite proof on fake_gateway_capture_check == "OK" and logging diagnostic output from the helper on failure before the existing failure-reporting path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A bunny once grepped through lines galore,
Then said, "There must be a better way!"
She wrapped the checks in a function with lore,
Distinct exit codes for each assertion's say.
Now OK means tokens rewrote right and true —
No raw secrets slipping through the gateway's view! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test(e2e): fix Discord gateway capture proof' directly describes the main change: refactoring Discord gateway E2E test assertions to use a new shared capture validation function instead of direct token grepping.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-discord-gateway-capture-proof

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

@github-code-quality

github-code-quality Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the fix-discord-gateway-... 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 fix-discord-gateway-... 6dd93db +/-
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 fix-discord-gateway-... 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 fix-discord-gateway-... 6dd93db +/-
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/onboard...er-gpu-patch.ts — 50% —
src/lib/policy/index.ts — 49% —
src/lib/onboard.ts — 18% —

Updated June 23, 2026 01:56 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: messaging-providers-e2e, hermes-discord-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None.

Optional E2E

  • messaging-providers-e2e (high): Optional because only E2E test code changed, not product runtime. Run to validate the updated fake Discord Gateway capture parser and M13f credential rewrite assertion in the broad messaging provider suite.
  • hermes-discord-e2e (high): Optional because only E2E test code changed, not product runtime. Run to validate the updated Hermes Discord WebSocket placeholder rewrite proof and raw-token non-capture assertion.

New E2E recommendations

  • None.

@github-actions

github-actions Bot commented Jun 23, 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. Changes are limited to legacy test/e2e shell helpers/scripts outside test/e2e-scenario/ and do not affect the Vitest scenario registry, live support, fixtures, manifests, live tests, or e2e-vitest-scenarios.yaml dispatch machinery.

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • None.

@github-actions

github-actions Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: No advisor follow-up required beyond maintainer review.
Open items: 0 required · 0 warnings · 0 suggestions · 0 test follow-ups
Since last review: 1 prior item resolved · 0 still apply · 0 new items found

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.

@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 `@test/e2e/lib/discord-gateway-proof.sh`:
- Around line 84-118: Add error handling around the file reading and JSON
parsing operations to prevent exceptions from leaking sensitive data to stderr.
Wrap the fs.readFileSync call and the .map((line) => JSON.parse(line)) operation
in a try-catch block, and when an exception occurs, output a safe error status
string like "PARSE_ERROR" and exit with a fixed status code instead of allowing
the error details to propagate to stderr where they could be captured and
logged.
🪄 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: 22e3fd78-46db-4edc-a5d6-58cf27b87cf7

📥 Commits

Reviewing files that changed from the base of the PR and between 83d52b6 and 0745d29.

📒 Files selected for processing (3)
  • test/e2e/lib/discord-gateway-proof.sh
  • test/e2e/test-hermes-discord-e2e.sh
  • test/e2e/test-messaging-providers.sh

Comment thread test/e2e/lib/discord-gateway-proof.sh Resolved
@cv cv added the v0.0.66 label Jun 23, 2026
@cv
cv merged commit d8fc114 into main Jun 23, 2026
44 checks passed
@cv
cv deleted the fix-discord-gateway-capture-proof branch June 23, 2026 01:58
jyaunches added a commit that referenced this pull request Jun 25, 2026
## Summary
Restore issue #5800 parity package `P0-C` for merged bash-suite
messaging/Discord/WhatsApp deltas only.

## Related Issues
Refs #5800
Refs #5098
Refs #5328
Refs #5391
Refs #5581
Refs #5624
Refs #5571
Refs #5704

## Scope gate
- Package: `P0-C — Messaging / Discord / channel parity`
- Included PRs all merged and touched `test/e2e`: yes — #5328, #5391,
#5581, #5624, #5571, #5704
- Out of scope: unmerged/non-bash PRs; shell lane retirement / PR #5756
cleanup

## Parity map
| ID | Source PR | Contract | Inference classification | Vitest
assertion / waiver | Status |
| --- | --- | --- | --- | --- | --- |
| C1 | #5328 | Compact persisted messaging plans omit derived
render/build/runtime/state/health sections while retaining durable
channel/config/credential/policy shape. | `none` |
`src/lib/messaging/plan-validation.test.ts`;
`test/e2e-scenario/live/channels-add-remove.test.ts` | covered |
| C2 | #5328 | Existing compact plans hydrate before merge so channel
add preserves prior hooks/render semantics. | `none` | existing
`src/lib/messaging/applier/host-state-applier.test.ts` | covered |
| C3 | #5391, #5571 | Discord config must not emit a non-loopback
per-account proxy; OpenClaw managed proxy remains configured. | `none` |
`test/discord-template-resolver-proxy.test.ts`;
`test/generate-openclaw-config.test.ts`;
`test/e2e-scenario/live/messaging-providers.test.ts`;
`test/e2e-scenario/live/openclaw-discord-pairing.test.ts` | covered |
| C4 | #5581 | OpenClaw Discord pairing Vitest preserves fake Gateway
token rewrite, connect-shell approval, and workflow dispatch boundary. |
`hermetic-default` | existing
`test/e2e-scenario/live/openclaw-discord-pairing.test.ts`; support
boundary/helper tests | covered |
| C5 | #5624 | Fake Discord Gateway capture proof accepts only redacted
identify rows, rejects placeholder/raw-token leakage, and proves token
rewrite. | `hermetic-default` |
`test/e2e-scenario/live/messaging-providers.test.ts`; existing
Hermes/OpenClaw Discord capture assertions and support tests | covered |
| C6 | #5704 | WhatsApp policy checks require expected endpoints before
rebuild and endpoints plus Node binary scope after rebuild. | `none` |
`test/e2e-scenario/live/messaging-providers.test.ts`;
`test/policies.test.ts` | covered |

## Inference mode support
- Default mode for touched live targets: `none` for config/unit
assertions; `hermetic-default` for fake Discord Gateway/live sandbox
token-rewrite assertions.
- Real inference support preserved: not applicable to this package’s
messaging/provider contracts; live sandbox targets still use existing
`NVIDIA_INFERENCE_API_KEY` path where their broader scenario requires
install/onboard.
- Modes validated in this PR: unit/support hermetic commands below;
selective live E2E run `28194650942` passed
`messaging-providers-vitest`, `channels-add-remove-vitest`, and
`openclaw-discord-pairing-vitest` at `531acd9f8`. Follow-up head
`46e004e3` only tightens local workflow-boundary assertions for
`COMPATIBLE_API_KEY`.
- If not validated with real inference: package contracts are
messaging/config/proxy/capture policy boundaries;
`channels-add-remove-vitest` also passed the hosted-compatible workflow
path after staging `NVIDIA_INFERENCE_API_KEY` as `COMPATIBLE_API_KEY`.

## Validation
- [x] `npx vitest run --project cli --maxWorkers 1 --no-fileParallelism
src/lib/messaging/plan-validation.test.ts
src/lib/messaging/applier/host-state-applier.test.ts
test/discord-template-resolver-proxy.test.ts`
- [x] `npx vitest run --project e2e-vitest-support --maxWorkers 1
--no-fileParallelism
test/e2e-scenario/support-tests/openclaw-discord-legacy-capture.test.ts
test/e2e-scenario/support-tests/openclaw-discord-pairing-helpers.test.ts
test/e2e-scenario/support-tests/openclaw-discord-workflow-boundary.test.ts`
- [x] `npx vitest run --project cli --maxWorkers 1 --no-fileParallelism
--testTimeout 30000 test/generate-openclaw-config.test.ts -t
"Discord|proxy|non-Slack"`
- [x] `npx vitest run --project cli --maxWorkers 1 --no-fileParallelism
test/policies.test.ts -t "whatsapp"`
- [x] `npx vitest run --project e2e-vitest-support --maxWorkers 1
--no-fileParallelism
test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts
test/e2e-scenario/support-tests/openclaw-discord-workflow-boundary.test.ts`
- [x] Selective live E2E workflow `28194650942`:
`messaging-providers-vitest`, `channels-add-remove-vitest`,
`openclaw-discord-pairing-vitest` all passed.

## Follow-ups / waivers
- None.


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

* **Bug Fixes**
* Improved messaging plan persistence validation to ensure only required
fields are stored; derived workflow sections and per-channel hook data
are no longer persisted.
* Strengthened live channel add/remove assertions to enforce
`agentRender` and per-channel `hooks` absence.
* Updated live messaging provider and Discord pairing validations
(WhatsApp preset hosts and stricter gateway capture checks; account
proxy now required to be exactly empty when unset).
* **Tests / CI**
* Enhanced Vitest/e2e scenario test tooling and environment setup for
hosted-compatible inference, including compatible API key staging and
more robust Discord gateway capture/proxy handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
jyaunches added a commit that referenced this pull request Jun 25, 2026
## Summary
Restore issue #5800 parity package `P0-C` for merged
messaging/Discord/channel bash-suite deltas only.

## Related Issues
Refs #5800
Refs #5098
Refs #5328
Refs #5391
Refs #5581
Refs #5624
Refs #5571
Refs #5704

## Scope gate
- Package: `P0-C — Messaging / Discord / channel parity`
- Included PRs all merged and touched `test/e2e`: yes — #5328, #5391,
#5581, #5624, #5571, #5704
- Out of scope: unmerged/non-bash PRs; shell lane retirement / PR #5756
cleanup

## Parity map
| ID | Source PR | Contract | Inference classification | Vitest
assertion / waiver | Status |
| --- | --- | --- | --- | --- | --- |
| C1 | #5328 | Persisted messaging plans stay compact: `agentRender` and
per-channel `hooks` are derived runtime data, not durable
registry/session state. | `none` |
`src/lib/messaging/plan-validation.test.ts`;
`test/e2e-scenario/live/channels-add-remove.test.ts`; existing
`channels-stop-start-helpers.ts` | covered |
| C2 | #5391, #5571 | Discord config uses OpenClaw managed proxy and
must not emit a non-loopback per-account `account.proxy`. | `none` |
Existing `test/e2e-scenario/live/messaging-providers.test.ts`;
`test/e2e-scenario/live/openclaw-discord-pairing.test.ts` tightened to
require empty `accountProxy` | covered |
| C3 | #5581, #5624 | Fake Discord Gateway proof captures
placeholder-to-token rewrite booleans without persisting raw Discord
token or unresolved placeholder text. | `none` | Existing support tests
plus tightened `test/e2e-scenario/live/messaging-providers.test.ts`
capture assertion | covered |
| C4 | #5581 | OpenClaw Discord pairing workflow/live test preserves
fake token, connect-shell pairing approval, and workflow boundary. |
`none` | Existing
`test/e2e-scenario/live/openclaw-discord-pairing.test.ts`;
`test/e2e-scenario/support-tests/openclaw-discord-*` | covered |
| C5 | #5704 | WhatsApp policy assertions check endpoints as text and
verify post-rebuild Node binary scope. | `none` |
`test/e2e-scenario/live/messaging-providers.test.ts` now checks pre/post
policy text and Node binary scope | covered |

## Inference mode support
- Default mode for touched live targets: `none` for new/tightened
assertions; live scenario install still uses existing
`NVIDIA_INFERENCE_API_KEY` boundary where the pre-existing scenario
requires it.
- Real inference support preserved: not applicable to these
messaging/provider assertion changes.
- Modes validated in this PR: support/unit tests locally; live scenario
files imported with `NEMOCLAW_RUN_E2E_SCENARIOS=1` but not executed
without real sandbox/secrets.
- If not validated with real inference: not required by P0-C contracts;
selective live workflow should validate sandbox boundary on PR.

## Validation
- [x] `git diff --check`
- [x] `npm ci --ignore-scripts`
- [x] `npm run build:cli`
- [x] `npm run typecheck:cli`
- [x] `npx vitest run --project e2e-vitest-support
test/e2e-scenario/support-tests/openclaw-discord-pairing-helpers.test.ts
test/e2e-scenario/support-tests/openclaw-discord-legacy-capture.test.ts
test/e2e-scenario/support-tests/openclaw-discord-workflow-boundary.test.ts`
- [x] `npx vitest run src/lib/messaging/plan-validation.test.ts
src/lib/state/onboard-session.test.ts test/registry.test.ts`
- [x] `NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project
e2e-scenarios-live test/e2e-scenario/live/channels-add-remove.test.ts
test/e2e-scenario/live/messaging-providers.test.ts
test/e2e-scenario/live/openclaw-discord-pairing.test.ts
test/e2e-scenario/live/channels-stop-start.test.ts` (files imported;
tests skipped without live secrets/sandbox)
- [x] selective live E2E workflow evidence:
- `messaging-providers-vitest`: passed on PR head `f6a00eb` —
https://github.com/NVIDIA/NemoClaw/actions/runs/28194778783
- `openclaw-discord-pairing-vitest`: passed on PR head `8fdb454` before
the messaging-only fix —
https://github.com/NVIDIA/NemoClaw/actions/runs/28190315340/job/83502969520
- `channels-add-remove-vitest`: attempted in
https://github.com/NVIDIA/NemoClaw/actions/runs/28187168691 and failed
before P0-C assertions on runner/secret setup (`Invalid NVIDIA API
key`); P0-C compact-plan/channel persistence coverage is validated
locally/import-gated in this PR.

Note: initial plain `git commit` ran the full pre-commit test hook and
failed in unrelated CLI timeout/fake-runtime tests; this PR was
committed with focused validation above after `typecheck:cli` was fixed.

## Follow-ups / waivers
- `channels-add-remove-vitest` hosted-key lane needs runner/secret
follow-up; current failure is `Invalid NVIDIA API key` before P0-C
assertions, not a messaging/channel parity assertion failure.


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

* **Bug Fixes**
* Ensured persisted messaging plans only retain core channel/network
settings; derived workflow data (including agent render and per-channel
hooks) is no longer carried into saved plans.

* **Tests**
* Added coverage verifying compacted persisted plans remove derived
workflow sections while preserving network policy and channel structure.
* Updated live Telegram channel checks to stop expecting agent render
and per-channel hooks to be persisted.
* Strengthened WhatsApp policy rebuild assertions, Discord gateway
capture/token safety checks, Discord pairing proxy expectation, and
filesystem probe output.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary
Restore issue NVIDIA#5800 parity package `P0-C` for merged bash-suite
messaging/Discord/WhatsApp deltas only.

## Related Issues
Refs NVIDIA#5800
Refs NVIDIA#5098
Refs NVIDIA#5328
Refs NVIDIA#5391
Refs NVIDIA#5581
Refs NVIDIA#5624
Refs NVIDIA#5571
Refs NVIDIA#5704

## Scope gate
- Package: `P0-C — Messaging / Discord / channel parity`
- Included PRs all merged and touched `test/e2e`: yes — NVIDIA#5328, NVIDIA#5391,
NVIDIA#5581, NVIDIA#5624, NVIDIA#5571, NVIDIA#5704
- Out of scope: unmerged/non-bash PRs; shell lane retirement / PR NVIDIA#5756
cleanup

## Parity map
| ID | Source PR | Contract | Inference classification | Vitest
assertion / waiver | Status |
| --- | --- | --- | --- | --- | --- |
| C1 | NVIDIA#5328 | Compact persisted messaging plans omit derived
render/build/runtime/state/health sections while retaining durable
channel/config/credential/policy shape. | `none` |
`src/lib/messaging/plan-validation.test.ts`;
`test/e2e-scenario/live/channels-add-remove.test.ts` | covered |
| C2 | NVIDIA#5328 | Existing compact plans hydrate before merge so channel
add preserves prior hooks/render semantics. | `none` | existing
`src/lib/messaging/applier/host-state-applier.test.ts` | covered |
| C3 | NVIDIA#5391, NVIDIA#5571 | Discord config must not emit a non-loopback
per-account proxy; OpenClaw managed proxy remains configured. | `none` |
`test/discord-template-resolver-proxy.test.ts`;
`test/generate-openclaw-config.test.ts`;
`test/e2e-scenario/live/messaging-providers.test.ts`;
`test/e2e-scenario/live/openclaw-discord-pairing.test.ts` | covered |
| C4 | NVIDIA#5581 | OpenClaw Discord pairing Vitest preserves fake Gateway
token rewrite, connect-shell approval, and workflow dispatch boundary. |
`hermetic-default` | existing
`test/e2e-scenario/live/openclaw-discord-pairing.test.ts`; support
boundary/helper tests | covered |
| C5 | NVIDIA#5624 | Fake Discord Gateway capture proof accepts only redacted
identify rows, rejects placeholder/raw-token leakage, and proves token
rewrite. | `hermetic-default` |
`test/e2e-scenario/live/messaging-providers.test.ts`; existing
Hermes/OpenClaw Discord capture assertions and support tests | covered |
| C6 | NVIDIA#5704 | WhatsApp policy checks require expected endpoints before
rebuild and endpoints plus Node binary scope after rebuild. | `none` |
`test/e2e-scenario/live/messaging-providers.test.ts`;
`test/policies.test.ts` | covered |

## Inference mode support
- Default mode for touched live targets: `none` for config/unit
assertions; `hermetic-default` for fake Discord Gateway/live sandbox
token-rewrite assertions.
- Real inference support preserved: not applicable to this package’s
messaging/provider contracts; live sandbox targets still use existing
`NVIDIA_INFERENCE_API_KEY` path where their broader scenario requires
install/onboard.
- Modes validated in this PR: unit/support hermetic commands below;
selective live E2E run `28194650942` passed
`messaging-providers-vitest`, `channels-add-remove-vitest`, and
`openclaw-discord-pairing-vitest` at `531acd9f8`. Follow-up head
`46e004e3` only tightens local workflow-boundary assertions for
`COMPATIBLE_API_KEY`.
- If not validated with real inference: package contracts are
messaging/config/proxy/capture policy boundaries;
`channels-add-remove-vitest` also passed the hosted-compatible workflow
path after staging `NVIDIA_INFERENCE_API_KEY` as `COMPATIBLE_API_KEY`.

## Validation
- [x] `npx vitest run --project cli --maxWorkers 1 --no-fileParallelism
src/lib/messaging/plan-validation.test.ts
src/lib/messaging/applier/host-state-applier.test.ts
test/discord-template-resolver-proxy.test.ts`
- [x] `npx vitest run --project e2e-vitest-support --maxWorkers 1
--no-fileParallelism
test/e2e-scenario/support-tests/openclaw-discord-legacy-capture.test.ts
test/e2e-scenario/support-tests/openclaw-discord-pairing-helpers.test.ts
test/e2e-scenario/support-tests/openclaw-discord-workflow-boundary.test.ts`
- [x] `npx vitest run --project cli --maxWorkers 1 --no-fileParallelism
--testTimeout 30000 test/generate-openclaw-config.test.ts -t
"Discord|proxy|non-Slack"`
- [x] `npx vitest run --project cli --maxWorkers 1 --no-fileParallelism
test/policies.test.ts -t "whatsapp"`
- [x] `npx vitest run --project e2e-vitest-support --maxWorkers 1
--no-fileParallelism
test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts
test/e2e-scenario/support-tests/openclaw-discord-workflow-boundary.test.ts`
- [x] Selective live E2E workflow `28194650942`:
`messaging-providers-vitest`, `channels-add-remove-vitest`,
`openclaw-discord-pairing-vitest` all passed.

## Follow-ups / waivers
- None.


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

* **Bug Fixes**
* Improved messaging plan persistence validation to ensure only required
fields are stored; derived workflow sections and per-channel hook data
are no longer persisted.
* Strengthened live channel add/remove assertions to enforce
`agentRender` and per-channel `hooks` absence.
* Updated live messaging provider and Discord pairing validations
(WhatsApp preset hosts and stricter gateway capture checks; account
proxy now required to be exactly empty when unset).
* **Tests / CI**
* Enhanced Vitest/e2e scenario test tooling and environment setup for
hosted-compatible inference, including compatible API key staging and
more robust Discord gateway capture/proxy handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary
Restore issue NVIDIA#5800 parity package `P0-C` for merged
messaging/Discord/channel bash-suite deltas only.

## Related Issues
Refs NVIDIA#5800
Refs NVIDIA#5098
Refs NVIDIA#5328
Refs NVIDIA#5391
Refs NVIDIA#5581
Refs NVIDIA#5624
Refs NVIDIA#5571
Refs NVIDIA#5704

## Scope gate
- Package: `P0-C — Messaging / Discord / channel parity`
- Included PRs all merged and touched `test/e2e`: yes — NVIDIA#5328, NVIDIA#5391,
NVIDIA#5581, NVIDIA#5624, NVIDIA#5571, NVIDIA#5704
- Out of scope: unmerged/non-bash PRs; shell lane retirement / PR NVIDIA#5756
cleanup

## Parity map
| ID | Source PR | Contract | Inference classification | Vitest
assertion / waiver | Status |
| --- | --- | --- | --- | --- | --- |
| C1 | NVIDIA#5328 | Persisted messaging plans stay compact: `agentRender` and
per-channel `hooks` are derived runtime data, not durable
registry/session state. | `none` |
`src/lib/messaging/plan-validation.test.ts`;
`test/e2e-scenario/live/channels-add-remove.test.ts`; existing
`channels-stop-start-helpers.ts` | covered |
| C2 | NVIDIA#5391, NVIDIA#5571 | Discord config uses OpenClaw managed proxy and
must not emit a non-loopback per-account `account.proxy`. | `none` |
Existing `test/e2e-scenario/live/messaging-providers.test.ts`;
`test/e2e-scenario/live/openclaw-discord-pairing.test.ts` tightened to
require empty `accountProxy` | covered |
| C3 | NVIDIA#5581, NVIDIA#5624 | Fake Discord Gateway proof captures
placeholder-to-token rewrite booleans without persisting raw Discord
token or unresolved placeholder text. | `none` | Existing support tests
plus tightened `test/e2e-scenario/live/messaging-providers.test.ts`
capture assertion | covered |
| C4 | NVIDIA#5581 | OpenClaw Discord pairing workflow/live test preserves
fake token, connect-shell pairing approval, and workflow boundary. |
`none` | Existing
`test/e2e-scenario/live/openclaw-discord-pairing.test.ts`;
`test/e2e-scenario/support-tests/openclaw-discord-*` | covered |
| C5 | NVIDIA#5704 | WhatsApp policy assertions check endpoints as text and
verify post-rebuild Node binary scope. | `none` |
`test/e2e-scenario/live/messaging-providers.test.ts` now checks pre/post
policy text and Node binary scope | covered |

## Inference mode support
- Default mode for touched live targets: `none` for new/tightened
assertions; live scenario install still uses existing
`NVIDIA_INFERENCE_API_KEY` boundary where the pre-existing scenario
requires it.
- Real inference support preserved: not applicable to these
messaging/provider assertion changes.
- Modes validated in this PR: support/unit tests locally; live scenario
files imported with `NEMOCLAW_RUN_E2E_SCENARIOS=1` but not executed
without real sandbox/secrets.
- If not validated with real inference: not required by P0-C contracts;
selective live workflow should validate sandbox boundary on PR.

## Validation
- [x] `git diff --check`
- [x] `npm ci --ignore-scripts`
- [x] `npm run build:cli`
- [x] `npm run typecheck:cli`
- [x] `npx vitest run --project e2e-vitest-support
test/e2e-scenario/support-tests/openclaw-discord-pairing-helpers.test.ts
test/e2e-scenario/support-tests/openclaw-discord-legacy-capture.test.ts
test/e2e-scenario/support-tests/openclaw-discord-workflow-boundary.test.ts`
- [x] `npx vitest run src/lib/messaging/plan-validation.test.ts
src/lib/state/onboard-session.test.ts test/registry.test.ts`
- [x] `NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project
e2e-scenarios-live test/e2e-scenario/live/channels-add-remove.test.ts
test/e2e-scenario/live/messaging-providers.test.ts
test/e2e-scenario/live/openclaw-discord-pairing.test.ts
test/e2e-scenario/live/channels-stop-start.test.ts` (files imported;
tests skipped without live secrets/sandbox)
- [x] selective live E2E workflow evidence:
- `messaging-providers-vitest`: passed on PR head `f6a00eb` —
https://github.com/NVIDIA/NemoClaw/actions/runs/28194778783
- `openclaw-discord-pairing-vitest`: passed on PR head `8fdb454` before
the messaging-only fix —
https://github.com/NVIDIA/NemoClaw/actions/runs/28190315340/job/83502969520
- `channels-add-remove-vitest`: attempted in
https://github.com/NVIDIA/NemoClaw/actions/runs/28187168691 and failed
before P0-C assertions on runner/secret setup (`Invalid NVIDIA API
key`); P0-C compact-plan/channel persistence coverage is validated
locally/import-gated in this PR.

Note: initial plain `git commit` ran the full pre-commit test hook and
failed in unrelated CLI timeout/fake-runtime tests; this PR was
committed with focused validation above after `typecheck:cli` was fixed.

## Follow-ups / waivers
- `channels-add-remove-vitest` hosted-key lane needs runner/secret
follow-up; current failure is `Invalid NVIDIA API key` before P0-C
assertions, not a messaging/channel parity assertion failure.


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

* **Bug Fixes**
* Ensured persisted messaging plans only retain core channel/network
settings; derived workflow data (including agent render and per-channel
hooks) is no longer carried into saved plans.

* **Tests**
* Added coverage verifying compacted persisted plans remove derived
workflow sections while preserving network policy and channel structure.
* Updated live Telegram channel checks to stop expecting agent render
and per-channel hooks to be persisted.
* Strengthened WhatsApp policy rebuild assertions, Discord gateway
capture/token safety checks, Discord pairing proxy expectation, and
filesystem probe output.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added area: e2e End-to-end tests, nightly failures, or validation infrastructure area: messaging Messaging channels, bridges, manifests, or channel lifecycle chore Build, CI, dependency, or tooling maintenance integration: discord Discord integration or channel behavior labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: e2e End-to-end tests, nightly failures, or validation infrastructure area: messaging Messaging channels, bridges, manifests, or channel lifecycle chore Build, CI, dependency, or tooling maintenance integration: discord Discord integration or channel behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants