Remove automatic session resume suggestion on startup
- Remove the interactive prompt that asked users to resume in-progress sessions - Remove unused new_session parameter from run_interactive() - Remove unused info_inline() function from G3Status - Explicit --resume <session_id> flag still works
This commit is contained in:
@@ -306,7 +306,6 @@ async fn handle_command(
|
||||
cli.show_code,
|
||||
chat_combined_content,
|
||||
workspace_dir,
|
||||
cli.new_session,
|
||||
None, // agent_name (not in agent mode)
|
||||
None, // initial_project (not supported in accumulative mode yet)
|
||||
)
|
||||
|
||||
@@ -292,7 +292,6 @@ pub async fn run_agent_mode(
|
||||
false, // show_code
|
||||
combined_content,
|
||||
&workspace_dir,
|
||||
flags.new_session,
|
||||
Some(agent_name), // agent name for prompt (e.g., "butler>")
|
||||
initial_project,
|
||||
)
|
||||
|
||||
@@ -144,17 +144,6 @@ impl G3Status {
|
||||
);
|
||||
}
|
||||
|
||||
/// Print info inline (moves cursor up, appends to previous line).
|
||||
pub fn info_inline(message: &str) {
|
||||
print!(
|
||||
"\x1b[1A\x1b[999C {}... {}{}\n",
|
||||
SetForegroundColor(Color::DarkGrey),
|
||||
message,
|
||||
ResetColor
|
||||
);
|
||||
let _ = io::stdout().flush();
|
||||
}
|
||||
|
||||
/// Format a status for inline use (returns formatted string).
|
||||
pub fn format_status(status: &Status) -> String {
|
||||
match status {
|
||||
|
||||
@@ -17,7 +17,7 @@ use g3_core::ToolCall;
|
||||
|
||||
use crate::commands::{handle_command, CommandResult};
|
||||
use crate::display::{LoadedContent, print_loaded_status, print_project_heading, print_workspace_path};
|
||||
use crate::g3_status::{G3Status, Status};
|
||||
use crate::g3_status::G3Status;
|
||||
use crate::project::Project;
|
||||
use crate::project_files::extract_project_heading;
|
||||
use crate::simple_output::SimpleOutput;
|
||||
@@ -195,56 +195,12 @@ pub async fn run_interactive<W: UiWriter>(
|
||||
show_code: bool,
|
||||
combined_content: Option<String>,
|
||||
workspace_path: &Path,
|
||||
new_session: bool,
|
||||
agent_name: Option<&str>,
|
||||
initial_project: Option<Project>,
|
||||
) -> Result<()> {
|
||||
let output = SimpleOutput::new();
|
||||
let from_agent_mode = agent_name.is_some();
|
||||
|
||||
// Check for session continuation (skip if --new-session was passed or coming from agent mode)
|
||||
// Agent mode with --chat should start fresh without prompting
|
||||
if !new_session && !from_agent_mode {
|
||||
if let Ok(Some(continuation)) = g3_core::load_continuation() {
|
||||
// Print session info and prompt on same line (no newline)
|
||||
print!(
|
||||
"\n >> session in progress: {}{}{} | {:.1}% used | resume? [y/n] ",
|
||||
SetForegroundColor(Color::Cyan),
|
||||
&continuation.session_id[..continuation.session_id.len().min(20)],
|
||||
ResetColor,
|
||||
continuation.context_percentage
|
||||
);
|
||||
use std::io::Write;
|
||||
std::io::stdout().flush()?;
|
||||
|
||||
// Read user input
|
||||
let mut input = String::new();
|
||||
std::io::stdin().read_line(&mut input)?;
|
||||
let input = input.trim().to_lowercase();
|
||||
|
||||
if input.is_empty() || input == "y" || input == "yes" {
|
||||
// Resume the session
|
||||
match agent.restore_from_continuation(&continuation) {
|
||||
Ok(true) => {
|
||||
G3Status::resuming(&continuation.session_id, Status::Done);
|
||||
}
|
||||
Ok(false) => {
|
||||
G3Status::resuming_summary(&continuation.session_id);
|
||||
}
|
||||
Err(e) => {
|
||||
G3Status::resuming(&continuation.session_id, Status::Error(e.to_string()));
|
||||
// Clear the invalid continuation
|
||||
let _ = g3_core::clear_continuation();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// User declined, clear the continuation
|
||||
G3Status::info_inline("starting fresh");
|
||||
let _ = g3_core::clear_continuation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Skip verbose welcome when coming from agent mode (it already printed context info)
|
||||
if !from_agent_mode {
|
||||
match agent.get_provider_info() {
|
||||
|
||||
@@ -277,7 +277,6 @@ async fn run_console_mode(
|
||||
cli.show_code,
|
||||
combined_content,
|
||||
project.workspace(),
|
||||
cli.new_session || cli.resume.is_some(), // Skip auto-resume prompt if --resume was used
|
||||
None, // agent_name (not in agent mode)
|
||||
initial_project,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user