feat(platform): replace live reload with granular SSE config file events#942
Conversation
Replace the full-page live reload mechanism with a structured SSE-based config file watcher that pushes granular change events to the frontend. Queries now invalidate their TanStack Query caches on relevant file changes instead of triggering a full page reload, and mutations optimistically update the cache on write.
Switch agent detail and chat agent list from imperative action calls to reactive query hooks (useReadAgent, useListAgents) so the UI automatically updates when SSE config file events arrive. Pluralize config watcher event types to match directory names and sync the editor context with external changes when no unsaved edits exist.
Replace imperative useAction + useState + useEffect pattern with the useListAgents react-query hook, enabling automatic cache invalidation via SSE events instead of manual reload callbacks.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Remove export from ConfigChangeEvent, parseConfigChange, and ConfigWatcher since they are only used within config-watcher.ts. Fixes Knip CI failure.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR comprehensively refactors data-fetching patterns across the platform by replacing manual Estimated code review effort🎯 4 (Complex) | ⏱️ ~70 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
useAction+useState+useEffectpatterns to reactive TanStack Query hooks with automatic cache invalidation via SSE eventsTest plan
/api/config-eventsendpoint)Summary by CodeRabbit
New Features
Improvements