From 8aae979f0ec8553cf9513396d407efba8a3247b3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 25 May 2026 12:07:24 +0000 Subject: [PATCH 1/2] fix: persist follow-up user messages to session history MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CHANGELOG.md | 3 +++ tauri/src/services/session_manager.rs | 34 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 329ba10..bcadace 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ ## May 2026 +### 05/25 · Fix — Follow-up messages stay in chat after restart +Messages you send after the first prompt in a session are now saved with the session history. Restarting Orbit or reopening a session no longer drops those follow-up prompts from the chat feed. + ### 05/25 · Fix — OpenCode provider list uses global config again The OpenCode provider and model lists again come from OpenCode's own cache and global config instead of the Orbit repo MCP file. Default OpenCode providers are no longer blocked as "not configured"; Orbit now lets the OpenCode CLI handle provider auth and errors the same way it did before. diff --git a/tauri/src/services/session_manager.rs b/tauri/src/services/session_manager.rs index 0cb168a..7429122 100644 --- a/tauri/src/services/session_manager.rs +++ b/tauri/src/services/session_manager.rs @@ -1017,6 +1017,13 @@ impl SessionManager { }; state.next_seq += 1; state.entries.push(user_entry.clone()); + let user_line = serde_json::json!({ + "type": "user", + "message": { "content": &text }, + "timestamp": &user_entry.timestamp + }) + .to_string(); + let _ = m.db.insert_output(session_id, &user_line); let _ = app.emit( "session:output", serde_json::json!({ @@ -1725,6 +1732,33 @@ mod tests { ); } + #[test] + fn should_restore_follow_up_user_message_from_db() { + let mut t = TestCase::new("should_restore_follow_up_user_message_from_db"); + t.phase("Seed"); + let db = make_db(); + let sid = db + .create_session(None, None, "/tmp", "ignore", None, None, None, None) + .expect("session"); + seed_outputs(&db, sid, &[&crate::test_utils::user_text("Also fix the tests")]); + t.phase("Act"); + let mut sm = SessionManager::new(Arc::clone(&db)); + sm.restore_from_db(); + t.phase("Assert"); + let journal = sm.get_journal(sid); + t.len("one user entry", &journal, 1); + t.eq( + "follow-up text restored", + journal[0].text.as_deref(), + Some("Also fix the tests"), + ); + t.eq( + "entry type", + journal[0].entry_type, + crate::models::JournalEntryType::User, + ); + } + #[test] fn should_not_duplicate_entries_on_double_restore() { let mut t = TestCase::new("should_not_duplicate_entries_on_double_restore"); From 11da5ca4b4bc64f50b05b7467563c06b0c6ac086 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 25 May 2026 15:01:32 +0000 Subject: [PATCH 2/2] chore: rustfmt session_manager test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: José Fernando --- tauri/src/services/session_manager.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tauri/src/services/session_manager.rs b/tauri/src/services/session_manager.rs index 7429122..95825ce 100644 --- a/tauri/src/services/session_manager.rs +++ b/tauri/src/services/session_manager.rs @@ -1740,7 +1740,11 @@ mod tests { let sid = db .create_session(None, None, "/tmp", "ignore", None, None, None, None) .expect("session"); - seed_outputs(&db, sid, &[&crate::test_utils::user_text("Also fix the tests")]); + seed_outputs( + &db, + sid, + &[&crate::test_utils::user_text("Also fix the tests")], + ); t.phase("Act"); let mut sm = SessionManager::new(Arc::clone(&db)); sm.restore_from_db();