Skip to content

fix(messaging): restore channel policy on start - #6016

Merged
cv merged 3 commits into
mainfrom
codex/channels-start-policy
Jun 30, 2026
Merged

fix(messaging): restore channel policy on start#6016
cv merged 3 commits into
mainfrom
codex/channels-start-policy

Conversation

@cv

@cv cv commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

channels start re-enabled the persisted messaging plan without re-applying the channel's network-policy preset. Once rebuild began truthfully pruning disabled presets in #5856, the next rebuild no longer had stale registry state to restore, so a restarted channel could have correct agent config but inactive egress policy. Re-apply the preset at the channel action boundary and fail closed by restoring the disabled plan when policy application fails.

Related Issue

Contributes to #5919. Blocks the final channels-stop-start cutover proof in #5756; follow-up to #5856.

Changes

  • Re-apply the manifest-owned channel policy preset during channels start, before an immediate or queued rebuild.
  • Use action-correct recovery guidance for failed channels start policy application.
  • Roll the messaging plan back to disabled and skip rebuild when the preset cannot be applied.
  • Cover interactive ordering, the exact non-interactive queued-rebuild path, and failure rollback.

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 sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: restores the already-documented channels start contract; no command or configuration surface changes.
  • 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: pending independent messaging/policy review.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

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)
  • 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)

Verification details:

  • focused channel/rebuild suite: 68 passed
  • npm run typecheck:cli
  • make check
  • full non-live suite at the source-change head: 2,421 suites passed; 9,689 tests passed; 26 skipped; 0 failed; subsequent commits are test-only and pass focused suites plus normal hooks
  • normal signed commit and push hooks

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

Summary by CodeRabbit

  • Bug Fixes
    • Improved Teams channel start flow by reapplying the required policy preset before any rebuild is queued.
    • In non-interactive mode with Teams disabled, the preset is reapplied first; rebuilds are not queued and “Change queued” is logged.
    • If preset reapplication (or rollback) fails, the channel’s disabled state is restored, the process exits, and recovery guidance is shown (including “Could not restore 'teams' to disabled state” when applicable).
  • Tests
    • Added coverage for preset/rebuild call order and failure/rollback scenarios.
    • Added a “dry run” test to ensure no rebuild or preset actions occur and the expected message is logged.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv
cv requested review from laitingsheng and sandl99 June 29, 2026 23:31
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

applyChannelPresetIfAvailable now accepts an optional retry action for its guidance message. sandboxChannelsSetEnabled re-applies the preset when starting a channel, rolls back to disabled on failure, and exits. New tests cover call order, failure handling, and dry-run behavior.

Changes

Policy preset re-apply on channel start

Layer / File(s) Summary
applyChannelPresetIfAvailable signature and start-path rollback
src/lib/actions/sandbox/policy-channel.ts
Reorders imports; adds retryAction: "add" | "start" = "add" to applyChannelPresetIfAvailable, interpolating it into the preset restore guidance; adds preset re-apply in sandboxChannelsSetEnabled with disabled-plan rollback and process.exit(1) on failure.
Start-path preset re-apply tests
src/lib/actions/sandbox/policy-channel-conflict.test.ts
Extends the Teams start test with call-order assertions and adds cases for non-interactive preset re-apply, preset-failure rollback, and rollback-failure logging.
Dry-run start test
src/lib/actions/sandbox/policy-channel-remove-flow.test.ts
Adds a dry-run test for startSandboxChannel that logs the intended action and avoids preset, registry, rebuild, and exit side effects.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

bug-fix, area: cli, area: integrations

Suggested reviewers

  • jyaunches
  • cjagwani
🚥 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 clearly matches the main change: restoring channel policy when starting a messaging channel.
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.
✨ 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 codex/channels-start-policy

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

@github-code-quality

github-code-quality Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the codex/channels-start... 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 codex/channels-start... 2557e3e +/-
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 codex/channels-start... branch is 68%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main codex/channels-start... 2557e3e +/-
src/lib/actions...all/run-plan.ts 80%
src/lib/state/o...oard-session.ts 79%
src/lib/actions...dbox/rebuild.ts 74%
src/lib/state/sandbox.ts 72%
src/lib/shields/index.ts 70%
src/lib/onboard/preflight.ts 69%
src/lib/actions...licy-channel.ts 60%
src/lib/onboard...er-gpu-patch.ts 59%
src/lib/policy/index.ts 52%
src/lib/onboard.ts 20%

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

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: channels-stop-start-openclaw-e2e, channels-stop-start-hermes-e2e
Optional E2E: channels-add-remove-e2e, network-policy-e2e

Dispatch hint: channels-stop-start-openclaw-e2e,channels-stop-start-hermes-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • channels-stop-start-openclaw-e2e (high): Required because the runtime change is directly in nemoclaw <sandbox> channels start/stop. This E2E exercises OpenClaw channel stop/start, rebuild, provider reuse, registry state, policy-list, and in-sandbox config contracts across messaging channels.
  • channels-stop-start-hermes-e2e (high): Required because the changed policy-channel start path is shared by supported agents. This shard validates the same stop/start, rebuild, provider reuse, registry, and policy-list behavior for Hermes.

Optional E2E

  • channels-add-remove-e2e (high): Useful adjacent confidence because the PR changes applyChannelPresetIfAvailable, which is also used by channel add. The default add behavior should be unchanged, but this catches regressions in channel preset application, rebuild, and remove cleanup.
  • network-policy-e2e (high): Useful adjacent confidence for policy/security boundaries because the fix is specifically intended to keep enabled messaging channels aligned with required network policy egress after rebuild.

