Skip to content

[codex] Fix fork --last cwd filtering#21089

Merged
canvrno-oai merged 2 commits intomainfrom
codex/fork-last-cwd-filter
May 5, 2026
Merged

[codex] Fix fork --last cwd filtering#21089
canvrno-oai merged 2 commits intomainfrom
codex/fork-last-cwd-filter

Conversation

@canvrno-oai
Copy link
Copy Markdown
Contributor

Fixes #20945.

This keeps codex fork --last aligned with the neighboring latest-session lookup flows. The local fork path now uses the same cwd-scope helper as resume --last, which is also a small code cleanup around how this selection logic is shared.

Credit to @chanwooyang1 for the report and for pointing out the narrow fix direction.

What changed:

  • Route fork --last through the shared latest-session cwd filter.
  • Preserve --all as the explicit opt-in for global latest-session selection.
  • Keep remote cwd override behavior unchanged.
  • Add focused coverage for local default, --all, and remote override filter semantics.

Validation:

  • Ran just fmt.
  • Ran git diff --check.
  • Reviewed the fork --last, resume --last, and fork picker selection paths against the issue report.

@canvrno-oai canvrno-oai force-pushed the codex/fork-last-cwd-filter branch from 431d73d to 638b898 Compare May 4, 2026 23:25
@canvrno-oai canvrno-oai marked this pull request as ready for review May 5, 2026 00:01
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@canvrno-oai canvrno-oai merged commit 394242e into main May 5, 2026
26 checks passed
@canvrno-oai canvrno-oai deleted the codex/fork-last-cwd-filter branch May 5, 2026 17:33
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codex fork --last ignores default cwd filtering and can fork a session from another project

2 participants