-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Ask for cwd choice when resuming session from different cwd #9731
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
Ask for cwd choice when resuming session from different cwd #9731
Conversation
|
@codex review this |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7dc8bd072
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
| @@ -0,0 +1,281 @@ | |||
| use std::path::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.
This CWD prompt is consistent with other full‑screen startup overlays in the TUI. The codebase has two UI patterns:
1) Full‑screen, bespoke overlays (custom WidgetRef)
Handwritten screens that render their own layout:
codex-rs/tui/src/update_prompt.rs(update available)codex-rs/tui/src/oss_selection.rs(OSS provider selection)codex-rs/tui/src/onboarding/*(welcome/auth/trust screens)codex-rs/tui/src/resume_picker.rs(resume/fork picker)
These use shared low‑level helpers like ColumnRenderable, selection_option_row, and key_hint—the same approach as the CWD prompt.
2) Bottom‑pane popups with shared components
Reusable selection/popup system used inside the chat UI:
codex-rs/tui/src/bottom_pane/selection_popup_common.rscodex-rs/tui/src/bottom_pane/list_selection_view.rs- many
chatwidgetpopups viaSelectionViewParams
Conclusion: For a startup/resume prompt, a bespoke full‑screen overlay is aligned with existing practice. There isn’t a single generic modal used across all startup screens, and
this prompt already reuses the common low‑level helpers.
|
Love this! |
joshka-oai
left a comment
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.
LGTM
|
@codex review this |
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.
💡 Codex Review
Lines 811 to 814 in 82e97f6
| let init = self.chatwidget_init_for_forked_or_resumed_thread( | |
| tui, | |
| self.config.clone(), | |
| ); |
When the new cwd prompt returns CwdSelection::Session, resume_config.cwd can differ from self.config.cwd, but the resumed widget is still initialized with self.config.clone(). That leaves the UI using the old cwd even though the underlying thread was spawned with the selected cwd, which is observable because history_cell::new_session_info renders config.cwd and chatwidget::skills::set_skills_from_response filters skills by self.config.cwd. This mismatch occurs specifically when resuming from a different directory and choosing the session directory.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfec8cf863
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c1188001c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad265edd7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5d60581 to
a02710a
Compare
|
@codex review this |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a02710a7fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a02710a7fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
--add-dirbehavior across resume/fork by normalizing relative roots to absolute paths once (based on the original cwd).TurnContext.cwdfor resume/fork prompts but fall back toSessionMeta.cwdif the latest cwd no longer exists.Details
ConfigBuilderwhen resuming into a different cwd; carry forward runtime approval/sandbox overrides.normalize_harness_overrides_for_cwdto resolve relativeadditional_writable_rootsagainst the initial cwd before reuse.read_session_cwdwith filesystem existence check for the latestTurnContext.cwd.And proof the model understands the new cwd: