Skip to content

Preserve replies when terminal chat persistence fails - #299

Closed
hamzamerzic wants to merge 2 commits into
mobius-os:mainfrom
hamzamerzic:fix/chat-reply-durability-20260727
Closed

Preserve replies when terminal chat persistence fails#299
hamzamerzic wants to merge 2 commits into
mobius-os:mainfrom
hamzamerzic:fix/chat-reply-durability-20260727

Conversation

@hamzamerzic

Copy link
Copy Markdown
Collaborator

Summary

  • atomically materialize any saved live assistant before clearing a wedged run
  • append a durable resumable interruption marker when no reply was saved
  • preserve queued messages and unanswered question cards during recovery
  • fence cleanup by run identity so a stale recovery cannot overwrite a newer turn

Context

This hardening was discovered while testing #277. That PR should still normalize its typed image path at the provider boundary; this change independently guarantees that a future terminal persistence failure cannot clear the only recovery handle and leave a silent user-to-user gap.

Tests

  • MOBIUS_TEST_RUNTIME=1 python3 -m pytest -q backend/tests/test_wedged_marker_sweep.py backend/tests/test_chat_writer_contention.py::test_stale_wedged_recovery_cannot_clobber_new_run (13 passed)
  • python3 -m py_compile backend/app/chat.py backend/app/chat_writer.py

Co-authored-by: Möbius Agent <mobius-agent@users.noreply.github.com>
@hamzamerzic hamzamerzic added area: backend Server and API behavior bug Something isn't working labels Jul 28, 2026
@hamzamerzic

Copy link
Copy Markdown
Collaborator Author

Merged to main as part of #304, including the reviewed terminal-persistence recovery and its integration coverage. Closing this now-superseded source PR.

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

Labels

area: backend Server and API behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant