Skip to content

[All Platforms][Agent&Skills] 'channels add whatsapp' updates messagingChannels and succeeds even when whatsapp preset file is missing #4548

Description

@PrachiShevate-nv

Product / Component

  • Product: NemoClaw
  • Component: nemoclaw CLI – sandbox messaging channels / policy presets integration

Environment

  • OS: Ubuntu 24.04 (x86_64)
  • NemoClaw: v0.0.54
  • Sandbox type: OpenClaw agent sandbox my-assistant, status Ready before test
  • Docker: running, GPU-enabled (NVIDIA GPU present)

Preconditions

  1. NemoClaw installed; Docker running.

  2. Existing sandbox my-assistant onboarded and Ready (OpenClaw agent).

  3. WhatsApp not already configured for my-assistant:

    • my-assistant's messagingChannels does not contain "whatsapp":

      cat ~/.nemoclaw/sandboxes.json | python3 -c \
        "import json,sys; d=json.load(sys.stdin); print(d['sandboxes']['my-assistant']['messagingChannels'])"
    • nemoclaw my-assistant policy-list does not list the whatsapp preset.

  4. WhatsApp preset file exists at:

    ~/.nemoclaw/source/nemoclaw-blueprint/policies/presets/whatsapp.yaml
    

Steps to Reproduce

  1. Temporarily remove the WhatsApp preset file:

    mv ~/.nemoclaw/source/nemoclaw-blueprint/policies/presets/whatsapp.yaml /tmp/whatsapp.yaml.bak
  2. Add the WhatsApp channel to the sandbox:

    nemoclaw my-assistant channels add whatsapp
  3. When prompted:

    Rebuild 'my-assistant' now to apply? [Y/n]:
    

    answer Y and wait for the rebuild to complete.

  4. After the command returns, check messagingChannels:

    cat ~/.nemoclaw/sandboxes.json | python3 -c \
      "import json,sys; d=json.load(sys.stdin); print(d['sandboxes']['my-assistant']['messagingChannels'])"
  5. (Optional, for completeness) Inspect the rebuild log around [8/8] Policy presets and the "Restoring policy presets…" section.

  6. Restore the preset file after testing:

    mv /tmp/whatsapp.yaml.bak \
      ~/.nemoclaw/source/nemoclaw-blueprint/policies/presets/whatsapp.yaml

Expected Result

When the whatsapp preset file is missing:

  • nemoclaw my-assistant channels add whatsapp should fail cleanly:
    • Exit code: non-zero (e.g., 1).
    • Output should indicate that the WhatsApp preset failed to apply (missing preset file) and that the channel was not fully configured.
    • A hint such as "Re-apply manually after restoring the preset and rebuilding" is shown.
  • No rebuild should occur, or if a rebuild is attempted, it should be aborted as failed.
  • The sandbox registry should not be updated:
    • messagingChannels for my-assistant should not include "whatsapp".
    • Policy presets section should not list whatsapp as applied.

In other words, registry write and preset application should be atomic: either both succeed or both fail.

Actual Result

With whatsapp.yaml renamed out of the presets directory:

The CLI still prints success text and proceeds:

WhatsApp Web pairs via QR code scanned with your phone — no host-side token.
...
✓ Enabled whatsapp channel.
   Complete QR pairing from inside the sandbox after rebuild.
Rebuild 'my-assistant' now to apply? [Y/n]: Y

NemoClaw performs a full sandbox rebuild:

  • Old sandbox image is deleted.

  • New image is built and my-assistant sandbox is recreated successfully.

  • Final summary reports:

    ✓ Sandbox 'my-assistant' rebuilt successfully
    OpenClaw is ready
    

During [8/8] Policy presets and "Restoring policy presets…":

  • Only npm, pypi, huggingface, brew, openclaw-pricing (and later brave) are reapplied:

    [resume] Reapplying policy presets: npm, pypi, huggingface, brew, openclaw-pricing
    ...
    Applied preset: npm
    Applied preset: pypi
    Applied preset: huggingface
    Applied preset: brew
    Applied preset: openclaw-pricing
    ...
    Applied preset: brave
    
  • There is no Applied preset: whatsapp line in this run, consistent with the missing preset file.

Despite this, the sandbox registry now shows WhatsApp as configured:

cat ~/.nemoclaw/sandboxes.json | python3 -c \
  "import json,sys; d=json.load(sys.stdin); print(d['sandboxes']['my-assistant']['messagingChannels'])"
# Output: ['whatsapp']

The command behaves as if it succeeded:

  • User-facing messaging says ✓ Enabled whatsapp channel.
  • No error about missing preset is shown.
  • Exit code appears to be success (command proceeds to completion with no error message).

Result: my-assistant ends up in an inconsistent state where:

  • messagingChannels includes "whatsapp",
  • but the WhatsApp preset is missing and was never applied during rebuild.

Impact

  • Users can end up with a sandbox that claims to have a WhatsApp channel configured in the registry, but the underlying policy preset and wiring are absent.
  • This breaks the expectation that channels add whatsapp is an atomic configuration change.
  • Follow-up operations or tooling that trust messagingChannels may assume WhatsApp is correctly configured when it is not.

Suggested Fix / Notes

Ensure channels add <channel>:

  • Validates the presence and loadability of the channel's preset before updating messagingChannels and starting a rebuild.
  • If preset loading fails (file missing or invalid), abort the operation:
    • Do not modify messagingChannels.
    • Do not proceed with rebuild.
    • Return a non-zero exit code with a clear error message.
  • Alternatively, if rebuild must run first, the registry update should be rolled back on preset failure.

Activity

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

Metadata

Metadata

Assignees

Labels

NV QABugs found by the NVIDIA QA Teamarea: cliCommand line interface, flags, terminal UX, or outputarea: skillsSkills, agent behaviors, prompts, or skill packagingintegration: whatsappWhatsApp integration or channel behavior

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions