-
Notifications
You must be signed in to change notification settings - Fork 6.5k
codex-exec: allow resume --last to read prompt #6717 #6719
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,7 +95,7 @@ pub struct ResumeArgs { | |
| pub session_id: Option<String>, | ||
|
|
||
| /// Resume the most recent recorded session (newest) without specifying an id. | ||
| #[arg(long = "last", default_value_t = false, conflicts_with = "session_id")] | ||
| #[arg(long = "last", default_value_t = false)] | ||
| pub last: bool, | ||
|
|
||
| /// Prompt to send after resuming the session. If `-` is used, read from stdin. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Removing Useful? React with 👍 / 👎.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is correct, but I'm not sure how to express this more cleanly with clap. |
||
|
|
||
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.
Dropping conflicts_with = "session_id" was safe here:
The only time clap used that constraint was to reject resume --last when was parsed as SESSION_ID. We now re-interpret that positional as the prompt whenever --last is set.
Users can still run resume <SESSION_ID> without --last; the parser still sets session_id and leaves last false, so nothing changes for that flow.
If someone deliberately provides both an ID and --last, we prefer the session_id path because we only treat the positional as a prompt when last is true and no explicit prompt was supplied. So accidental conflicts disappear, and intentional resume --last -- session-id (if someone tried) still resolves consistently.
Clap doesn’t need the explicit conflicts_with once the parser logic distinguishes the cases.