How to Manage Adapters
Adapters connect GSV processes to external messaging systems such as WhatsApp and Discord. The deployed channel Workers host protocol-specific code; the Kernel sees them through adapter.* syscalls and linked external actors.
Deploy Adapter Workers
Deploy adapter components with infrastructure commands:
gsv infra deploy -c channel-whatsapp
gsv infra deploy -c channel-discord --discord-bot-token "$DISCORD_BOT_TOKEN"If you deploy all components, both adapter Workers are included:
gsv infra deploy --allConnect WhatsApp
Start or reconnect a WhatsApp account:
gsv adapter connect --adapter whatsapp --account-id personal --config-json '{"force":true}'When WhatsApp needs pairing, the CLI prints a QR challenge. Scan it from WhatsApp: Settings, Linked Devices, Link a Device.
Check and disconnect:
gsv adapter status --adapter whatsapp --account-id personal
gsv adapter disconnect --adapter whatsapp --account-id personalConnect Discord
Discord needs a bot token. You can provide it during deploy as a Worker secret, or pass it when connecting:
gsv adapter connect --adapter discord --account-id default \
--config-json '{"botToken":"<discord-bot-token>"}'If the token is already configured as DISCORD_BOT_TOKEN, omit --config-json:
gsv adapter connect --adapter discord --account-id default
gsv adapter status --adapter discordInvite the bot with the permissions required by your deployment and enable the Discord Message Content Intent when the bot needs to read message text.
Link External Actors
Inbound messages are not delivered to processes until the external actor is linked to a GSV user.
For direct messages, an unlinked actor receives a challenge:
Link your account by running: gsv auth link CODERun that command as the target user:
gsv auth link CODERoot can link manually when the adapter, account, and actor id are known:
gsv auth link --adapter discord --account-id default --actor-id discord:user:123456 --uid 1000
gsv auth link --adapter whatsapp --account-id personal --actor-id wa:jid:31600000000@s.whatsapp.net --uid 1000Inspect and remove links:
gsv auth link-list
gsv auth unlink --adapter discord --account-id default --actor-id discord:user:123456How Messages Route
- The adapter Worker receives a platform message.
- The Worker calls the Kernel with
adapter.inboundusing a service identity. - The Kernel resolves the adapter/account/actor link to a local uid.
- The message is delivered to the surface-routed process or
init:{uid}. - The Process DO runs the agent loop and emits
chat.*signals. - The Kernel sends replies back through
adapter.send.
Pending human-in-the-loop approvals can be approved or denied from a linked DM surface. Non-DM messages from unlinked actors are dropped.
Troubleshooting
- If
adapter.connectfails, verify the channel Worker was deployed and the Gateway has the correct service binding. - If WhatsApp does not show a QR code, reconnect with
{"force":true}. - If Discord does not respond, check the bot token, gateway status, invite permissions, and Message Content Intent.
- If a message is ignored, check
gsv auth link-listand confirm the actor id is linked to the intended user.