Skip to content

fix(whatsapp): force compact pairing QR at the real qrcode renderer (#4522) - #5016

Merged
cv merged 1 commit into
NVIDIA:mainfrom
yimoj:fix/4522-whatsapp-compact-qr
Jun 9, 2026
Merged

fix(whatsapp): force compact pairing QR at the real qrcode renderer (#4522)#5016
cv merged 1 commit into
NVIDIA:mainfrom
yimoj:fix/4522-whatsapp-compact-qr

Conversation

@yimoj

@yimoj yimoj commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

The in-sandbox openclaw channels login --channel whatsapp pairing QR still rendered full size (~56 rows) and overflowed the terminal after #4607, making it impossible to scan. This forces compact rendering at the actual renderer the pairing flow uses, with an E2E that proves the rendered QR dimensions.

Related Issue

Fixes #4522

Changes

  • Root cause: the WhatsApp plugin renders the pairing QR via renderQrTerminal() → the qrcode package's toString(text, { type: "terminal", small }), and the bundled @openclaw/whatsapp (version-matched to OpenClaw, e.g. 2026.5.27) passes no small flag, so it defaults to full size. The previous fix patched the unrelated qrcode-terminal package, which the WhatsApp plugin never loads — so compact rendering was never applied at the pairing entrypoint.
  • nemoclaw-blueprint/scripts/whatsapp-qr-compact.js: rewrite the NODE_OPTIONS preload to patch the qrcode package's toString (the real renderer) and force small: true for terminal renders, independent of what the plugin version passes. Detection requires an own toString + create, so internal qrcode submodules are not mutated; the qrcode-terminal generate path is still patched as a fallback. Non-terminal renders (svg/png/utf8 data URIs) are untouched.
  • scripts/nemoclaw-start.sh: wire the preload into the connect-session NODE_OPTIONS (deferred [ -f ] guard) so any openclaw invocation in the session renders compact — not only the bypassable openclaw() shell-function path. The guard injection remains as defense-in-depth.
  • test/e2e/test-whatsapp-qr-compact-e2e.sh (new): hermetic reporter-workflow E2E that installs the exact @openclaw/whatsapp + openclaw versions pinned in Dockerfile.base and drives the real renderQrTerminal symbol the channel-login onQr callback uses, asserting the QR is oversized without the preload and compact with it. Wired into regression-e2e.yaml.
  • test/e2e/test-messaging-providers.sh (M-WA6d): render the QR in-sandbox through the baked renderer with the connect-session NODE_OPTIONS active and assert compact dimensions.
  • test/whatsapp-qr-compact.test.ts: rewritten to patch/verify the qrcode package shape (terminal forced small; non-terminal untouched; idempotent).

Type of Change

  • Code change (feature, bug fix, or refactor)

Verification

Reporter-workflow E2E (proves rendered QR size at the real WhatsApp renderer). The exact reporter workflow is nemoclaw onboard (WhatsApp enabled) → nemoclaw <sandbox> connectopenclaw channels login --channel whatsapp. A full live pairing needs a phone + WhatsApp account, but the bug is purely in QR rendering, which happens in the plugin's onQr callback before any phone interaction. The E2E installs the exact @openclaw/whatsapp@2026.5.27 + openclaw@2026.5.27 the sandbox bundles and drives the same renderQrTerminal symbol (openclaw/plugin-sdk/media-runtime) that openclaw channels login --channel whatsapp calls.

  • Reporter-workflow E2E ran locally — command: bash test/e2e/test-whatsapp-qr-compact-e2e.sh. Log output (on PR head):

    === Baseline (no preload) reproduces the oversized QR ===
      [info] baseline rendered dimensions: {"rows":56,"cols":110}
      OK: baseline QR is oversized (56 rows >= 50) — reproduces NemoClaw#4522
    === With NemoClaw compact-QR preload, the QR is scan-friendly ===
      [info] compact rendered dimensions: {"rows":29,"cols":55}
      OK: compact QR fits a scan frame (29 rows <= 40)
      OK: preload strictly shrinks the QR (56 -> 29 rows)
      PASS=9 FAIL=0
      WhatsApp compact-QR reporter-workflow E2E passed
    
  • Pipeline E2E covers the reporter workflow — job whatsapp-qr-compact-e2e in .github/workflows/regression-e2e.yaml runs the same test/e2e/test-whatsapp-qr-compact-e2e.sh on the PR head (dispatch: gh workflow run regression-e2e.yaml -f jobs=whatsapp-qr-compact-e2e -f pr_number=5016). The nightly test/e2e/test-messaging-providers.sh (check M-WA6d) additionally renders the QR in-sandbox through the baked plugin with the connect-session NODE_OPTIONS active and asserts the same compact dimensions.

  • Targeted suites passtest/whatsapp-qr-compact.test.ts (19), test/nemoclaw-start.test.ts (138), test/e2e-scenario/framework-tests/e2e-migration-inventory.test.ts, all green via npx vitest run.

  • npm test — full suite green; the only reds were CI flakes in unrelated slow subprocess tests (model-router-python, status-gateway-lifecycle, tunnel-command) that pass in isolation and are not touched by this change.

  • Tests added or updated for new or changed behavior

  • No secrets, API keys, or credentials committed

  • Reviewed with the code-review skill and CodeRabbit; actionable findings fixed (over-broad qrcode module match; setup-node + persist-credentials: false on the new CI job; failure-artifact upload; test-file size budget; zero source-shape assertions)


Signed-off-by: Yimo Jiang yimoj@nvidia.com

Summary by CodeRabbit

  • New Features

    • WhatsApp QR rendering now forced into a compact, scan‑friendly terminal mode via a session preload; start script hardened to ensure the preload is applied in connect sessions.
  • Tests

    • Added an end‑to‑end test validating compact QR behavior in sandboxed sessions.
    • Updated unit tests to exercise preload behavior, idempotence, and multiple render shapes.
    • Minor test fixture tweak to initialize the preload env var during scripted runs.
  • Documentation

    • Clarified runtime comments about how the compact QR preload is injected.
  • Chores

    • CI: added a selectable regression job to run the compact QR e2e test.
  • Maintenance

    • Inventory updated to track the new e2e entry.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: 2cb9c598-a23f-4085-84ec-27b53844c4dc

📥 Commits

Reviewing files that changed from the base of the PR and between cbbb222 and 5b72c3d.

📒 Files selected for processing (8)
  • .github/workflows/regression-e2e.yaml
  • nemoclaw-blueprint/scripts/whatsapp-qr-compact.js
  • scripts/nemoclaw-start.sh
  • test/e2e-scenario/migration/legacy-inventory.json
  • test/e2e/test-messaging-providers.sh
  • test/e2e/test-whatsapp-qr-compact-e2e.sh
  • test/nemoclaw-start.test.ts
  • test/whatsapp-qr-compact.test.ts
✅ Files skipped from review due to trivial changes (1)
  • test/e2e-scenario/migration/legacy-inventory.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • .github/workflows/regression-e2e.yaml
  • test/whatsapp-qr-compact.test.ts
  • scripts/nemoclaw-start.sh
  • nemoclaw-blueprint/scripts/whatsapp-qr-compact.js
  • test/nemoclaw-start.test.ts

📝 Walkthrough

Walkthrough

Adds a Node preload that forces compact terminal QR rendering for WhatsApp pairing, wires it into connect-session NODE_OPTIONS (defensive re-injection), replaces brittle tests with deterministic probes, adds a standalone E2E script and messaging-provider probe, updates migration inventory and test fixtures, and exposes a conditional CI regression job.

Changes

WhatsApp Compact QR Rendering

Layer / File(s) Summary
Preload Core Implementation
nemoclaw-blueprint/scripts/whatsapp-qr-compact.js
Implements API-shape detection for qrcode and qrcode-terminal, wraps qrcode.toString()/qrcode-terminal.generate() to inject small:true only for terminal renders, marks patched modules, and narrows Module._load interception to requests containing "qrcode".
Shell Integration and Wiring
scripts/nemoclaw-start.sh
Documents preload behavior, conditionally appends --require $_WHATSAPP_QR_COMPACT_SCRIPT into generated connect-session NODE_OPTIONS, and keeps defensive openclaw() re-injection comments/guards.
Unit Test Harness and Assertions
test/whatsapp-qr-compact.test.ts
Replaces dimension-measurement tests with a fake-module probe that records options passed to qrcode/qrcode-terminal, runs probes with/without preload, and asserts forwarding, non-terminal preservation, require/import consistency, fallback behavior, and idempotency.
Standalone E2E Test Script
test/e2e/test-whatsapp-qr-compact-e2e.sh
New E2E Bash script that installs pinned openclaw and @openclaw/whatsapp, runs a Node ESM probe calling renderQrTerminal, and asserts baseline vs preloaded row-count compactness and strict shrink.
E2E Validation Integration
test/e2e/test-messaging-providers.sh
Adds M-WA6d sub-test that sources connect-session env to enable preload, probes renderQrTerminal with/without preload, counts rows, enforces compact ≤40 rows and strictly smaller than baseline, and skips when probe unavailable.
CI Workflow Regression Testing Infrastructure
.github/workflows/regression-e2e.yaml
Adds whatsapp-qr-compact-e2e to workflow_dispatch valid list, exposes select_regression_jobs.outputs.whatsapp_qr_compact, computes it from inputs, and defines a conditional job that checks out the repo and runs the new E2E script when selected and repo matches.
Migration inventory & test fixture
test/e2e-scenario/migration/legacy-inventory.json, test/nemoclaw-start.test.ts
Adds legacy-inventory entry for the new E2E script and initializes _WHATSAPP_QR_COMPACT_SCRIPT in the generated bash test fixture.

Sequence Diagram(s)

sequenceDiagram
  participant CLI as nemoClaw CLI
  participant Node as Node Runtime
  participant ModuleHook as Module._load Hook
  participant OpenClaw as openclaw renderer
  participant Terminal as Terminal Renderer

  CLI->>Node: spawn openclaw (with or without NODE_OPTIONS preload)
  Node->>ModuleHook: load qrcode / qrcode-terminal (request contains "qrcode")
  ModuleHook->>ModuleHook: detect shape, patch module to inject { small: true } for terminal
  Node->>OpenClaw: call renderQrTerminal(payload)
  OpenClaw->>Terminal: qrcode.toString(..., { type: "terminal", small: true })
  Terminal-->>CLI: compact QR output (fewer rows)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#4607: Prior PR touching the WhatsApp compact preload and nemoclaw-start.sh wiring; directly related.
  • NVIDIA/NemoClaw#4671: Modifies WhatsApp compact-QR validation logic in test/e2e/test-messaging-providers.sh, related to M-WA6d additions.

Suggested labels

integration: whatsapp, area: messaging, fix, E2E, v0.0.57

Suggested reviewers

  • cv
  • jyaunches

Poem

🐰 I patched the QR so it won't sprawl,
Small blocks now fit a camera's call.
I hop through Module._load with care,
Probe the render twice, compare.
Hop, scan, connect — pairing in the air!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.29% 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 identifies the main change: forcing compact rendering of WhatsApp pairing QR codes by patching the real qrcode renderer, which directly addresses the root cause identified in the PR.
Linked Issues check ✅ Passed The PR fully addresses the objective in #4522: implementing compact WhatsApp pairing QR rendering (approximately 30-40 terminal lines) with comprehensive tests, preload logic, and workflow integration.
Out of Scope Changes check ✅ Passed All changes directly support the compact WhatsApp QR objective: preload patching, environment variable wiring, E2E tests, unit test updates, workflow additions, and test configuration entries are all in scope.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment thread test/e2e/test-whatsapp-qr-compact-e2e.sh
Comment thread test/e2e/test-whatsapp-qr-compact-e2e.sh
@yimoj
yimoj force-pushed the fix/4522-whatsapp-compact-qr branch from af4d523 to d0bb9b4 Compare June 9, 2026 04:19

@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: 2

🧹 Nitpick comments (1)
.github/workflows/regression-e2e.yaml (1)

440-460: ⚡ Quick win

Consider adding artifact upload on failure for debugging consistency.

Other E2E jobs in this workflow upload logs when tests fail (e.g., lines 186-195, 224-233, 291-299, 338-346). Adding artifact upload for this job would improve debuggability when CI failures occur.

📦 Proposed enhancement: add artifact upload
       - name: Run WhatsApp compact-QR reporter-workflow E2E test
         run: bash test/e2e/test-whatsapp-qr-compact-e2e.sh
+
+      - name: Upload WhatsApp compact-QR logs on failure
+        if: failure()
+        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+        with:
+          name: whatsapp-qr-compact-e2e-logs
+          path: |
+            /tmp/nemoclaw-wa-qr-e2e.*.log
+          if-no-files-found: ignore

Note: Adjust the path pattern based on actual log file paths written by the test script.

🤖 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 @.github/workflows/regression-e2e.yaml around lines 440 - 460, The
whatsapp-qr-compact-e2e job lacks an artifact upload step for failing runs; add
a post-test step after the "Run WhatsApp compact-QR reporter-workflow E2E test"
step that uses actions/upload-artifact to upload the test logs when the job
fails (use if: failure() or if: always() to capture logs on failure), name the
artifact clearly (e.g., whatsapp-qr-compact-e2e-logs) and point the path to the
files produced by test/e2e/test-whatsapp-qr-compact-e2e.sh (adjust the path
pattern to match that script's log output).
🤖 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 @.github/workflows/regression-e2e.yaml:
- Around line 456-457: The Checkout step currently uses "uses:
actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10" (named "Checkout");
update that step to add persist-credentials: false so the GITHUB_TOKEN is not
persisted to the workspace and cannot be used by later steps—modify the
"Checkout" step's step definition to include the persist-credentials: false
option under the uses entry.
- Around line 440-460: The whatsapp-qr-compact-e2e job currently runs
test/e2e/test-whatsapp-qr-compact-e2e.sh without ensuring Node.js is installed;
add an explicit setup-node step (e.g. actions/setup-node@v4) before the "Run
WhatsApp compact-QR reporter-workflow E2E test" step and set a stable
node-version (for example '18') so the node and npm commands used by the test
script are guaranteed to be available.

---

Nitpick comments:
In @.github/workflows/regression-e2e.yaml:
- Around line 440-460: The whatsapp-qr-compact-e2e job lacks an artifact upload
step for failing runs; add a post-test step after the "Run WhatsApp compact-QR
reporter-workflow E2E test" step that uses actions/upload-artifact to upload the
test logs when the job fails (use if: failure() or if: always() to capture logs
on failure), name the artifact clearly (e.g., whatsapp-qr-compact-e2e-logs) and
point the path to the files produced by test/e2e/test-whatsapp-qr-compact-e2e.sh
(adjust the path pattern to match that script's log output).
🪄 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: 33abd692-35fa-481c-88da-bf2af9c05c66

📥 Commits

Reviewing files that changed from the base of the PR and between d9db199 and d0bb9b4.

📒 Files selected for processing (6)
  • .github/workflows/regression-e2e.yaml
  • nemoclaw-blueprint/scripts/whatsapp-qr-compact.js
  • scripts/nemoclaw-start.sh
  • test/e2e/test-messaging-providers.sh
  • test/e2e/test-whatsapp-qr-compact-e2e.sh
  • test/whatsapp-qr-compact.test.ts

Comment thread .github/workflows/regression-e2e.yaml
Comment thread .github/workflows/regression-e2e.yaml
@yimoj
yimoj force-pushed the fix/4522-whatsapp-compact-qr branch from d0bb9b4 to 8efc8eb Compare June 9, 2026 04:30

@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/nemoclaw-start.test.ts`:
- Around line 5241-5242: Two separate array entries '_SLACK_GUARD_SCRIPT=""' and
'_WHATSAPP_QR_COMPACT_SCRIPT=""' push the test file over the 5300-line
guardrail; to reclaim one line, collapse them into a single line (e.g., combine
the two entries into one comma-separated entry or otherwise merge their text) so
both settings remain but occupy one physical line; update the array element
containing '_SLACK_GUARD_SCRIPT' and '_WHATSAPP_QR_COMPACT_SCRIPT' accordingly.
🪄 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: 3479696b-0be1-4266-b358-23c77d44c19d

📥 Commits

Reviewing files that changed from the base of the PR and between d0bb9b4 and 8efc8eb.

📒 Files selected for processing (8)
  • .github/workflows/regression-e2e.yaml
  • nemoclaw-blueprint/scripts/whatsapp-qr-compact.js
  • scripts/nemoclaw-start.sh
  • test/e2e-scenario/migration/legacy-inventory.json
  • test/e2e/test-messaging-providers.sh
  • test/e2e/test-whatsapp-qr-compact-e2e.sh
  • test/nemoclaw-start.test.ts
  • test/whatsapp-qr-compact.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • scripts/nemoclaw-start.sh
  • test/e2e/test-messaging-providers.sh
  • nemoclaw-blueprint/scripts/whatsapp-qr-compact.js
  • test/whatsapp-qr-compact.test.ts

Comment thread test/nemoclaw-start.test.ts
@yimoj
yimoj force-pushed the fix/4522-whatsapp-compact-qr branch 2 times, most recently from c90ab6e to cbbb222 Compare June 9, 2026 04:40
@yimoj

yimoj commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @coderabbitai — addressed both:

  • Test-file size guardrail (test/nemoclaw-start.test.ts): resolved by trimming an adjacent 3-line comment to 2 lines so the file stays at exactly 5300 (the mandatory _WHATSAPP_QR_COMPACT_SCRIPT="" stub is needed because the new connect-session wiring references it under set -u). Kept the stubs as separate array entries to match the surrounding style (Biome re-splits combined entries anyway).
  • Failure-artifact upload (regression-e2e.yaml): added an if: failure() upload step; the install log now writes to a stable /tmp path outside the auto-cleaned WORKDIR so it survives for upload, matching the sibling E2E jobs.

Also removed the source-text assertions (the maxSourceShapeCases: 0 gate); the connect-session wiring is now covered behaviorally by the openclaw() guard execution test plus the end-to-end renderer E2E and in-sandbox M-WA6d size check.

@wscurran wscurran added the bug-fix PR fixes a bug or regression label Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@yimoj: Thanks for the clear rundown — all three look well-handled:

  • _WHATSAPP_QR_COMPACT_SCRIPT="" stub — the set -u rationale is solid; keeping the entries separate to match surrounding style (and Biome's preference) makes sense.
  • Failure-artifact upload — writing the install log to a stable /tmp path before the WORKDIR is cleaned is exactly the right approach, and consistent with the sibling jobs.
  • Behavioral coverage over source-text assertions — the combination of the openclaw() guard execution test, the hermetic E2E renderer, and the in-sandbox M-WA6d size check provides stronger signal than a static source scan.

( ˘ᵕ˘)🐇

@yimoj
yimoj force-pushed the fix/4522-whatsapp-compact-qr branch 2 times, most recently from 373a8d9 to 754e41f Compare June 9, 2026 04:50

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

♻️ Duplicate comments (2)
.github/workflows/regression-e2e.yaml (2)

456-460: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add Node.js setup step before running the test.

The test script explicitly requires node and npm commands and fails if they are not available (test/e2e/test-whatsapp-qr-compact-e2e.sh lines 63-74). While ubuntu-latest runners currently include Node.js by default, relying on implicit availability is fragile and can break if GitHub updates runner images.

🔧 Proposed fix: add setup-node step
     steps:
       - name: Checkout
         uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

+      - name: Setup Node
+        uses: actions/setup-node@v6
+        with:
+          node-version: "22"
+
       - name: Run WhatsApp compact-QR reporter-workflow E2E test
         run: bash test/e2e/test-whatsapp-qr-compact-e2e.sh

Based on learnings from other jobs in this workflow that require Node.js (lines 174-177, 213-216, 279-282, 328-331, 363-366), all use explicit setup-node steps.

🤖 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 @.github/workflows/regression-e2e.yaml around lines 456 - 460, Add an
explicit Node.js setup step (using actions/setup-node) immediately before the
"Run WhatsApp compact-QR reporter-workflow E2E test" step so the test script
test/e2e/test-whatsapp-qr-compact-e2e.sh can rely on node and npm; update the
workflow to mirror the other jobs that call setup-node (see the earlier
setup-node usages) and ensure the setup-node action specifies the Node.js
version required by the test.

456-457: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Set persist-credentials: false on checkout to reduce token exposure.

To minimize security risk, disable credential persistence in the checkout step. This prevents the GITHUB_TOKEN from being available to subsequent steps that don't require it.

🔒 Proposed fix
       - name: Checkout
         uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
+        with:
+          persist-credentials: false
🤖 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 @.github/workflows/regression-e2e.yaml around lines 456 - 457, The Checkout
step (the step with "name: Checkout" and "uses:
actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10") should add the
option persist-credentials: false to its step configuration; update that step so
the checkout action is invoked with persist-credentials: false to prevent
GITHUB_TOKEN from being persisted to subsequent steps.
🤖 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.

Duplicate comments:
In @.github/workflows/regression-e2e.yaml:
- Around line 456-460: Add an explicit Node.js setup step (using
actions/setup-node) immediately before the "Run WhatsApp compact-QR
reporter-workflow E2E test" step so the test script
test/e2e/test-whatsapp-qr-compact-e2e.sh can rely on node and npm; update the
workflow to mirror the other jobs that call setup-node (see the earlier
setup-node usages) and ensure the setup-node action specifies the Node.js
version required by the test.
- Around line 456-457: The Checkout step (the step with "name: Checkout" and
"uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10") should add
the option persist-credentials: false to its step configuration; update that
step so the checkout action is invoked with persist-credentials: false to
prevent GITHUB_TOKEN from being persisted to subsequent steps.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 11dd91e9-f605-4114-bd33-0d89b64c5258

📥 Commits

Reviewing files that changed from the base of the PR and between cbbb222 and 373a8d9.

📒 Files selected for processing (8)
  • .github/workflows/regression-e2e.yaml
  • nemoclaw-blueprint/scripts/whatsapp-qr-compact.js
  • scripts/nemoclaw-start.sh
  • test/e2e-scenario/migration/legacy-inventory.json
  • test/e2e/test-messaging-providers.sh
  • test/e2e/test-whatsapp-qr-compact-e2e.sh
  • test/nemoclaw-start.test.ts
  • test/whatsapp-qr-compact.test.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • scripts/nemoclaw-start.sh
  • test/e2e/test-messaging-providers.sh
  • test/nemoclaw-start.test.ts
  • nemoclaw-blueprint/scripts/whatsapp-qr-compact.js
  • test/whatsapp-qr-compact.test.ts
  • test/e2e-scenario/migration/legacy-inventory.json

…VIDIA#4522)

The in-sandbox `openclaw channels login --channel whatsapp` pairing QR
still rendered full size (~56 rows) and overflowed the terminal after
PR NVIDIA#4607. Root cause: the upstream @openclaw/whatsapp plugin renders the
QR via `renderQrTerminal()` → the `qrcode` package's
`toString(text, { type: "terminal", small })`, and the bundled plugin
(version-matched to OpenClaw, e.g. 2026.5.27) passes NO `small` flag, so
it defaults to full size. The previous fix patched the unrelated
`qrcode-terminal` package, which the WhatsApp plugin never loads — so the
compact rendering was never applied at the actual pairing entrypoint.

Fix:
- Rewrite the NODE_OPTIONS preload to patch the `qrcode` package's
  `toString` (the real renderer) and force `small: true` for terminal
  renders, independent of what the plugin version passes. Detection
  requires an OWN `toString` + `create` so internal qrcode submodules are
  not mutated. The qrcode-terminal `generate` path is still patched as a
  fallback. Non-terminal renders (svg/png/utf8) are untouched.
- Wire the preload into the connect-session NODE_OPTIONS (deferred `[ -f ]`
  guard) so ANY openclaw invocation in the session renders compact, not
  just the bypassable openclaw() shell-function path; the guard injection
  remains as defense-in-depth.

Coverage (proves rendered QR size, not just preload presence):
- New hermetic E2E `test/e2e/test-whatsapp-qr-compact-e2e.sh` installs the
  exact @openclaw/whatsapp + openclaw versions pinned in Dockerfile.base
  and drives the real `renderQrTerminal` symbol the channel-login onQr
  callback uses: 56 rows without the preload, 29 rows with it. Wired into
  regression-e2e.yaml.
- Sandbox parity (test-messaging-providers.sh M-WA6d) renders the QR
  in-sandbox through the baked renderer with the connect-session
  NODE_OPTIONS active and asserts compact dimensions.
- Unit test rewritten to patch/verify the `qrcode` package shape and the
  connect-session wiring.

Signed-off-by: Yimo Jiang <yimoj@nvidia.com>
@yimoj
yimoj force-pushed the fix/4522-whatsapp-compact-qr branch from 754e41f to 5b72c3d Compare June 9, 2026 05:04
@yimoj

yimoj commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Addressed the two workflow findings in 5b72c3d: added an explicit actions/setup-node@v6 (node 22) step and persist-credentials: false on the checkout for the new whatsapp-qr-compact-e2e job. Both review threads resolved.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@yimoj: Thanks for the follow-up — triggering a fresh review to verify the setup-node@v6 and persist-credentials: false additions in 5b72c3d and check for anything remaining.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@yimoj yimoj added the v0.0.62 label Jun 9, 2026
@cv
cv merged commit ec24f11 into NVIDIA:main Jun 9, 2026
33 of 36 checks passed
jyaunches pushed a commit that referenced this pull request Jun 10, 2026
## Summary
- Add v0.0.62 release notes from Discussion #5100 and link release
highlights to the relevant docs pages.
- Document the release's GPU sandbox recreation, sandbox-side local
inference verification, and Hermes dashboard port guard in the command
and inference references.
- Refresh generated NemoClaw user skills for the release-prep docs set.

## Source Summary
- #4956 -> `docs/reference/commands.mdx`: Document CDI-first Docker GPU
recreation behavior for Linux Docker-driver sandboxes.
- #5024 -> `docs/inference/use-local-inference.mdx`: Document
sandbox-runtime verification of the `inference.local` local inference
route.
- #5018 -> `docs/reference/commands.mdx`: Document Jetson/Tegra
device-node group propagation for sandbox CUDA initialization.
- #5012, #4763, #4706, #5030, #5015 -> `docs/about/release-notes.mdx`:
Summarize onboarding and recovery reliability fixes, including the
reserved Hermes API port guard.
- #5017 and #5043 -> `docs/about/release-notes.mdx`,
`docs/reference/commands.mdx`: Summarize mutable OpenClaw config
recovery and host-side `agents list` coverage.
- #5010 and #5016 -> `docs/about/release-notes.mdx`: Summarize Hermes
upstream metadata visibility and WhatsApp QR rendering reliability.
- #5045 and prior source docs in the v0.0.62 range -> `.agents/skills/`:
Refresh generated user-skill references from the current docs source.

## Skipped
- #5019 -> skipped for new prose because it touched
`openclaw-sandbox-permissive.yaml`, which matches `docs/.docs-skip`.
Existing source docs remain the source for generated skill
synchronization.

## Verification
- `python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix
nemoclaw-user --doc-platform fern-mdx`
- `npm run docs` (passes; Fern reports 0 errors and 1 hidden warning)
- Pre-commit hooks passed during commit, including docs-to-skills
verification, markdown lint, gitleaks, and skills YAML tests.

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

* **New Features**
  * Added `nemoclaw <name> agents list` command.
* v0.0.62 release notes added summarizing onboarding and recovery
improvements.

* **Bug Fixes**
* Improved GPU sandbox onboarding reliability (NVIDIA CDI path,
Jetson/Tegra device handling).
* Better local inference verification and recovery for Linux
Docker-driver GPU sandboxes.
  * Quieter/earlier handling of onboarding drift and port collisions.

* **Documentation**
* Expanded GPU passthrough, inference verification, writable paths
(`/dev/pts`), port 8642 restriction, and command examples.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com>
@wscurran wscurran added the NV QA Bugs found by the NVIDIA QA Team label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression NV QA Bugs found by the NVIDIA QA Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DGX Spark][CLI&UX] WhatsApp QR code renders too large in terminal — fills entire screen, impossible to scan

4 participants