Skip to content

Persist the exchange while it happens (#197) - #217

Merged
bencode merged 1 commit into
mainfrom
feat/persist-exchange-in-flight
Oct 26, 2026
Merged

bencode merged 1 commit into
mainfrom
feat/persist-exchange-in-flight

Conversation

@bencode

@bencode bencode commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Messages reached IndexedDB only when a reply finished, so a tab killed mid-answer lost the question and every streamed word, leaving a titled conversation that opens empty.

  • the reader's message is written the moment it is sent, through appendStoredConversationMessages, before the run starts
  • pagehide and hidden visibilitychange flush every answering conversation — the open one and any in the background — writing pending messages and the partial reply, marked stopped
  • a run that survives the flush overwrites the partial with its finished message, as counts are not advanced past it
  • a failed write reports through the existing storage warning; the run goes on and the message_end persist retries

Refs #197

… written as it is sent and the streamed reply is flushed as the tab hides or goes
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.

1 participant