Skip to content

Platform: presence keepalive, @all/@everyone mentions, reserve all/everyone, agent-doc guidance - #40

Merged
Aztec03hub merged 1 commit into
mainfrom
feat-platform-keepalive-mentions
Jun 25, 2026
Merged

Platform: presence keepalive, @all/@everyone mentions, reserve all/everyone, agent-doc guidance#40
Aztec03hub merged 1 commit into
mainfrom
feat-platform-keepalive-mentions

Conversation

@Aztec03hub

Copy link
Copy Markdown
Owner

Four backend + agent-doc platform changes, no web/composer files touched.

(A) Presence keepalive — stop active agents flapping offline

  • Raised DEFAULT_CONNECTION_TTL_SECONDS 180 -> 600 (presence.py) and presence.connection_ttl_seconds 180 -> 600 (config.py). 10 min gives normal agent poll cadences (~4-5 min) headroom so slow pollers no longer get swept between polls.
  • PresenceManager.ensure_connection now RE-PUBLISHES an "online" presence event when it RESURRECTS a previously-swept connection (mirrors _publish_offline): new _publish_online + _schedule_online_publish post a retained payload to claude-comms/presence/{key}/{conn_key} so the web userlist and other clients see the agent return, not just the in-memory registry. Best-effort and non-blocking (scheduled on the running loop; no-op outside one).
  • Verified every read/poll tool already calls _touch: comms_read, comms_thread_read, comms_history, comms_check, comms_members. Added a regression guard test pinning this.

(B) @all / @everyone mention -> ping everyone present

  • New is_broadcast_mention / BROADCAST_MENTION_TOKENS in mention.py (case-insensitive, with/without leading @).
  • tool_comms_send expands a broadcast token to the keys of all PRESENT (online) conversation members. Normal mentions mixed in are unioned (order-preserving, dedup'd). This is broadcast-highlight metadata, not a whisper/recipients change.
  • Design choices (sensible defaults): only ONLINE/present members are included (offline members can't receive a cue anyway); the SENDER is excluded (you don't ping yourself on your own broadcast).

(C) Reserve all and everyone as usernames

  • tool_comms_join (first-time name) and tool_comms_update_name (rename) now reject all / everyone (case-insensitive) with a clear error, so nobody can impersonate the broadcast token.

(D) Agent-doc guidance (participant + facilitator)

  • Collective/room address ("boys", "team", "all", "everyone", "folks", ...) is explicitly "directed at YOU — respond and act, don't wait to be named individually".
  • Threaded replies: do NOT use reply_to at all (feature not fleshed out); top-level in-channel messages only.

Tests

  • Full suite green: 1494 passed, 1 skipped. ruff format + ruff check clean. basedpyright: no new diagnostics (only pre-existing config.py:165 errors remain).

Deploy note

Backend behavior change — needs a desktop redeploy to take effect.

🤖 Generated with Claude Code

…, reserve all/everyone, agent-doc guidance
@Aztec03hub
Aztec03hub merged commit f7bbb7d into main Jun 25, 2026
7 of 8 checks passed
@Aztec03hub
Aztec03hub deleted the feat-platform-keepalive-mentions branch June 25, 2026 21:55
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.

1 participant