feat: agent session management — metrics, channels, dispose (P2-006)

Add session monitoring and lifecycle improvements to the gateway:
- Session metrics: createdAt, promptCount, durationMs tracking
- Channel tracking: which channels (websocket, discord) are connected
- REST API at /api/sessions for listing, inspecting, and destroying sessions
- Fix piSession.dispose() call in destroySession (FIX-01)
- WebSocket gateway now tracks channel connections per session

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 22:35:37 -05:00
parent f3a7eadcea
commit c56d32e40d
6 changed files with 116 additions and 3 deletions

View File

@@ -26,8 +26,8 @@
| P2-002 | done | Phase 2 | Multi-provider support — Anthropic + Ollama | #74 | #20 |
| P2-003 | done | Phase 2 | Agent routing engine — cost/capability matrix | #75 | #21 |
| P2-004 | done | Phase 2 | Tool registration — brain, queue, memory tools | #76 | #22 |
| P2-005 | in-progress | Phase 2 | @mosaic/coord — migrate from v0, gateway integration | | #23 |
| P2-006 | not-started | Phase 2 | Agent session management — tmux + monitoring | — | #24 |
| P2-005 | done | Phase 2 | @mosaic/coord — migrate from v0, gateway integration | #77 | #23 |
| P2-006 | in-progress | Phase 2 | Agent session management — tmux + monitoring | — | #24 |
| P2-007 | not-started | Phase 2 | Verify Phase 2 — multi-provider routing works | — | #25 |
| P3-001 | not-started | Phase 3 | apps/web scaffold — Next.js 16 + BetterAuth + Tailwind | — | #26 |
| P3-002 | not-started | Phase 3 | Auth pages — login, registration, SSO redirect | — | #27 |