Skip to content

fix: persist follow-up user messages after app restart#44

Merged
xinnaider merged 2 commits into
devfrom
cursor/critical-correctness-bugs-ddf6
May 25, 2026
Merged

fix: persist follow-up user messages after app restart#44
xinnaider merged 2 commits into
devfrom
cursor/critical-correctness-bugs-ddf6

Conversation

@cursor

@cursor cursor Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

Follow-up messages sent after the initial session prompt were shown in the live chat but not written to SQLite. After restarting Orbit or reloading a session from the database, those user prompts disappeared from the feed — silent data loss for multi-turn conversations.

Root cause

create_session was updated to persist the first user message via insert_output, but SessionManager::send_message only updated in-memory journal_states and emitted session:output without storing the JSONL line. load_session_journal / restore_from_db only replay rows from session_outputs.

Fix

  • Persist follow-up user messages in send_message using the same Claude-style user JSONL format as session creation.
  • emit_spawn_started already skips duplicate user lines when the journal contains the same text, so no double-write on spawn.
  • Added should_restore_follow_up_user_message_from_db integration test.

Validation

  • cargo test --lib restore_follow_up (pass)
Open in Web View Automation 

cursoragent and others added 2 commits May 25, 2026 12:07
Follow-up prompts from send_message were kept in memory only; restarting
Orbit dropped them from the chat. Mirror create_session by writing the user
JSONL line to session_outputs before spawn.

Co-authored-by: José Fernando <xinnaider@users.noreply.github.com>
Co-authored-by: José Fernando <xinnaider@users.noreply.github.com>
@xinnaider xinnaider marked this pull request as ready for review May 25, 2026 15:34
@xinnaider xinnaider merged commit da55b98 into dev May 25, 2026
7 checks passed
@xinnaider xinnaider deleted the cursor/critical-correctness-bugs-ddf6 branch May 28, 2026 03:24
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.

2 participants