Skip to content

fix(zalo): fix pairing channel detection and webhook payload format#991

Merged
steipete merged 1 commit into
openclaw:mainfrom
longmaba:fix/zalo-pairing-and-webhook
Jan 16, 2026
Merged

fix(zalo): fix pairing channel detection and webhook payload format#991
steipete merged 1 commit into
openclaw:mainfrom
longmaba:fix/zalo-pairing-and-webhook

Conversation

@longmaba

Copy link
Copy Markdown
Contributor

fix(zalo): fix pairing channel detection and webhook payload format

Fixes #987

Problem

  1. Pairing flow failed for Zalo - The pairing system used requirePairingAdapter() which threw errors for extension channels like Zalo that aren't in the core registry.

  2. Webhook returned 400 Bad Request - The webhook handler expected payloads wrapped as { ok: true, result: ZaloUpdate }, but Zalo sends updates directly as { event_name, message, ... }.

Changes

Pairing fixes:

  • Replace requirePairingAdapter() with getPairingAdapter() that returns undefined for unknown channels instead of throwing
  • Allow extension channels to pass their pairingAdapter directly to bypass registry lookup
  • Add safeChannelKey() to sanitize channel IDs for filenames (prevents path traversal)
  • Update parseChannel() in CLI to accept valid extension channel names not in core registry

Webhook fix:

  • Handle both payload formats: direct { event_name, message } and wrapped { ok, result }
  • Validate presence of event_name instead of ok flag

Files Changed

  • extensions/zalo/src/monitor.ts - Fix webhook payload parsing, pass pairing adapter
  • extensions/zalo/src/core-bridge.ts - Add pairingAdapter to upsert signature
  • src/channels/plugins/pairing.ts - Accept optional pairingAdapter param
  • src/pairing/pairing-store.ts - Use getPairingAdapter(), add safeChannelKey()
  • src/pairing/pairing-labels.ts - Use getPairingAdapter() with fallback
  • src/cli/pairing-cli.ts - Allow extension channels in parseChannel()

@steipete steipete merged commit a057b3c into openclaw:main Jan 16, 2026
19 of 22 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Landed via temp rebase onto main.\n\n- Gate: pnpm lint && pnpm build && pnpm test\n- Land commit: 1656f491f97c5cf68ee257e2a165a9a47ffb0b37\n- Merge commit: a057b3c\n\nThanks @longmaba!

bob10042 pushed a commit to bob10042/openclaw that referenced this pull request Feb 14, 2026
dominicnunez pushed a commit to dominicnunez/openclaw that referenced this pull request Feb 26, 2026
dustin-olenslager pushed a commit to dustin-olenslager/ironclaw-supreme that referenced this pull request Mar 24, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…bhook

fix(zalo): fix pairing channel detection and webhook payload format
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…bhook

fix(zalo): fix pairing channel detection and webhook payload format
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Extension channels (like Zalo) cannot use the core pairing system

2 participants