/remote-control command to enable remote message-driven operations. It uses an active WebSocket persistent connection, requiring no public IP address and offering the simplest configuration.codebuddy --version/login after codebuddy.


aibVGv7I...)
export CODEBUDDY_WECOM_BOT_ID="<Your Bot ID>"export CODEBUDDY_WECOM_BOT_SECRET="<Your Bot Secret>"
Environment Variable | Description | Default Value |
CODEBUDDY_WECOM_BOT_ID | AI Bot ID (required) | — |
CODEBUDDY_WECOM_BOT_SECRET | AI Bot Secret (required) | — |
CODEBUDDY_WECOM_BOT_WS_URL | WebSocket service address (used for private deployment) | wss://openws.work.weixin.qq.com |
# ~/.zshrc or ~/.bashrcexport CODEBUDDY_WECOM_BOT_ID="<Your Bot ID>"export CODEBUDDY_WECOM_BOT_SECRET="<Your Bot Secret>"
codebuddy
/remote-control
wecom-bot entry, and press Enter to initiate the connection:Remote Control Clients1. • wecom-bot [disconnected] (Press Enter to connect)2. • centrifugo [disconnected]3. Cancel
/remote-control again to view the connection status:1. • wecom-bot [connected] (Press Enter to disconnect)2. Cancel
disconnected — Not connected. You can initiate a connection.connecting — Connecting. Please wait.connected — Connected. You can choose to disconnect.Operation | Description |
↑ / ↓ | Select a client entry. |
j / k | Vim-style navigation (equivalent to the up and down arrow keys) |
Enter | Connect (in the disconnected state) or disconnect (in the connected/connecting state). |
Esc | Exit the panel (no response while an operation is in progress). |
A user sends a message in WeCom.↓ Messages are pushed in real time over a persistent WebSocket connection.CodeBuddy CLI receives messages.↓ Reply within 5 seconds (to meet the WeCom callback timeout requirement).Send a streaming message (stream finish=false): "Processing, please wait..."↓ The WeCom client displays the streaming message.The Agent is processing... (Processing may take from 1 second to 5+ minutes.)↓Processing complete. Send a streaming message (stream finish=true): Final result.↓ The WeCom client fully replaces "Processing..." with the final result.WeCom users see the final reply (only the final result is retained in the chat history).
aibot_respond_msg stream type):finish=false, containing "Processing, please wait...".finish=true + the final result using the same stream.id.finish=true, it replaces the previously displayed "Processing..." with the full content.Phase | Chat Window Display | Description |
After a message is sent | Processing, please wait... | Streaming message placeholder, indicating that the Bot is processing. |
After processing is complete | Final response content | "Processing..." is replaced in place by the final result. |
Aspect | Legacy Solution (Text Message ack) | New Solution (Streaming Message Replacement) |
Processing... | Permanently retained in chat history | Replaced in place by the final result |
Chat history | 2 messages (ack + result) | 1 message (final result only) |
Status indication | Yes | Yes |
aibot_send_msg, valid for 24 hours).A WeCom user sends a message.↓WeCom server (WebSocket connection pool)↓ Real-time push over a persistent WebSocket connectionCodeBuddy CLI(WecomBotClient)↓CodeBuddy Agent processes the message and generates a reply.↓Reply with a message over the same WebSocket connection.↓A WeCom user receives a reply from the Bot.
aibot_subscribe frame with bot_id + secret to complete authentication.aibot_msg_callback frame.aibot_respond_msg frame.ping frame every 30 seconds to keep the connection alive.wecom-bot is selected in the /remote-control panel.Error: WeChat Work AI Bot is not configured.Missing environment variables: CODEBUDDY_WECOM_BOT_ID, CODEBUDDY_WECOM_BOT_SECRET
CODEBUDDY_WECOM_BOT_ID and CODEBUDDY_WECOM_BOT_SECRET have been set.echo $CODEBUDDY_WECOM_BOT_ID to verify whether the environment variable takes effect./remote-control again to attempt the connection.wss://openws.work.weixin.qq.com is accessible.CODEBUDDY_WECOM_BOT_WS_URL is set correctly.curl -v wss://openws.work.weixin.qq.comcodebuddy, stay on the main interface and observe the output during the connection process./remote-control and confirm that the wecom-bot status is connected.disconnected, reconnect./remote-control connection is temporary and is not persisted. After each restart of CodeBuddy CLI, you need to run /remote-control again and select wecom-bot to establish a connection.# ~/.zshrc or ~/.bashrcexport CODEBUDDY_WECOM_BOT_ID="<Your Bot ID>"export CODEBUDDY_WECOM_BOT_SECRET="<Your Bot Secret>"# Optional: Create an alias for quick startup and automatic connection.alias cbc-wecom='codebuddy -c "/remote-control"'
-c parameter indicates that the specified command is automatically executed at startup.CODEBUDDY_WECOM_BOT_SECRET environment variable.Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback