Skip to content

feat: Phase 2a — Multi-session support#38

Merged
cirvine-MSFT merged 1 commit intomainfrom
feature/phase-2a-multi-session
Mar 8, 2026
Merged

feat: Phase 2a — Multi-session support#38
cirvine-MSFT merged 1 commit intomainfrom
feature/phase-2a-multi-session

Conversation

@cirvine-MSFT
Copy link
Owner

Phase 2a — Multi-Session Support

Adds concurrent chat session support to the Brain and session switching UI to the Web client.

Changes

Brain (CopilotEngine + JsonRpcServer):

  • Enriched SessionInfo with Title, Status (idle/busy), LastActivity, MessageCount
  • Auto-generated session titles with dedup suffixes
  • Status tracking: busy/idle transitions during SendPromptAsync
  • DestroySessionAsync returns bool; new RenameSessionAsync method
  • Thread-safe MessageCount via Interlocked operations
  • Title length validation (max 200 chars)

Web UI (index.html):

  • Rich session cards: agent icon, title, status dot, meta info, delete button
  • Inline rename on double-click
  • Destroy confirmation modal with busy-state warning
  • SignalR push events for cross-tab sync
  • syncSessions() on connect/reconnect
  • XSS prevention via HTML escaping in modal

ChatHub:

  • New DestroySession and RenameSession methods with error handling
  • SignalR broadcast events for session lifecycle

Tests:

  • 18 new multi-session tests (80 total, all passing)

Closes #12, closes #14

Add concurrent chat session support to the Brain and session
switching UI to the Web client.

Brain changes:
- Enrich SessionInfo with Title, Status, LastActivity, MessageCount
- CopilotEngine auto-generates session titles with dedup suffixes
- SendPromptAsync tracks busy/idle status and message counts
- DestroySessionAsync returns bool (true=found, false=not-found)
- New RenameSessionAsync method with title length validation
- Thread-safe MessageCount via Interlocked operations

Web UI changes:
- Rich session cards with agent icon, title, status dot, meta info
- Inline rename on double-click (Enter/Escape/blur)
- Destroy confirmation modal with busy-state warning
- SignalR push events for cross-tab sync (SessionCreated/Destroyed/Updated)
- syncSessions() on connect/reconnect for state reconciliation
- HTML-escaped titles in modal to prevent XSS

ChatHub changes:
- DestroySession and RenameSession methods with error handling
- SessionCreated/SessionDestroyed/SessionUpdated broadcasts
- SendMessage broadcasts SessionUpdated to other clients

Tests:
- 18 new multi-session tests covering auto-title, status tracking,
  message counts, destroy/rename, enriched listing, concurrency

Closes #12, closes #14

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@cirvine-MSFT cirvine-MSFT marked this pull request as ready for review March 8, 2026 23:26
@cirvine-MSFT cirvine-MSFT merged commit 6facaa1 into main Mar 8, 2026
2 checks passed
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.

Web: Session list with status indicators Brain: Multiple concurrent SDK sessions

1 participant