New E2E recommendations

  • Teams messaging lifecycle (medium): The changed unit tests cover Teams host-forward ordering, but the existing channel stop/start E2E channel list does not include Teams. Add a live or hermetic Teams stop/start scenario that verifies policy preset reapplication, non-interactive queued rebuild behavior, rollback on preset failure where feasible, and MSTEAMS_PORT host-forward restoration after rebuild.
    • Suggested test: Add a Teams variant to the channels stop/start E2E coverage or a dedicated teams-channel-start-e2e job.

Dispatch hint

  • Workflow: .github/workflows/nightly-e2e.yaml
  • jobs input: channels-stop-start-openclaw-e2e,channels-stop-start-hermes-e2e

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: channels-stop-start-vitest
Optional Vitest E2E scenarios: channels-add-remove-vitest

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=channels-stop-start-vitest

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • channels-stop-start-vitest: The PR changes channel start/stop policy-channel behavior, including reapplying a channel policy preset before queued/immediate rebuilds and rollback on preset failure. The free-standing channels stop/start Vitest job directly exercises live OpenClaw/Hermes messaging channel stop/start, rebuild, registry, policy-list, and in-sandbox config contracts.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=channels-stop-start-vitest

Optional Vitest E2E scenarios

  • channels-add-remove-vitest: Adjacent coverage for channel add/remove policy and rebuild flows. The main behavioral change targets start/stop, so this is optional unless reviewers want broader messaging channel lifecycle coverage.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=channels-add-remove-vitest

Relevant changed files

  • src/lib/actions/sandbox/policy-channel.ts

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Changes requested

Merge posture: Do not merge yet
Primary next action: Resolve or justify PRA-1: Source-of-truth review needed: `channels start` policy-apply rollback and rebuild queueing.
Open items: 0 required · 2 warnings · 1 suggestion · 8 test follow-ups
Since last review: 0 prior items resolved · 3 still apply · 0 new items found

Action checklist

  • PRA-1 Resolve or justify: Source-of-truth review needed: `channels start` policy-apply rollback and rebuild queueing
  • PRA-2 Resolve or justify: Add real-fixture validation for channel-start policy restoration in src/lib/actions/sandbox/policy-channel.ts:1435
  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
  • PRA-T3 Add or justify test follow-up: Runtime validation
  • PRA-T4 Add or justify test follow-up: Acceptance clause
  • PRA-T5 Add or justify test follow-up: Acceptance clause
  • PRA-T6 Add or justify test follow-up: Acceptance clause
  • PRA-T7 Add or justify test follow-up: Acceptance clause
  • PRA-T8 Add or justify test follow-up: `channels start` policy-apply rollback and rebuild queueing
  • PRA-3 In-scope improvement: Move Teams lifecycle coverage out of the conflict-test hotspot in src/lib/actions/sandbox/policy-channel-conflict.test.ts:1029

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify architecture Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
PRA-2 Resolve/justify security src/lib/actions/sandbox/policy-channel.ts:1435 Add or identify targeted runtime/integration validation for `channels start` using a real temporary registry and policy fixture. The test should prove that enabling a disabled manifest channel applies and persists the channel preset and refreshed policy context before the queued rebuild notice, and that policy-apply failure leaves the channel disabled and skips rebuild. Also document whether `refreshSandboxPolicyContextFile()` failure is intentionally best-effort for this security boundary or should fail closed.
PRA-3 Improvement architecture src/lib/actions/sandbox/policy-channel-conflict.test.ts:1029 Move the `Teams host-forward lifecycle (PRA-2)` describe block and only the Teams-specific fixture helpers it needs into a focused file such as `policy-channel-teams-lifecycle.test.ts`, preserving the existing public-action tests and mocked module boundaries.
Review findings by urgency: 0 required fixes, 2 items to resolve/justify, 1 in-scope improvement

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

PRA-1 Resolve/justify — Source-of-truth review needed: `channels start` policy-apply rollback and rebuild queueing

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: Mocked tests prove ordering, rollback success, rollback failure guidance, and start dry-run side effects. A real temporary registry/policy-context regression test is still needed to prove the source boundary cannot regress in practice.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: `src/lib/actions/sandbox/policy-channel.ts:1428-1452` implements the local guard and rollback. `src/lib/actions/sandbox/policy-channel-conflict.test.ts:1062-1134` covers mocked ordering and rollback branches; `policy-channel-remove-flow.test.ts:71-94` covers dry-run side effects.

