How it works
Each channel adapter follows the same pattern:- Inbound — receives messages from the platform (via webhook, WebSocket, etc.), parses them into a normalized
InboundMessage, deduplicates, applies bot-loop protection, and dispatches through the Gateway. - Outbound — delivers agent replies back to the platform through the platform’s send API.
agentscope-extensions-channel-common:
- IdempotencyStore — deduplicates retried webhook deliveries by message id.
- BotLoopGuard — per-peer rate limiter that prevents runaway bot-to-bot loops.
- AccessTokenStore — caches the outbound access token used for platform API calls.
Multi-instance deployments
The common utilities keep state in the JVM by default (IdempotencyStore,
InMemoryAccessTokenStore), which only sees a single process. When channel adapters run on
several replicas — behind a load balancer, or one process per bot — construct them through the
fromProperties overload that accepts shared-storage implementations:
- A shared
InboundEventDeduplicatorrecognizes platform redeliveries across instances. - A shared
AccessTokenStore(Feishu, WeCom, DingTalk) lets one replica’s token refresh or invalidation serve the whole deployment, instead of each replica fetching and caching its own token for the same credential.
Shared dependency
Every channel adapter depends onagentscope-extensions-channel-common (included transitively) and agentscope-harness (provided at runtime by your application).