Skip to content

fix(webchat): recover conversations and pair new devices - #158

Open
adriannoes wants to merge 10 commits into
developmentfrom
fix/webchat-and-pairing
Open

adriannoes wants to merge 10 commits into
developmentfrom
fix/webchat-and-pairing

Conversation

@adriannoes

@adriannoes adriannoes commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Give each paired device its own conversation. Restore the transcript after navigation, reload, or a gateway restart. Keep native WebSocket replies in their original format.
  • Save each reply to its own turn. If SQLite is busy, retry the saved reply without calling the model again. If the process stops first, show the turn as interrupted.
  • Accept up to 64 pending HTTP turns across devices. If the queue is full, return HTTP 503 and let the browser retry the same draft. Give WebSocket messages and due jobs a turn while HTTP requests wait.
  • Delete a conversation and its model context together. If a turn is in progress, show the reason and keep the conversation. An operator can pair another device with a temporary code.

Test plan

  • Run the clean Ubuntu gateway suite and static analysis. Send two turns while SQLite blocks a reply. Each turn received its own reply with one model call.
  • Fill the queue, retry a draft with the same ID, and run a due job. The job ran with 63 HTTP turns still pending.
  • Exercise device pairing, isolation, reload, deletion, and a 32,768-byte message in Chromium.
  • Confirm that Sessions shows the HTTP 409 message and keeps the conversation. Resume a conversation with a local model after a reload.

@adriannoes adriannoes added bug Something isn't working documentation Improvements or additions to documentation labels Nov 27, 2026
@adriannoes adriannoes self-assigned this Nov 27, 2026
@adriannoes adriannoes added the review: changes needed The code review found a problem to fix before merge. label Nov 27, 2026
@adriannoes adriannoes added review: ready for approval The code is ready for the required GitHub approval. and removed review: changes needed The code review found a problem to fix before merge. labels Nov 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation review: ready for approval The code is ready for the required GitHub approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant