Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WebSocket-based chat sync and fix reasoning support #753

Open
wants to merge 77 commits into
base: main
Choose a base branch
from

Conversation

AtlantisPleb
Copy link
Contributor

This PR adds WebSocket-based chat sync and fixes several issues with the current implementation:

Changes

  1. Added WebSocket-based chat sync:
  • Proper WebSocket connection management
  • Real-time message streaming
  • Better error handling
  • Improved state management
  1. Fixed issues with chat handlers:
  • Unified message handling
  • Proper error type bounds
  • Better state access patterns
  • Improved connection lifecycle
  1. Improved sync engine:
  • Removed manual SSE parsing
  • Added proper WebSocket protocol
  • Better state management
  • Proper cleanup

Key Files Changed

  • backend/src/server/ws/handlers/chat.rs - WebSocket chat handler
  • backend/src/server/ws/transport.rs - WebSocket transport layer
  • backend/src/server/ws/mod.rs - WebSocket module setup
  • frontend/app/lib/agentsync/hooks/useAgentSync.ts - Frontend sync hook

Testing

All tests are passing locally. The changes have been tested with:

  • New chat sessions
  • Follow-up messages
  • Error cases
  • Connection handling
  • State management

Related Issues

Closes #730 - Design and Implement Real-Time Sync Engine
Closes #733 - Implement initial agentsync hook
Closes #740 - Implement first message persistence
Closes #750 - Add reasoning support
Closes #751 - Refactor chat sync to use WebSocket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant