Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions agent/prompt_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ def _strip_yaml_frontmatter(content: str) -> str:
"only — no markdown, no formatting. SMS messages are limited to ~1600 "
"characters, so be brief and direct."
),
"wechat": (
"You are on WeChat, China's dominant messaging platform. "
"Do not use markdown — it does not render in WeChat. Use plain text only. "
"Keep responses concise. You can send images by including image URLs in "
"your response — they will be sent as native WeChat image messages. "
"WeChat messages are limited to 2048 characters, so be direct and brief."
),
}

CONTEXT_FILE_MAX_CHARS = 20_000
Expand Down
1 change: 1 addition & 0 deletions cron/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def _deliver_result(job: dict, content: str) -> None:
"mattermost": Platform.MATTERMOST,
"homeassistant": Platform.HOMEASSISTANT,
"dingtalk": Platform.DINGTALK,
"wechat": Platform.WECHAT,
"email": Platform.EMAIL,
"sms": Platform.SMS,
}
Expand Down
2 changes: 1 addition & 1 deletion gateway/channel_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def build_channel_directory(adapters: Dict[Any, Any]) -> Dict[str, Any]:
logger.warning("Channel directory: failed to build %s: %s", platform.value, e)

# Telegram, WhatsApp & Signal can't enumerate chats -- pull from session history
for plat_name in ("telegram", "whatsapp", "signal", "email", "sms"):
for plat_name in ("telegram", "whatsapp", "signal", "email", "sms", "wechat"):
if plat_name not in platforms:
platforms[plat_name] = _build_from_sessions(plat_name)

Expand Down
16 changes: 16 additions & 0 deletions gateway/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Platform(Enum):
EMAIL = "email"
SMS = "sms"
DINGTALK = "dingtalk"
WECHAT = "wechat"
API_SERVER = "api_server"
WEBHOOK = "webhook"

Expand Down Expand Up @@ -770,6 +771,21 @@ def _apply_env_overrides(config: GatewayConfig) -> None:
if webhook_secret:
config.platforms[Platform.WEBHOOK].extra["secret"] = webhook_secret

# WeChat (WeixinClawBot)
wechat_token = os.getenv("WECHAT_BOT_TOKEN")
if wechat_token:
if Platform.WECHAT not in config.platforms:
config.platforms[Platform.WECHAT] = PlatformConfig()
config.platforms[Platform.WECHAT].enabled = True
config.platforms[Platform.WECHAT].token = wechat_token
wechat_home = os.getenv("WECHAT_HOME_CHANNEL")
if wechat_home:
config.platforms[Platform.WECHAT].home_channel = HomeChannel(
platform=Platform.WECHAT,
chat_id=wechat_home,
name=os.getenv("WECHAT_HOME_CHANNEL_NAME", "Home"),
)

# Session settings
idle_minutes = os.getenv("SESSION_IDLE_MINUTES")
if idle_minutes:
Expand Down
Loading