Skip to content

fix(onboard): exclude inactive OpenClaw messaging presets - #10359

Closed
HOYALIM wants to merge 3 commits into
NVIDIA:mainfrom
HOYALIM:codex/10153-openclaw-active-messaging-policy
Closed

fix(onboard): exclude inactive OpenClaw messaging presets#10359
HOYALIM wants to merge 3 commits into
NVIDIA:mainfrom
HOYALIM:codex/10153-openclaw-active-messaging-policy

Conversation

@HOYALIM

@HOYALIM HOYALIM commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Outcome

OpenClaw no longer carries a repository messaging preset for a channel the sandbox does not configure. The onboard suggestion path, a recorded or resumed selection, and nemoclaw sandbox rebuild now follow one rule instead of leaving OpenClaw out of it.

Reason

#10314 gated the Discord suggestion for every agent, and #10281 added the shared inactive-preset guard but scoped it to Hermes. OpenClaw ships the same channel policies and reaches the same selection paths, so it kept applying a preset whose policy names a sandbox-scoped credential provider that create-plan validation then rejects.

This PR was opened against root-cause group 5 of #10153. That symptom is already resolved on main: a baseline run of the six OpenClaw targets on main at 4c5840777, which contains #10314 and #10281, passed all six. The scope here is the remaining OpenClaw half of the guard, not that root cause.

Related issues

Refs #10153

Changes

  • src/lib/onboard/messaging-policy-presets.ts: rename pruneInactiveHermesMessagingPolicyPresets to pruneInactiveMessagingPolicyPresets and resolve its agent set from supportedAgents in the channel manifests instead of naming Hermes. An agent that appears in no manifest keeps its selection untouched, a missing messaging plan is still no authority to call a channel inactive, and a custom preset that shadows the name is still preserved.
  • src/lib/onboard/policy-preset-reconciliation.ts, src/lib/onboard/policy-selection.ts, src/lib/onboard/openclaw-otel-policy-presets.test.ts: rename call sites only.
  • src/lib/actions/sandbox/rebuild-backup-phase.ts: read the rebuild agent from the messaging plan instead of the registry entry. getSandboxAgentRegistryFields stores agent: null for OpenClaw, so the registry field made every default OpenClaw rebuild skip the guard.
  • src/lib/actions/sandbox/rebuild-backup-phase.ts: build the enabled-channel set with getActiveChannelIdsFromPlan. Filtering on disabled alone counted a configured channel the plan cannot start, which kept its egress preset and left the same dangling credential binding behind.
  • Tests: OpenClaw rows added to the preparation-boundary tests in policy-resume-selection.test.ts, a downstream application-boundary guard in policy-selection-application.test.ts, and built-in-only rebuild fixtures in rebuild-backup-phase.test.ts. rebuild-flow-lifecycle.test.ts now builds production-shaped channels and manifest-resolved credential bindings; its previous partial literals read as inactive once rebuild resolved the canonical active set.

The guard is not a new mechanism. Its current consumers are the three selection paths named above, and each has a test that fails when the guard is turned into a no-op.

Verification

  • npm run test:changed — 134 test files, 2166 tests, 0 failures.
  • npm run typecheck:cli — clean.
  • npm run checks:repository — passed, including the source architecture budget.
  • npx vitest run --project integration test/automation/pull-requests/growth-guardrails.test.ts — 32 passed.
  • git diff --check — clean.
  • Mutation checks, each guard independently load-bearing: making the shared helper return its input fails 6 tests across rebuild-backup-phase.test.ts, messaging-policy-presets.test.ts, policy-selection-application.test.ts and both OpenClaw rows in policy-resume-selection.test.ts; restoring sandboxEntry.agent in rebuild fails only the OpenClaw rows; restoring the !channel.disabled filter fails only the cannot-start row.
  • Live E2E baseline on main at 4c5840777 without this change — run 33047892284, targets common-egress-agent-openclaw-open-reference,openclaw-slack-pairing,telegram-injection,sessions-agents-cli,tunnel-lifecycle,inference-routing, inference_mode=mock: all six passed.
  • No secrets, API keys, or credentials appear in the diff.

Review notes

Sensitive paths changed: onboarding, policy selection, messaging, and sandbox rebuild. The change narrows which presets reach a policy and does not widen any credential authority.

This PR's scope changed after it was opened. The original diff added an OpenClaw-specific helper alongside #10281's Hermes one and wrapped the shared unavailable-preset pruner, which dropped preserveExplicitWebSearch and pruned an operator-requested brave preset; cli-test-shards (4) failed on policy-tiers-onboard.test.ts:679 at the previous head while the PR base was green. That approach is replaced here by widening the existing helper, so one concept keeps one name.

Live E2E at this head cannot run the credentialed targets. This is a fork PR, and references/manual-pr.md in the maintainer E2E skill records that an external PR keeps the credential-free controller selection. Of the six OpenClaw targets, only inference-routing carries the standard profile; the rest are nvidia-inference or brave-nvidia-inference and are excluded by isPrCandidateCatalogueTarget. Maintainer direction is requested on whether the post-merge main E2E is the intended evidence for a fork PR.

Two adjacent gaps surfaced during review. Both predate this change, both currently affect Hermes, and neither is introduced or worsened by widening the agent set:

  • getAppliedPresets returns [...builtinPolicies, ...customPolicyNames] as a flat list (src/lib/policy/index.ts), and the helper exempts a preset whenever any custom policy shares its name. A sandbox recorded with both a built-in discord policy and a custom policy named discord keeps the built-in credential-bound policy live. Distinguishing ownership belongs in reconciliation, not in this guard.
  • The rebuild fixtures use a partial preparedRecoveryManifest. They remain sufficient for the focused pruning assertions and should not be cited as provider or full messaging-restore coverage.

Signed-off-by: Ho Lim subhoya@gmail.com
Signed-off-by: Hung Le hple@nvidia.com

Signed-off-by: Ho Lim <subhoya@gmail.com>
Copilot AI lite review requested due to automatic review settings August 26, 2026 06:32
@copy-pr-bot

copy-pr-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 26, 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: 502393b2-7706-421f-bb47-f12c239472d8

📥 Commits

Reviewing files that changed from the base of the PR and between cac239b and 98fd1f2.

📒 Files selected for processing (10)
  • src/lib/actions/sandbox/rebuild-backup-phase.test.ts
  • src/lib/actions/sandbox/rebuild-backup-phase.ts
  • src/lib/actions/sandbox/rebuild-flow-lifecycle.test.ts
  • src/lib/onboard/messaging-policy-presets.test.ts
  • src/lib/onboard/messaging-policy-presets.ts
  • src/lib/onboard/openclaw-otel-policy-presets.test.ts
  • src/lib/onboard/policy-preset-reconciliation.ts
  • src/lib/onboard/policy-resume-selection.test.ts
  • src/lib/onboard/policy-selection-application.test.ts
  • src/lib/onboard/policy-selection.ts

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The change generalizes inactive messaging preset pruning from Hermes to recognized messaging agents. Onboarding reconciliation and sandbox rebuilds now use typed channel plans and preserve active or operator-owned custom presets.

Changes

Messaging preset pruning

Layer / File(s) Summary
Generic messaging preset pruning
src/lib/onboard/messaging-policy-presets.ts, src/lib/onboard/messaging-policy-presets.test.ts, src/lib/onboard/policy-preset-reconciliation.ts, src/lib/onboard/openclaw-otel-policy-presets.test.ts
Renames the public helper and applies pruning to recognized messaging agents. Tests cover unsupported agents, missing plans, invalid channel lists, and custom preset ownership.
Onboarding selection and reconciliation
src/lib/onboard/policy-selection.ts, src/lib/onboard/policy-resume-selection.test.ts, src/lib/onboard/policy-selection-application.test.ts
Setup suggestions and resume reconciliation use the generic pruner for Hermes and OpenClaw. OpenClaw tests cover inactive built-in presets and same-named custom presets.
Sandbox rebuild channel handling
src/lib/actions/sandbox/rebuild-backup-phase.ts, src/lib/actions/sandbox/rebuild-backup-phase.test.ts, src/lib/actions/sandbox/rebuild-flow-lifecycle.test.ts
Rebuilds derive active channel IDs from typed plans and remove presets for inactive or credential-incomplete channels. Tests cover Hermes and OpenClaw rebuilds.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 98fd1

