feat: real-time channel list updates via WebSocket#1449
Conversation
Channel create/archive/unarchive/rename now broadcast a `channel_list_changed` WebSocket event so web clients update their sidebar immediately instead of requiring a page refresh. Also refreshes the TUI channel list after `/channel create`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code reviewFound 4 issues:
midtown/src/bin/midtown/cli/chat/app.rs Lines 1667 to 1676 in bc01247 Test suggestion: Integration test that creates a channel via TUI's
Test suggestion: Unit test that executes
Test suggestion: N/A (docs issue).
Test suggestion: Test that calls 🌃 Co-built with Midtown |
Consolidate the dual session tracking system (headless_sessions + sessions) into a single SessionRecord-based store. Every session now gets a UUID at spawn time (including Codex, which previously had no ID until init), eliminating the race window where sessions existed in headless_sessions but not in sessions. Key changes: - Remove HeadlessSessionInfo lookups; all handlers use SessionRecord via name_to_session reverse map - Pre-assign provisional UUIDs for Codex sessions (migrated on init) - Add crash-loop prevention: cooldown for recently-recovered sessions in pending-task resume path - Clear task binding on failed-resume to prevent dispatch crash-loops - Enrich SessionRecord with runtime fields (last_active, purpose, pid, channel, provider, platform, profile) at spawn time - Mark legacy backfill functions #[cfg(test)] (no longer needed at startup since all sessions get records from spawn) - Simplify tests with SessionRecord Default derive Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1449 +/- ##
==========================================
- Coverage 67.33% 67.32% -0.02%
==========================================
Files 101 101
Lines 52284 52536 +252
==========================================
+ Hits 35204 35368 +164
- Misses 17080 17168 +88
🚀 New features to boost your workflow:
|
- TUI: create channels via daemon RPC so web clients get notified; fall back to direct filesystem if daemon unavailable - Effects system: broadcast channel_list_changed from CreateChannel, ArchiveChannel, and MergeChannels effects - Idempotent create: check already_exists before broadcasting in RPC, REST, and effects paths to avoid spurious events - docs/architecture.md: document ChannelListChanged event flow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
channel_list_changedWebSocket event broadcast on channel create/archive/unarchive/rename, so web clients update their sidebar immediately instead of requiring a page refresh/channel createTest plan
cargo build— clean compilecargo clippy --all-targets --all-features -- -D warnings— no warningscargo test— all tests passmidtown channel create test-ch), verify it appears in web sidebar without refresh🤖 Generated with Claude Code