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..95825ce 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,37 @@ 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");