The change narrows built-in messaging preset selection to configured active channels and preserves custom policies; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

  • NVIDIA/NemoClaw#10281: Introduces the related inactive Hermes messaging-preset pruning behavior that this change generalizes.

Suggested labels: area: messaging, area: onboarding, bug-fix

Suggested reviewers: rsliter, ericksoa, laitingsheng

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 11 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: excluding inactive OpenClaw messaging presets during onboarding.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@rsliter rsliter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed latest PR commit 903a3bb0848ca4b9d2140bbb8c0af8a6ab1fc4d2 against base SHA 896760b7cd407606050ce609dbcce429b06cc3f1. I found no critical security or correctness defect in the isolated diff. The policy-selection tests passed 63 focused tests, and the CLI build passed. The nine-category security review has no FAIL result; configuration, testing, and integration remain WARNING conditions.

This is a conditional assessment, not an approval. The branch conflicts with current main, and fresh required checks have not run. Please resolve the conflict without dropping #10314 behavior, confirm the product scope for pruning every inactive OpenClaw messaging preset, align the canonical Open-tier documentation, and obtain fresh passing required checks, including the focused Slack pairing E2E. I will re-review the resulting latest PR commit.

Resolve the conflict against NVIDIA#10314 and NVIDIA#10281 by keeping main's suggestion gate
and its shared inactive-preset helper. The original wrapper-based prune is
dropped here and replaced by an agent-set change in the next commit.

Signed-off-by: Hung Le <hple@nvidia.com>
NVIDIA#10281 stopped Hermes from carrying a repository messaging preset for a channel
the sandbox does not configure. OpenClaw reaches the same selection paths, so it
kept applying a preset for an unconfigured channel, including the Discord preset
that names a sandbox-scoped credential provider create-plan validation rejects.

Resolve the agent set from supportedAgents in the channel manifests instead of
naming Hermes in the guard, and rename the helper to match what it now covers.
An agent that appears in no manifest keeps its selection untouched, a missing
messaging plan stays no authority to call a channel inactive, and a custom preset
that shadows the name is still preserved.

Read the rebuild agent from the messaging plan rather than the registry entry.
getSandboxAgentRegistryFields stores agent as null for OpenClaw, so the registry
field made every default OpenClaw rebuild skip the guard.

Build rebuild's enabled-channel set with getActiveChannelIdsFromPlan. Filtering on
`disabled` alone counted a configured channel the plan cannot start, which kept its
egress preset and left the same dangling credential binding behind.

Give the rebuild fixtures production-shaped plans. The existing custom-policy
fixture passes even when the shared helper is a no-op, and the lifecycle fixture
omitted `active` and its credential hashes, so it read as fully inactive once
rebuild resolved the canonical active set.

Refs NVIDIA#10153

Signed-off-by: Hung Le <hple@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit 98fd1f2. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

All previous runs

@hunglp6d

Copy link
Copy Markdown
Collaborator

Thanks @HOYALIM — this found a real gap, and the diagnosis in the description was right: OpenClaw was keeping a messaging preset for a channel the sandbox does not configure.

Closing in favour of #10490, which carries the same fix from a branch in this repository. Two reasons:

  • Live E2E cannot qualify this head. A fork PR keeps the credential-free controller selection, so of the six OpenClaw targets only inference-routing carries the standard profile; the other five are nvidia-inference or brave-nvidia-inference and are excluded. A branch in NVIDIA/NemoClaw can run all six before merge.
  • The implementation also moved. #10314 and #10281 landed after this PR opened — #10314 gated the Discord suggestion for every agent, and #10281 added a shared inactive-preset guard scoped to Hermes. #10490 widens that existing helper to OpenClaw instead of adding a second one alongside it.

Your commit is credited as co-author on #10490. A baseline run of the six OpenClaw targets on main at 4c5840777 passed all six, so root-cause group 5 of #10153 is already resolved there; #10490 closes the remaining agent-scope gap.

@hunglp6d hunglp6d closed this Aug 27, 2026
@wscurran wscurran added area: messaging Messaging channels, bridges, manifests, or channel lifecycle area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression integration: discord Discord integration or channel behavior integration: openclaw OpenClaw integration behavior integration: slack Slack integration or channel behavior labels Aug 28, 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: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression integration: discord Discord integration or channel behavior integration: openclaw OpenClaw integration behavior integration: slack Slack integration or channel behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants