Merge sessions/interactive/213d9910

This commit is contained in:
Dhanji R. Prasanna
2026-02-05 13:05:57 +11:00

View File

@@ -41,10 +41,9 @@ pub async fn run_agent_mode(
std::env::set_current_dir(&workspace_dir)?; std::env::set_current_dir(&workspace_dir)?;
// Check for incomplete agent sessions before starting a new one // Check for incomplete agent sessions before starting a new one
// Skip session resume entirely when in chat mode (--agent --chat) // When --resume is explicitly provided, always honor it (even in chat mode)
let resuming_session = if chat { // Otherwise, chat mode starts fresh (no auto-resume of incomplete sessions)
None // Chat mode always starts fresh let resuming_session = if let Some(ref session_id) = flags.resume {
} else if let Some(ref session_id) = flags.resume {
// Explicit --resume flag takes precedence // Explicit --resume flag takes precedence
match g3_core::load_continuation_by_id(session_id) { match g3_core::load_continuation_by_id(session_id) {
Ok(continuation) => { Ok(continuation) => {
@@ -63,6 +62,9 @@ pub async fn run_agent_mode(
std::process::exit(1); std::process::exit(1);
} }
} }
} else if chat {
// Chat mode without explicit --resume starts fresh (no auto-resume)
None
} else if flags.new_session { } else if flags.new_session {
if !chat { if !chat {
output.print("\n🆕 Starting new session (--new-session flag set)"); output.print("\n🆕 Starting new session (--new-session flag set)");