mirror of
https://github.com/openai/codex.git
synced 2026-11-01 19:33:35 +00:00
One fix
This commit is contained in:
@@ -103,9 +103,6 @@ enum Subcommand {
|
||||
/// Fork an existing session into a new conversation.
|
||||
Fork(ForkCommand),
|
||||
|
||||
/// Manage saved sessions.
|
||||
Session(SessionCommand),
|
||||
|
||||
/// [EXPERIMENTAL] Browse tasks from Codex Cloud and apply changes locally.
|
||||
#[clap(name = "cloud", alias = "cloud-tasks")]
|
||||
Cloud(CloudTasksCli),
|
||||
@@ -158,18 +155,6 @@ struct ForkCommand {
|
||||
config_overrides: TuiCli,
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct SessionCommand {
|
||||
#[command(subcommand)]
|
||||
action: SessionSubcommand,
|
||||
}
|
||||
|
||||
#[derive(Debug, clap::Subcommand)]
|
||||
enum SessionSubcommand {
|
||||
/// List saved sessions created via `/save <name>`.
|
||||
List,
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct SandboxArgs {
|
||||
#[command(subcommand)]
|
||||
@@ -507,11 +492,6 @@ async fn cli_main(codex_linux_sandbox_exe: Option<PathBuf>) -> anyhow::Result<()
|
||||
let exit_info = codex_tui::run_main(interactive, codex_linux_sandbox_exe).await?;
|
||||
handle_app_exit(exit_info)?;
|
||||
}
|
||||
Some(Subcommand::Session(SessionCommand { action })) => match action {
|
||||
SessionSubcommand::List => {
|
||||
list_saved_sessions_cli().await?;
|
||||
}
|
||||
},
|
||||
Some(Subcommand::Login(mut login_cli)) => {
|
||||
prepend_config_flags(
|
||||
&mut login_cli.config_overrides,
|
||||
@@ -752,35 +732,6 @@ fn print_completion(cmd: CompletionCommand) {
|
||||
generate(cmd.shell, &mut app, name, &mut std::io::stdout());
|
||||
}
|
||||
|
||||
async fn list_saved_sessions_cli() -> anyhow::Result<()> {
|
||||
let codex_home = codex_core::config::find_codex_home()?;
|
||||
let entries = codex_core::list_saved_sessions(&codex_home).await?;
|
||||
if entries.is_empty() {
|
||||
println!("No saved sessions. Run `/save <name>` inside Codex to create one.");
|
||||
return Ok(());
|
||||
}
|
||||
println!(
|
||||
"{:<20} {:<36} {:<20} {:<12} CWD",
|
||||
"NAME", "CONVERSATION ID", "SAVED AT", "MODEL"
|
||||
);
|
||||
for entry in entries {
|
||||
let cid = entry.conversation_id.to_string();
|
||||
println!(
|
||||
"{:<20} {:<36} {:<20} {:<12} {}",
|
||||
entry.name,
|
||||
cid,
|
||||
entry.saved_at,
|
||||
entry.model,
|
||||
entry.cwd.display()
|
||||
);
|
||||
let created = entry.created_at.as_deref().unwrap_or("-");
|
||||
println!("{:<20} created: {}", "", created);
|
||||
println!("{:<20} path: {}", "", entry.rollout_path.display());
|
||||
println!();
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user