PRA-2 Resolve/justify — Add real-fixture validation for channel-start policy restoration

  • Location: src/lib/actions/sandbox/policy-channel.ts:1435
  • Category: security
  • Problem: `channels start` now relies on the real policy preset application, registry persistence, session preset sync, policy-context refresh, and queued/immediate rebuild boundary being ordered correctly. The added tests are useful unit coverage, but they mock `policies.applyPreset`, registry update/state, rebuild, and host-forward seams, so they do not prove the durable source boundary that prevents an enabled channel from later rebuilding without its required egress policy.
  • Impact: A mismatch between the mocked unit boundary and the real policy/registry/context behavior could still queue or later run a rebuild with the channel enabled in the agent config but missing its required channel egress policy, recreating the policy-bypass drift this PR is intended to prevent.
  • Recommended action: Add or identify targeted runtime/integration validation for `channels start` using a real temporary registry and policy fixture. The test should prove that enabling a disabled manifest channel applies and persists the channel preset and refreshed policy context before the queued rebuild notice, and that policy-apply failure leaves the channel disabled and skips rebuild. Also document whether `refreshSandboxPolicyContextFile()` failure is intentionally best-effort for this security boundary or should fail closed.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Read `src/lib/actions/sandbox/policy-channel.ts:1428-1452`, then inspect `src/lib/actions/sandbox/policy-channel-conflict.test.ts:1062-1134` and `src/lib/actions/sandbox/policy-channel-remove-flow.test.ts:71-94`; the current evidence asserts ordering and rollback through mocked `applyPreset`, registry, and rebuild seams rather than real registry/policy-context persistence.
  • Missing regression test: Add behavior tests such as: non-interactive `channels start teams` with a disabled Teams plan and a real temp registry/policy-context fixture persists the `teams` preset and refreshed policy context before printing `Change queued`; and `channels start teams` with a real fixture where preset application fails leaves `teams` in `disabledChannels`, does not queue or run rebuild, and prints `channels start teams` recovery guidance.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Read `src/lib/actions/sandbox/policy-channel.ts:1428-1452`, then inspect `src/lib/actions/sandbox/policy-channel-conflict.test.ts:1062-1134` and `src/lib/actions/sandbox/policy-channel-remove-flow.test.ts:71-94`; the current evidence asserts ordering and rollback through mocked `applyPreset`, registry, and rebuild seams rather than real registry/policy-context persistence.
  • Evidence: `sandboxChannelsSetEnabled()` persists the enabled plan, calls `applyChannelPresetIfAvailable(sandboxName, normalized, "start")`, then queues/runs rebuild. Current tests cover `applyPresetMock` before rebuild, non-interactive queueing, rollback, rollback-failure guidance, and dry-run side effects, but they do not exercise real policy preset persistence or policy-context refresh.

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

PRA-3 Improvement — Move Teams lifecycle coverage out of the conflict-test hotspot

  • Location: src/lib/actions/sandbox/policy-channel-conflict.test.ts:1029
  • Category: architecture
  • Problem: The PR keeps adding Teams host-forward and start-policy lifecycle tests to `policy-channel-conflict.test.ts`, which is already a large cross-sandbox credential-conflict test file. These scenarios validate lifecycle/start-policy behavior rather than the surrounding credential-conflict behavior.
  • Impact: Continuing to grow this mixed-purpose hotspot makes future messaging policy lifecycle regressions harder to localize and increases the chance that unrelated conflict fixture changes affect Teams lifecycle coverage.
  • Suggested action: Move the `Teams host-forward lifecycle (PRA-2)` describe block and only the Teams-specific fixture helpers it needs into a focused file such as `policy-channel-teams-lifecycle.test.ts`, preserving the existing public-action tests and mocked module boundaries.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Read `src/lib/actions/sandbox/policy-channel-conflict.test.ts:1029-1148`; the block exercises Teams add/start lifecycle ordering, non-interactive queued rebuild, policy rollback, and rollback-failure guidance rather than cross-sandbox credential conflict detection.
  • Missing regression test: No additional behavior test is needed if the scenarios are moved unchanged and still assert policy apply before rebuild, non-interactive queued rebuild, policy failure rollback, rollback-failure recovery guidance, and host-forward-after-rebuild ordering.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Drift and validation signals report `src/lib/actions/sandbox/policy-channel-conflict.test.ts` at about 1149 lines after this change, with this PR adding more lifecycle coverage to the conflict-focused hotspot. This was also raised in the prior advisor review and still applies.
Simplification opportunities: 1 possible cut

