feat(gateway): add sender presence tracking

This commit is contained in:
William Valentin
2026-02-15 19:28:16 -08:00
parent 421942f66d
commit c6e3d09ecc
11 changed files with 358 additions and 8 deletions
@@ -233,7 +233,7 @@ Flynn actually has MCP support that OpenClaw doesn't emphasise — OpenClaw reli
|---------|----------|-------|--------|
| Streaming & chunking | Full (per-channel limits) | Full (streaming + per-channel chunking) | **MATCH** |
| Typing indicators | Full | Telegram, Discord, WhatsApp (per-adapter) | **MATCH** |
| Presence tracking | Full | -- | **MISSING** |
| Presence tracking | Full | Full (`system.presence` with online/offline inference from recent sender activity) | **MATCH** |
| Web UI token dashboard | Usage visualization (v2026.2.6) | Full (Usage page with summary cards, per-session table, auto-refresh) | **MATCH** |
| Usage tracking / cost | Full | Full (per-tier tokens, estimated cost via MODEL_COSTS) | **MATCH** |
| Markdown rendering | Per-channel formatting | Full (TUI markdown renderer + channel-specific) | **MATCH** |
@@ -261,8 +261,8 @@ Flynn actually has MCP support that OpenClaw doesn't emphasise — OpenClaw reli
| Skills/Plugins | 5 | 4 | 0 | 1 |
| Gateway/Infra | 13 | 8 | 0 | 5 |
| Chat Commands | 6 | 6 | 0 | 0 |
| Misc | 10 | 9 | 0 | 1 |
| **TOTAL** | **128** | **100 (78%)** | **0 (0%)** | **28 (22%)** |
| Misc | 10 | 10 | 0 | 0 |
| **TOTAL** | **128** | **101 (79%)** | **0 (0%)** | **27 (21%)** |
*Note: Match rate improved from 77% to 78% after implementing setup wizard (`flynn setup` + first-run auto-trigger).*
@@ -314,7 +314,6 @@ All five Tier 3 items implemented: Lane Queue (per-session FIFO in gateway), cre
- ~~Onboard wizard — guided setup~~ (DONE — `flynn setup` + first-run auto-trigger, 2026-02-10)
- ClawHub/skill registry — community marketplace
- QMD backend — experimental memory search
- Presence tracking — online/offline status
---
@@ -61,7 +61,6 @@ A gap item is considered implemented when:
### Misc (MISSING)
- Presence tracking
### Companion Apps / Devices (MISSING)
@@ -0,0 +1,27 @@
# Presence Tracking Checklist
Date: 2026-02-16
Status: completed
## Scope
- Add runtime presence tracking for observed senders.
- Expose presence via gateway API for dashboard/ops visibility.
## Completed
- Added presence tracking to `ChannelRegistry`:
- records inbound sender activity (`channel + senderId`)
- tracks `firstSeenAt`, `lastSeenAt`, `messageCount`
- infers `online|offline` from inactivity window
- supports filtering (`channel`, `status`, `limit`)
- Added `system.presence` gateway method via system handlers.
- Wired gateway server to source presence data from `ChannelRegistry`.
- Added tests for registry presence behavior and handler output.
- Updated docs for new API surface.
## Verification
- `pnpm test:run src/channels/registry.test.ts`
- `pnpm test:run src/gateway/handlers/handlers.test.ts`
- `pnpm typecheck`
+23 -3
View File
@@ -203,6 +203,26 @@
],
"test_status": "pnpm test:run src/channels/registry.test.ts src/automation/cron.test.ts src/automation/webhooks.test.ts src/config/schema.test.ts + pnpm typecheck passing"
},
"presence-tracking": {
"file": "2026-02-16-presence-tracking-checklist.md",
"status": "completed",
"date": "2026-02-16",
"updated": "2026-02-16",
"summary": "Implemented sender presence tracking (online/offline inferred from recent activity) in ChannelRegistry and exposed it via new gateway method `system.presence` for operations visibility.",
"files_created": [
"docs/plans/2026-02-16-presence-tracking-checklist.md"
],
"files_modified": [
"src/channels/registry.ts",
"src/channels/registry.test.ts",
"src/gateway/handlers/system.ts",
"src/gateway/handlers/handlers.test.ts",
"src/gateway/server.ts",
"README.md",
"docs/api/PROTOCOL.md"
],
"test_status": "pnpm test:run src/channels/registry.test.ts src/gateway/handlers/handlers.test.ts + pnpm typecheck passing"
},
"skill-safety-scanner": {
"file": "2026-02-15-skill-safety-scanner-checklist.md",
"status": "completed",
@@ -2232,7 +2252,7 @@
},
"overall_progress": {
"total_test_count": 1698,
"total_test_count": 1703,
"all_tests_passing": true,
"p0_completion": "3/3 (100%)",
"p1_completion": "4/4 (100%)",
@@ -2247,12 +2267,12 @@
"tier2_completion": "4/4 (100%) — inbound webhooks, vector memory search, Dockerfile, heartbeat monitor",
"tier3_completion": "5/5 (100%) — lane queue, credential redaction, web UI token dashboard, xAI (Grok) provider, Voyage AI embeddings",
"tier4_completion": "4/4 (100%) — gateway lock, shell completion, Tailscale Serve/Funnel, DM pairing codes",
"feature_gap_scorecard": "106/128 match (83%), 0 partial (0%), 22 missing (17%)",
"feature_gap_scorecard": "107/128 match (84%), 0 partial (0%), 21 missing (16%)",
"operator_dx_milestone": "Phase 3 (Live Ops Dashboard): 2/2 plans complete — milestone done",
"gmail_auth_cli": "flynn gmail-auth command implemented with OAuth2 flow, doctor check, config routed to Telegram",
"native_audio_support": "completed — smart routing for native audio (Gemini/OpenAI/GitHub) vs Whisper transcription fallback",
"remaining_phases_completion": "Phase 1: 3/3 (100%) — context levels, command registry, memory structure. Phase 2: 3/3 (100%) — component registry, confidence routing, history index. Phase 3: 2/2 (100%) — adaptive memory/compaction, truthfulness/autonomy hardening",
"next_up": "Pick the next OpenClaw gap milestone and create a scoped checklist (candidates: presence tracking, QMD backend, ClawHub registry)"
"next_up": "Pick the next OpenClaw gap milestone and create a scoped checklist (candidates: QMD backend, ClawHub registry, Bonjour/mDNS discovery)"
},
"soul_md_and_cron_create": {
"date": "2026-02-11",