Skip to content

feat(weixin): add typing indicator support via ilink sendtyping API#558

Open
WEIFENG2333 wants to merge 1 commit intochenhg5:mainfrom
WEIFENG2333:feat/weixin-typing-indicator
Open

feat(weixin): add typing indicator support via ilink sendtyping API#558
WEIFENG2333 wants to merge 1 commit intochenhg5:mainfrom
WEIFENG2333:feat/weixin-typing-indicator

Conversation

@WEIFENG2333
Copy link
Copy Markdown

Summary

  • Implement core.TypingIndicator interface for the Weixin (personal WeChat / ilink) platform
  • Shows a "typing..." bubble in the WeChat conversation while the agent is processing
  • Fetches typing_ticket from ilink/bot/getconfig, caches per peer with 10-minute TTL
  • Proactively refreshes ticket on each inbound message to minimize latency on StartTyping
  • Repeats typing status every 5 seconds and sends best-effort stop on completion

Changes

File What
platform/weixin/types.go Add typingStatusStart/Stop constants, sendTypingReq, getConfigReq/Resp types
platform/weixin/client.go Add getConfig() and sendTyping() API methods
platform/weixin/weixin.go Add StartTyping(), typing ticket cache, proactive ticket refresh on inbound message

Context

The ilink bot HTTP API supports a typing indicator via the ilink/bot/sendtyping endpoint (documented in the OpenClaw/hermes-agent weixin adapter). All other major platforms in cc-connect (Telegram, Discord, Slack, Feishu) already implement core.TypingIndicator, but Weixin was missing it.

The implementation follows the same pattern as Telegram's StartTyping: send an initial status, repeat on a ticker, and stop when the returned function is called. The main difference is that Weixin requires a typing_ticket obtained from getconfig, so we cache it with a TTL and proactively fetch it when messages arrive.

Test Plan

  • go build ./platform/weixin/... — compiles cleanly
  • go test ./platform/weixin/... — all 17 existing tests pass
  • Manual verification with personal WeChat via ilink bot token

Implement the core.TypingIndicator interface for the Weixin (personal
WeChat) platform, showing a "typing..." bubble while the agent is
processing.

- Add getConfig API call to fetch typing_ticket from ilink
- Add sendTyping API call (start/stop) to ilink/bot/sendtyping
- Cache typing tickets per peer with 10-minute TTL
- Proactively refresh ticket on inbound message receipt
- Repeat typing status every 5 seconds (matching Telegram behavior)
- Send best-effort stop signal when processing completes

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Copy link
Copy Markdown
Owner

@chenhg5 chenhg5 left a comment

Choose a reason for hiding this comment

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

LGTM. Simple, clean addition — sendTyping API for WeChat typing indicators. Follows existing client pattern.

PR: #558

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