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

Merged
jason.woltje merged 1 commits from feat/p2-006-session-management into main 2026-03-13 03:35:59 +00:00
Owner

Summary

  • Added session metrics tracking (createdAt, promptCount, durationMs) to AgentService
  • Added channel tracking per session (websocket, discord connections)
  • New REST API: GET/DELETE /api/sessions, GET /api/sessions/:id
  • Fixed piSession.dispose() in destroySession (resolves FIX-01 #62)
  • WebSocket gateway now registers/unregisters channel connections

Test plan

  • pnpm format:check — pass
  • pnpm typecheck — pass (18/18)
  • pnpm lint — pass (18/18)
  • CI pipeline green
  • Verify GET /api/sessions returns session list
  • Verify session metrics update after prompts

Closes #24

Generated with Claude Code

## Summary - Added session metrics tracking (createdAt, promptCount, durationMs) to AgentService - Added channel tracking per session (websocket, discord connections) - New REST API: GET/DELETE /api/sessions, GET /api/sessions/:id - Fixed piSession.dispose() in destroySession (resolves FIX-01 #62) - WebSocket gateway now registers/unregisters channel connections ## Test plan - [x] pnpm format:check — pass - [x] pnpm typecheck — pass (18/18) - [x] pnpm lint — pass (18/18) - [ ] CI pipeline green - [ ] Verify GET /api/sessions returns session list - [ ] Verify session metrics update after prompts Closes #24 Generated with [Claude Code](https://claude.com/claude-code)
jason.woltje added 1 commit 2026-03-13 03:35:55 +00:00
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>
jason.woltje merged commit 7f6dc43a2d into main 2026-03-13 03:35:59 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#78