Gen 2 improvements from build-zulip-plugin contract run: 1. Background dedup maintenance task - _dedup_cleanup_forever() runs every 120s, pruning stale entries - _is_duplicate() is now pure O(1) — no per-call cleanup overhead - Cleanup is cancelled gracefully on disconnect 2. Self-test diagnostics (selftest()) - 8 checks: connection, queue, HTTP client, bot identity, poll loop, dedup cleanup, echo prevention, @all-bots configuration - Returns structured verdict: healthy / degraded / critical_failure - Verifies every Success Criterion from the contract 3. Health stats tracking (get_health_stats()) - Uptime, poll counts/errors, message routing counts, send stats - Error rate computation, dedup map size - Suitable for periodic RA-H OS knowledge graph logging 4. Dynamic @all-bots resolution - _resolve_all_bots_user_id() queries Zulip /api/v1/users on connect - Falls back to configured env var or hardcoded default (1) - Eliminates fragile hardcoded default in multi-bot deployments 5. Connection lifecycle now manages both poll_task and dedup_cleanup_task - Both cancelled gracefully on disconnect() - dedup task starts in connect() after queue registration
Builds on the NousResearch Hermes Agent plugin system: - plugins/platforms/zulip/ — full BasePlatformAdapter implementation - Zulip event queue polling (like pi-zulip-extension) - DM-first + @mention + @all-bots routing - Placeholder→edit streaming UX - Typing indicators - Deduplication and echo-loop prevention - Auto-registers via register(ctx) — zero core changes - plugin.yaml with full env var schema - hermes-zulip-plugin/DEPRECATED.md — migration guide from old subprocess-based service Configuration: Env vars: ZULIP_SITE, ZULIP_EMAIL, ZULIP_API_KEY (required) Config: platforms.zulip.extra in Hermes config.yaml