forked from openai/codex
## Why `--worktree` previously supported only `codex exec` and `codex exec fork`. Interactive sessions need the same managed checkout support, with configuration and policy resolved for the destination before starting a turn. ## What changed - Enable `codex --worktree` and `codex fork --worktree <session-id>` behind the `worktrees` feature, restricted to local sessions. Interactive forks require an explicit session selector. - Resolve interactive and exec worktree forks from the session's latest saved working directory unless `--cd` is supplied. Keep relative `--add-dir` paths anchored to the invocation directory. - Load interactive destination configuration before telemetry and login policy initialization, and bind checkout ownership before the first turn. - Reject explicitly untrusted sources, including when destination cloud policy or refreshed configuration reveals distrust. Retain unbound interactive checkouts after startup failure and report manual recovery instructions. ## Testing Add CLI integration and TUI tests for startup and named forks, destination instructions and configuration, ownership before the first request, trust enforcement, and retained-checkout recovery. Extend exec coverage for saved fork directories, explicit `--cd`, relative writable roots, and cloud policy rejection. GitOrigin-RevId: 371583f7feca73b218a4ff188b2b85812c8439e6 |
History
|
|
|---|---|---|
| .. | ||
| add_dir.rs | ||
| agents_md.rs | ||
| apply_patch.rs | ||
| approval_policy.rs | ||
| auth_env.rs | ||
| completion_backfill_tests.rs | ||
| ephemeral.rs | ||
| hooks.rs | ||
| mcp_required_exit.rs | ||
| mod.rs | ||
| originator.rs | ||
| output_schema.rs | ||
| prompt_stdin.rs | ||
| resume.rs | ||
| sandbox.rs | ||
| seatbelt.rs | ||
| server_error_exit.rs | ||
| worktree.rs | ||