Skip to content

fix(channels): resolve false WhatsApp unpaired status when selfChatMode is false#87

Merged
chrysb merged 2 commits into
chrysb:mainfrom
kesslerio:fix/whatsapp-pairing-status
Jun 15, 2026
Merged

fix(channels): resolve false WhatsApp unpaired status when selfChatMode is false#87
chrysb merged 2 commits into
chrysb:mainfrom
kesslerio:fix/whatsapp-pairing-status

Conversation

@kesslerio

Copy link
Copy Markdown
Contributor

Summary

This PR resolves the issue where a paired WhatsApp channel was incorrectly displayed as "Awaiting pairing" in the UI when selfChatMode was set to false.

Changes

  • Pairing Status Checking: Added hasSavedWhatsAppCredentials to check for the presence of WhatsApp session files before treating the account as paired.
  • Support selfChatMode: false: Restored the selfChatMode === false guard to hasImplicitWhatsAppSelfPairing. Instead, WhatsApp now counts allowed numbers (allowFrom entries) if valid credentials exist, correctly reflecting pairing status.
  • Status API Alignment: Standardized listConfiguredChannelAccounts (shared) and getChannelStatus (gateway) to follow the same pairing check logic for WhatsApp.

Verification

  • Added test cases in tests/server/gateway.test.js verifying that:
    • An account is marked paired if selfChatMode: false, credentials exist, and allowFrom is populated.
    • An account is marked configured (unpaired) if selfChatMode: false, credentials exist, but allowFrom is empty.
  • Ran the full test suite (npx vitest run) to confirm clean execution.

Compound Engineering
Gemini CLI

kesslerio added 2 commits June 5, 2026 23:13
…de is false

Signed-off-by: kesslerio <martin@kessler.io>
…pp status

Signed-off-by: kesslerio <martin@kessler.io>
@kesslerio kesslerio force-pushed the fix/whatsapp-pairing-status branch from 915bd0d to 71d5613 Compare June 6, 2026 06:13

@chrysb chrysb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good. The shared pairing-count helper preserves the WhatsApp selfChatMode=false case while keeping the existing gateway/agents status paths aligned. Targeted gateway and agents-service tests pass.

@chrysb chrysb merged commit ba2d2a7 into chrysb:main Jun 15, 2026
1 check passed
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.

2 participants