These are safe simplification checks only. Do not remove validation, security controls, data-loss prevention, or required tests.

  • PRA-3 shrink (src/lib/actions/sandbox/policy-channel-conflict.test.ts:1029): The Teams lifecycle describe block and minimal Teams fixture helpers from `policy-channel-conflict.test.ts`.
    • Replacement: A focused Teams lifecycle/start-policy test file that imports the same public actions and reuses only the fixture surface needed for these Teams scenarios.
    • Safety boundary: Do not remove the security-relevant assertions for policy apply before rebuild, non-interactive queued rebuild, rollback on policy apply failure, rollback-failure recovery guidance, or host-forward-after-rebuild ordering; only relocate or narrow the fixture surface.
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Non-interactive `channels start teams` with a disabled Teams plan and a real temp registry/policy-context fixture persists the `teams` preset and refreshed policy context before printing `Change queued`.. `src/lib/actions/sandbox/policy-channel.ts` is a runtime sandbox/messaging policy lifecycle path. The changed unit tests cover the new branches well, but the security-relevant assurance depends on real registry persistence, policy preset application, policy-context refresh, and rebuild queueing behavior.
  • PRA-T2 Runtime validation — `channels start teams` with a real registry fixture and a failing or missing policy preset leaves `teams` in `disabledChannels`, does not queue or run rebuild, and prints `channels start teams` recovery guidance.. `src/lib/actions/sandbox/policy-channel.ts` is a runtime sandbox/messaging policy lifecycle path. The changed unit tests cover the new branches well, but the security-relevant assurance depends on real registry persistence, policy preset application, policy-context refresh, and rebuild queueing behavior.
  • PRA-T3 Runtime validation — If `refreshSandboxPolicyContextFile()` fails after `policies.applyPreset()` succeeds, assert the intended behavior explicitly: either fail closed and keep the channel disabled, or document and test that the preset registry state alone is sufficient before queueing rebuild.. `src/lib/actions/sandbox/policy-channel.ts` is a runtime sandbox/messaging policy lifecycle path. The changed unit tests cover the new branches well, but the security-relevant assurance depends on real registry persistence, policy preset application, policy-context refresh, and rebuild queueing behavior.
  • PRA-T4 Acceptance clause — Re-apply the manifest-owned channel policy preset during `channels start`, before an immediate or queued rebuild. — add test evidence or identify existing coverage. `sandboxChannelsSetEnabled()` calls `applyChannelPresetIfAvailable(sandboxName, normalized, "start")` before `promptAndRebuild()`, and unit tests assert mocked `applyPreset` before immediate rebuild plus non-interactive `Change queued`. Runtime durability of real preset/context state before queued rebuild remains unproven.
  • PRA-T5 Acceptance clause — Roll the messaging plan back to disabled and skip rebuild when the preset cannot be applied. — add test evidence or identify existing coverage. The changed start path calls `persistManifestChannelDisabledPlan(..., true)` and exits before rebuild when `applyChannelPresetIfAvailable()` fails; mocked tests verify disabled state and no rebuild. A real registry/policy fixture failure case is still missing.
  • PRA-T6 Acceptance clause — Cover interactive ordering, the exact non-interactive queued-rebuild path, and failure rollback. — add test evidence or identify existing coverage. Added tests cover mocked immediate ordering, non-interactive queueing, rollback success, rollback failure, and start dry-run side effects. They do not cover the real policy/registry/context source boundary.
  • PRA-T7 Acceptance clause — Contributes to Complete the Vitest E2E cutover with job-variant parity evidence #5919. Blocks the final `channels-stop-start` cutover proof in test(e2e): retire legacy shell lanes #5756; follow-up to fix(rebuild): clear stale policy presets from registry after rebuild #5856. — add test evidence or identify existing coverage. Deterministic validation context reported no linked issues and provided no issue clauses or comments to map. The PR body references these issues, but issue acceptance text was not available in the review context.
  • PRA-T8 `channels start` policy-apply rollback and rebuild queueing — Mocked tests prove ordering, rollback success, rollback failure guidance, and start dry-run side effects. A real temporary registry/policy-context regression test is still needed to prove the source boundary cannot regress in practice.. `src/lib/actions/sandbox/policy-channel.ts:1428-1452` implements the local guard and rollback. `src/lib/actions/sandbox/policy-channel-conflict.test.ts:1062-1134` covers mocked ordering and rollback branches; `policy-channel-remove-flow.test.ts:71-94` covers dry-run side effects.
Since last review details

Current findings, using the urgency labels above:

PRA-1 Resolve/justify — Source-of-truth review needed: `channels start` policy-apply rollback and rebuild queueing

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: Mocked tests prove ordering, rollback success, rollback failure guidance, and start dry-run side effects. A real temporary registry/policy-context regression test is still needed to prove the source boundary cannot regress in practice.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: `src/lib/actions/sandbox/policy-channel.ts:1428-1452` implements the local guard and rollback. `src/lib/actions/sandbox/policy-channel-conflict.test.ts:1062-1134` covers mocked ordering and rollback branches; `policy-channel-remove-flow.test.ts:71-94` covers dry-run side effects.

PRA-2 Resolve/justify — Add real-fixture validation for channel-start policy restoration

  • Location: src/lib/actions/sandbox/policy-channel.ts:1435
  • Category: security
  • Problem: `channels start` now relies on the real policy preset application, registry persistence, session preset sync, policy-context refresh, and queued/immediate rebuild boundary being ordered correctly. The added tests are useful unit coverage, but they mock `policies.applyPreset`, registry update/state, rebuild, and host-forward seams, so they do not prove the durable source boundary that prevents an enabled channel from later rebuilding without its required egress policy.
  • Impact: A mismatch between the mocked unit boundary and the real policy/registry/context behavior could still queue or later run a rebuild with the channel enabled in the agent config but missing its required channel egress policy, recreating the policy-bypass drift this PR is intended to prevent.
  • Recommended action: Add or identify targeted runtime/integration validation for `channels start` using a real temporary registry and policy fixture. The test should prove that enabling a disabled manifest channel applies and persists the channel preset and refreshed policy context before the queued rebuild notice, and that policy-apply failure leaves the channel disabled and skips rebuild. Also document whether `refreshSandboxPolicyContextFile()` failure is intentionally best-effort for this security boundary or should fail closed.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Read `src/lib/actions/sandbox/policy-channel.ts:1428-1452`, then inspect `src/lib/actions/sandbox/policy-channel-conflict.test.ts:1062-1134` and `src/lib/actions/sandbox/policy-channel-remove-flow.test.ts:71-94`; the current evidence asserts ordering and rollback through mocked `applyPreset`, registry, and rebuild seams rather than real registry/policy-context persistence.
  • Missing regression test: Add behavior tests such as: non-interactive `channels start teams` with a disabled Teams plan and a real temp registry/policy-context fixture persists the `teams` preset and refreshed policy context before printing `Change queued`; and `channels start teams` with a real fixture where preset application fails leaves `teams` in `disabledChannels`, does not queue or run rebuild, and prints `channels start teams` recovery guidance.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Read `src/lib/actions/sandbox/policy-channel.ts:1428-1452`, then inspect `src/lib/actions/sandbox/policy-channel-conflict.test.ts:1062-1134` and `src/lib/actions/sandbox/policy-channel-remove-flow.test.ts:71-94`; the current evidence asserts ordering and rollback through mocked `applyPreset`, registry, and rebuild seams rather than real registry/policy-context persistence.
  • Evidence: `sandboxChannelsSetEnabled()` persists the enabled plan, calls `applyChannelPresetIfAvailable(sandboxName, normalized, "start")`, then queues/runs rebuild. Current tests cover `applyPresetMock` before rebuild, non-interactive queueing, rollback, rollback-failure guidance, and dry-run side effects, but they do not exercise real policy preset persistence or policy-context refresh.

PRA-3 Improvement — Move Teams lifecycle coverage out of the conflict-test hotspot

  • Location: src/lib/actions/sandbox/policy-channel-conflict.test.ts:1029
  • Category: architecture
  • Problem: The PR keeps adding Teams host-forward and start-policy lifecycle tests to `policy-channel-conflict.test.ts`, which is already a large cross-sandbox credential-conflict test file. These scenarios validate lifecycle/start-policy behavior rather than the surrounding credential-conflict behavior.
  • Impact: Continuing to grow this mixed-purpose hotspot makes future messaging policy lifecycle regressions harder to localize and increases the chance that unrelated conflict fixture changes affect Teams lifecycle coverage.
  • Suggested action: Move the `Teams host-forward lifecycle (PRA-2)` describe block and only the Teams-specific fixture helpers it needs into a focused file such as `policy-channel-teams-lifecycle.test.ts`, preserving the existing public-action tests and mocked module boundaries.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Read `src/lib/actions/sandbox/policy-channel-conflict.test.ts:1029-1148`; the block exercises Teams add/start lifecycle ordering, non-interactive queued rebuild, policy rollback, and rollback-failure guidance rather than cross-sandbox credential conflict detection.
  • Missing regression test: No additional behavior test is needed if the scenarios are moved unchanged and still assert policy apply before rebuild, non-interactive queued rebuild, policy failure rollback, rollback-failure recovery guidance, and host-forward-after-rebuild ordering.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Drift and validation signals report `src/lib/actions/sandbox/policy-channel-conflict.test.ts` at about 1149 lines after this change, with this PR adding more lifecycle coverage to the conflict-focused hotspot. This was also raised in the prior advisor review and still applies.

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.

🧹 Nitpick comments (1)
src/lib/actions/sandbox/policy-channel-conflict.test.ts (1)

1109-1115: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the rollback via observable state, not updateSandboxMock internals.

These expectations lock the test to the current state-adapter call sequence instead of the public outcome. Prefer asserting that startSandboxChannel() leaves teams disabled after the failure, and keep the rebuild-skipped assertion as the behavioral proof. As per path instructions, "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call 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 `@src/lib/actions/sandbox/policy-channel-conflict.test.ts` around lines 1109 -
1115, The test for startSandboxChannel() is asserting rollback through
updateSandboxMock call internals, which ties it to implementation details
instead of behavior. Replace those mock-call shape checks with assertions on
observable state after the failure, specifically that teams remains disabled in
the sandbox state while keeping the rebuild-skipped assertion. Use
startSandboxChannel() and the surrounding sandbox state helpers as the primary
references, and verify the public outcome rather than the adapter call sequence.

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.

Nitpick comments:
In `@src/lib/actions/sandbox/policy-channel-conflict.test.ts`:
- Around line 1109-1115: The test for startSandboxChannel() is asserting
rollback through updateSandboxMock call internals, which ties it to
implementation details instead of behavior. Replace those mock-call shape checks
with assertions on observable state after the failure, specifically that teams
remains disabled in the sandbox state while keeping the rebuild-skipped
assertion. Use startSandboxChannel() and the surrounding sandbox state helpers
as the primary references, and verify the public outcome rather than the adapter
call sequence.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 92a1c2bf-e3ab-49d6-ac85-7204a5d94f2e

📥 Commits

Reviewing files that changed from the base of the PR and between 8b26117 and e5cc3c2.

📒 Files selected for processing (2)
  • src/lib/actions/sandbox/policy-channel-conflict.test.ts
  • src/lib/actions/sandbox/policy-channel.ts

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — Informational

Merge posture: Informational / low confidence
Primary next action: Resolve or justify PRA-1: PR review advisor unavailable.
Open items: 0 required · 1 warning · 0 suggestions · 1 test follow-up
Top item: PR review advisor unavailable

Action checklist

  • PRA-1 Resolve or justify: PR review advisor unavailable
  • PRA-T1 Add or justify test follow-up: Runtime validation

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify correctness Re-run the PR Review Advisor or perform a manual review.
Review findings by urgency: 0 required fixes, 1 item to resolve/justify, 0 in-scope improvements

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

PRA-1 Resolve/justify — PR review advisor unavailable

  • Location: not file-specific
  • Category: correctness
  • Problem: The automated advisor could not complete: timed out after 900000 ms
  • Impact: Automated review evidence is incomplete, so human review must cover the changed code manually.
  • Recommended action: Re-run the PR Review Advisor or perform a manual review.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the workflow logs and raw advisor artifact for the execution failure.
  • Missing regression test: No regression test recommendation is available because the advisor did not complete.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the workflow logs and raw advisor artifact for the execution failure.
  • Evidence: timed out after 900000 ms

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

  • None.
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Add or identify targeted runtime/integration validation for the changed behavior; do not report external E2E job pass/fail here.. Runtime/sandbox/infrastructure paths need behavioral runtime validation: src/lib/actions/sandbox/policy-channel.ts.

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.

@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ⚠️ Run cancelled — no signal

Run: 28409616101
Workflow ref: codex/channels-start-policy
Requested scenarios: (default — all supported)
Requested jobs: channels-stop-start-vitest
Summary: 0 passed, 0 failed, 1 cancelled, 0 skipped

Job Result
channels-stop-start-vitest ⚠️ cancelled

cv added 2 commits June 29, 2026 16:37
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ⚠️ Run cancelled — no signal

Run: 28409936769
Workflow ref: codex/channels-start-policy
Requested scenarios: (default — all supported)
Requested jobs: channels-stop-start-vitest
Summary: 0 passed, 0 failed, 1 cancelled, 0 skipped

Job Result
channels-stop-start-vitest ⚠️ cancelled

@cv

cv commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

Automated review disposition — head 2557e3e9e

Addressed:

  • CodeRabbit observable-state nit: commit c503e8d97 replaces updateSandboxMock payload-shape assertions with a stateful registry seam and verifies the public disabled-channel outcome (policy-channel-conflict.test.ts:1099-1118).
  • GPT PRA-T2: the same commit covers the double failure where policy application and disabled-plan rollback both fail, including rebuild suppression and actionable channels stop recovery guidance (:1121-1133).
  • Nemotron PRA-4 / PRA-T2: commit 2557e3e9e adds a focused start --dry-run boundary test proving no preset, registry, or rebuild mutation (policy-channel-remove-flow.test.ts:71-94).

Already covered:

  • Nemotron PRA-3 / PRA-T1 is factually covered at policy-channel-conflict.test.ts:1062-1079: the interactive public startSandboxChannel action asserts applyPreset runs before rebuildSandbox, and host-forward restoration runs after rebuild. A second channel-generic test would exercise the identical shared branch with weaker assertions.
  • GPT PRA-1 / PRA-T1 / PRA-T3 asks for runtime validation. The exact real-system validation is the two-agent channels-stop-start-vitest dispatch 28410075670, not a second temporary fixture that mocks OpenShell policy mutation. It exercises non-interactive start, real policy persistence/context, rebuild, provider reuse, sandbox config, and final policy-list for OpenClaw and Hermes. This PR remains blocked until that run passes and its artifacts are inspected.

Source-of-truth review requested by GPT PRA-1:

  • Invalid state: an enabled manifest channel with rebuilt agent config but no matching gateway/registry policy preset after fix(rebuild): clear stale policy presets from registry after rebuild #5856 truthfully pruned the stopped preset.
  • Source boundary: the persisted manifest plan owns whether the configured channel is enabled; policies.applyPreset owns enforcement plus durable registry.policies; sandboxChannelsSetEnabled is the public transition that must reconcile them before rebuild can consume the state.
  • Source-fix constraint: do not restore stale registry policies or teach rebuild to guess removed intent. Start persists the enabled plan, applies its manifest-named preset, and restores the disabled plan if enforcement cannot be applied.
  • Regression evidence: public-action unit tests cover immediate ordering, queued ordering, rollback success, rollback failure, and dry run; the exact OpenClaw/Hermes live journey validates the real gateway/rebuild boundary.
  • Removal condition: remove this action-level reconciliation only if the messaging host-state applier becomes an atomic plan-plus-policy reconciler, or rebuild explicitly derives and applies all enabled manifest policy presets from the plan.

refreshSandboxPolicyContextFile() is intentionally best-effort. It writes an explanatory in-sandbox mirror and separately classifies/warns on unreachable, failed, and crashed outcomes; it is not the egress enforcement or durable source of truth. Rolling back a successfully applied gateway policy because its explanatory mirror is temporarily unreachable would make the real state less correct, not more secure. Its outcome contract has dedicated tests in policy-context-refresh.test.ts and its invocation-after-policy contract in policy-channel-refresh.test.ts.

Declined with rationale:

  • GPT PRA-2 and Nemotron PRA-1: splitting the lifecycle block out solely to satisfy an invented file-line threshold would require duplicating the large shared public-action/messaging planner mock harness. That increases total boilerplate and test coupling while changing no behavior. The repository's actual codebase-growth-guardrails check passes. The cheap dry-run boundary was placed in the existing 95-line enable/remove flow test instead.
  • Nemotron PRA-2: extracting the 19-line transactional fix from policy-channel.ts into a new module in this bug-fix PR would increase indirection across planner, policy, session, rebuild, and host-forward boundaries. The advisor itself calls the surgical fix acceptable. A “1-line warning threshold” is not a meaningful architecture rule, and no speculative follow-up issue is warranted without a cohesive extraction design.
  • Fresh-head CodeRabbit dry-run nit is declined: applyPreset, registry.updateSandbox, and rebuildSandbox are the external policy, durable-state, and destructive-runtime effect boundaries. Their non-invocation plus the public dry-run output is precisely the observable no-mutation contract; removing those assertions would weaken the test to checking prose only.
  • Fresh-head Nemotron timed out after its full 15-minute budget and returned no code finding. I performed the source-boundary/manual review above; GPT and CodeRabbit completed; independent human review is already requested from @laitingsheng and @sandl99. Re-running the same unavailable model is not useful evidence.

Focused verification is 68/68; CLI typecheck, repository checks, signed hooks, and the full non-live suite at the source-change head pass. Both post-review commits are test-only and GitHub Verified.

@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.

🧹 Nitpick comments (1)
src/lib/actions/sandbox/policy-channel-remove-flow.test.ts (1)

78-92: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the dry-run outcome, not helper silence.

The log assertion is a good public-boundary check, but the not.toHaveBeenCalled() assertions on applyPreset, updateSandbox, and rebuildSandbox tie this test to the current implementation. Prefer proving the dry-run contract via observable state/output from startSandboxChannel and keep collaborator-level assertions only where they guard an actual external effect boundary. As per path instructions, "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call 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 `@src/lib/actions/sandbox/policy-channel-remove-flow.test.ts` around lines 78 -
92, The dry-run test for startSandboxChannel should assert the public outcome
instead of internal collaborator call silence. Keep the log/output check for the
dry-run message, and remove or replace the applyPreset, updateSandbox, and
rebuildSandbox not-to-have-been-called expectations with assertions on
observable state or returned behavior that prove no changes were applied. Use
startSandboxChannel, policyChannel, and the dryRun path as the primary symbols
to locate the test.

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.

Nitpick comments:
In `@src/lib/actions/sandbox/policy-channel-remove-flow.test.ts`:
- Around line 78-92: The dry-run test for startSandboxChannel should assert the
public outcome instead of internal collaborator call silence. Keep the
log/output check for the dry-run message, and remove or replace the applyPreset,
updateSandbox, and rebuildSandbox not-to-have-been-called expectations with
assertions on observable state or returned behavior that prove no changes were
applied. Use startSandboxChannel, policyChannel, and the dryRun path as the
primary symbols to locate the test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e26f6d19-b500-4761-bb5d-8b55f5c637fc

📥 Commits

Reviewing files that changed from the base of the PR and between c503e8d and 2557e3e.

📒 Files selected for processing (1)
  • src/lib/actions/sandbox/policy-channel-remove-flow.test.ts

@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Results — ✅ All requested jobs passed

Run: 28410075670
Workflow ref: codex/channels-start-policy
Requested scenarios: (default — all supported)
Requested jobs: channels-stop-start-vitest
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
channels-stop-start-vitest ✅ success

@cv

cv commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

Exact live E2E evidence — head 2557e3e9e

The exact real-system channels-stop-start-vitest dispatch 28410075670 passed for both supported agents:

  • OpenClaw job 84181018509: success in 29m40s.
  • Hermes job 84181018503: success in 19m24s.

Downloaded artifact audit (177 files per agent, 354 total):

  • scenario.json identifies the intended install.sh messaging onboard + channels stop/start CLI + rebuild + sandbox config probes boundary and its legacy source.
  • All channel starts passed (5/5 per agent). Each emitted Applied preset: <channel> before queueing its rebuild.
  • The single post-start rebuild passed for each agent and explicitly restored telegram, discord, wechat, slack, and whatsapp alongside the agent baseline presets.
  • All final policy snapshots passed (5/5 per agent), and every snapshot listed all five channel presets active.
  • All post-rebuild config probes passed (5/5 per agent).
  • All provider probes passed both after stop and after start (5/5 in each phase per agent), demonstrating credential/provider reuse across the transition.
  • cleanup.json reports one successful sandbox destruction and zero failures for each agent. Non-zero result files are the deliberate pre-clean, provider-absence, and cleanup-fallback probes; no asserted journey step failed.
  • A conservative artifact scan found no NVIDIA-key, GitHub-token, private-key, or Slack-token-shaped value. The Hermes artifact containing a redaction marker preserves the intended redacted API-key behavior.

The ordinary PR checks are also green (45 successful checks, with only intentional skips), including CodeQL/GHAS, the growth guard, full test shards, typecheck/build, and both review advisors. This closes the runtime-validation item from the automated review disposition. The remaining merge gate is independent human approval.

@cv
cv merged commit 59c8680 into main Jun 30, 2026
124 checks passed
@cv
cv deleted the codex/channels-start-policy branch June 30, 2026 00:23
@cv cv mentioned this pull request Jun 30, 2026
21 tasks
@miyoungc miyoungc mentioned this pull request Jun 30, 2026
21 tasks
jyaunches pushed a commit that referenced this pull request Jun 30, 2026
## Summary
Refreshes the v0.0.70 release docs from the release announcement and the
`v0.0.69..v0.0.70` commit range.
It also documents the `channels start` policy restoration behavior that
was missing from the shared OpenClaw and Hermes command references, and
bumps the Fern CLI version used for docs validation.

## Changes
- Replaced the stale `v0.0.70` release-notes entry with the actual
release themes, including CLI, onboarding, inference, messaging,
Windows, documentation, and release-validation changes.
- Documented that `channels start` reapplies the matching built-in
network policy preset before rebuild and rolls back to disabled if
policy restoration fails.
- Bumped `fern/fern.config.json` from `5.55.0` to `5.59.0` for the docs
refresh.
- Source summary:
- #5754 -> `docs/about/release-notes.mdx`: Notes Docker Desktop gateway
bridge retry behavior during onboarding.
- #5930 -> `docs/about/release-notes.mdx`: Links `nemoclaw use` default
sandbox selection to the command reference.
- #5948 -> `docs/about/release-notes.mdx`: Links reasoning-compatible
endpoint validation to inference documentation.
- #5950 -> `docs/about/release-notes.mdx`: Links Windows bootstrap WSL
recovery behavior to Windows preparation and troubleshooting docs.
- #5856 -> `docs/about/release-notes.mdx`: Notes rebuilt policy preset
registry repair.
- #5882 and #5949 -> `docs/about/release-notes.mdx`: Notes Hermes stale
base-image state repair.
- #6016 -> `docs/reference/commands.mdx`,
`docs/reference/commands-nemohermes.mdx`, and
`docs/manage-sandboxes/messaging-channels.mdx`: Documents channel policy
restoration and rollback on `channels start`.
- #5859 -> `docs/about/release-notes.mdx`: Links quickstart network
approval guidance.
- #5863 -> `docs/about/release-notes.mdx`: Links Teams allowlist
guidance in the messaging page.
- #5756, #5926, #6010, and #6011 -> `docs/about/release-notes.mdx`:
Summarizes the Vitest E2E validation cutover.

