-
Notifications
You must be signed in to change notification settings - Fork 5.7k
enable-resume #3537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable-resume #3537
Conversation
|
||
/// Prompt to send after resuming the session. If `-` is used, read from stdin. | ||
#[arg(value_name = "PROMPT")] | ||
pub prompt: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this is a good one. why aren't we doing the same for codex resume
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we supporting that in tui?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's punt for now but yes. codex "some request"
works.
codex-rs/exec/src/lib.rs
Outdated
} else if let Some(id_str) = args.session_id.as_deref() { | ||
find_conversation_path_by_id_str(&config.codex_home, id_str).await? | ||
} else { | ||
None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does this happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we resume with a --last flag
codex-rs/exec/tests/suite/resume.rs
Outdated
let deadline = Instant::now() + Duration::from_secs(10); | ||
let mut path = None; | ||
while Instant::now() < deadline && path.is_none() { | ||
path = find_session_file_containing_marker(&sessions_dir, &marker); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be only one file in sessions. Why marker search?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just extra confirmation that things are written right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few questions.
}) | ||
.await; | ||
let codex = | ||
resume_conversation_for_server(&server, &codex_home, session_file.clone(), |_| {}).await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we use the mutator?
Ok(()) | ||
} | ||
|
||
async fn resolve_resume_path( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non blocking. Why is this logic specific to exec? We should be doing a very similar thing in tui.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we use find_conversation_path_by_id_str?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah probably in a followup pr
) | ||
.await? | ||
} else { | ||
conversation_manager.new_conversation(config).await? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: can we collapse this line and the one below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just fmt
revert it.
Adding the ability to resume conversations.
we have one verb
resume
.Behavior:
tui
:codex resume
: opens session pickercodex resume --last
: continue last messagecodex resume <session id>
: continue conversation withsession id
exec
:codex resume --last
: continue last conversationcodex resume <session id>
: continue conversation withsession id
Implementation:
~/.codex/sessions/
with aUUID
. This is helpful in resuming with session id.