## 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
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: doc-only prose refresh with
no runtime behavior change.
- [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:

## Verification
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] 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)
- [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)
- [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)

`npm run docs` exited 0 and Fern reported one existing light-mode accent
contrast warning.
`fern check --warnings` confirmed the warning is the site theme contrast
ratio, not content introduced by this PR.

---
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary

`channels start` re-enabled the persisted messaging plan without
re-applying the channel's network-policy preset. Once rebuild began
truthfully pruning disabled presets in NVIDIA#5856, the next rebuild no longer
had stale registry state to restore, so a restarted channel could have
correct agent config but inactive egress policy. Re-apply the preset at
the channel action boundary and fail closed by restoring the disabled
plan when policy application fails.

## Related Issue

Contributes to NVIDIA#5919. Blocks the final `channels-stop-start` cutover
proof in NVIDIA#5756; follow-up to NVIDIA#5856.

## Changes

- Re-apply the manifest-owned channel policy preset during `channels
start`, before an immediate or queued rebuild.
- Use action-correct recovery guidance for failed `channels start`
policy application.
- Roll the messaging plan back to disabled and skip rebuild when the
preset cannot be applied.
- Cover interactive ordering, the exact non-interactive queued-rebuild
path, and failure rollback.

## Type of Change

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

## Quality Gates

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: restores the
already-documented `channels start` contract; no command or
configuration surface changes.
- [x] 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: pending independent
messaging/policy review.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [x] Targeted tests pass for changed behavior
- [x] Full `npm test` passes (broad runtime changes only)
- [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)

Verification details:

- focused channel/rebuild suite: 68 passed
- `npm run typecheck:cli`
- `make check`
- full non-live suite at the source-change head: 2,421 suites passed;
9,689 tests passed; 26 skipped; 0 failed; subsequent commits are
test-only and pass focused suites plus normal hooks
- normal signed commit and push hooks

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


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

## Summary by CodeRabbit

* **Bug Fixes**
* Improved Teams channel start flow by reapplying the required policy
preset before any rebuild is queued.
* In non-interactive mode with Teams disabled, the preset is reapplied
first; rebuilds are not queued and “Change queued” is logged.
* If preset reapplication (or rollback) fails, the channel’s disabled
state is restored, the process exits, and recovery guidance is shown
(including “Could not restore 'teams' to disabled state” when
applicable).
* **Tests**
* Added coverage for preset/rebuild call order and failure/rollback
scenarios.
* Added a “dry run” test to ensure no rebuild or preset actions occur
and the expected message is logged.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary
Refreshes the v0.0.70 release docs from the release announcement and the
`v0.0.69..v0.0.70` commit range.
It also documents the `channels start` policy restoration behavior that
was missing from the shared OpenClaw and Hermes command references, and
bumps the Fern CLI version used for docs validation.

## Changes
- Replaced the stale `v0.0.70` release-notes entry with the actual
release themes, including CLI, onboarding, inference, messaging,
Windows, documentation, and release-validation changes.
- Documented that `channels start` reapplies the matching built-in
network policy preset before rebuild and rolls back to disabled if
policy restoration fails.
- Bumped `fern/fern.config.json` from `5.55.0` to `5.59.0` for the docs
refresh.
- Source summary:
- NVIDIA#5754 -> `docs/about/release-notes.mdx`: Notes Docker Desktop gateway
bridge retry behavior during onboarding.
- NVIDIA#5930 -> `docs/about/release-notes.mdx`: Links `nemoclaw use` default
sandbox selection to the command reference.
- NVIDIA#5948 -> `docs/about/release-notes.mdx`: Links reasoning-compatible
endpoint validation to inference documentation.
- NVIDIA#5950 -> `docs/about/release-notes.mdx`: Links Windows bootstrap WSL
recovery behavior to Windows preparation and troubleshooting docs.
- NVIDIA#5856 -> `docs/about/release-notes.mdx`: Notes rebuilt policy preset
registry repair.
- NVIDIA#5882 and NVIDIA#5949 -> `docs/about/release-notes.mdx`: Notes Hermes stale
base-image state repair.
- NVIDIA#6016 -> `docs/reference/commands.mdx`,
`docs/reference/commands-nemohermes.mdx`, and
`docs/manage-sandboxes/messaging-channels.mdx`: Documents channel policy
restoration and rollback on `channels start`.
- NVIDIA#5859 -> `docs/about/release-notes.mdx`: Links quickstart network
approval guidance.
- NVIDIA#5863 -> `docs/about/release-notes.mdx`: Links Teams allowlist
guidance in the messaging page.
- NVIDIA#5756, NVIDIA#5926, NVIDIA#6010, and NVIDIA#6011 -> `docs/about/release-notes.mdx`:
Summarizes the Vitest E2E validation cutover.

## 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
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: doc-only prose refresh with
no runtime behavior change.
- [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:

## Verification
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] 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)
- [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)
- [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)

`npm run docs` exited 0 and Fern reported one existing light-mode accent
contrast warning.
`fern check --warnings` confirmed the warning is the site theme contrast
ratio, not content introduced by this PR.

---
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
@wscurran wscurran added the area: messaging Messaging channels, bridges, manifests, or channel lifecycle label Aug 1, 2026
@wscurran wscurran added area: policy Network policy, egress rules, presets, or sandbox policy bug-fix PR fixes a bug or regression labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: messaging Messaging channels, bridges, manifests, or channel lifecycle area: policy Network policy, egress rules, presets, or sandbox policy bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants