codex/codex-rs/exec/tests/suite
Benjamin Carlsson 3525845978 Support managed worktrees for interactive sessions and forks (#43069)
## 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 2026-09-05 18:06:26 +00:00
..
add_dir.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
agents_md.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
apply_patch.rs Support managed AWS access keys for Amazon Bedrock (#40481) 2026-08-24 21:39:48 +00:00
approval_policy.rs Add an --approve-for-me CLI flag (#36373) 2026-07-31 18:26:04 +00:00
auth_env.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
completion_backfill_tests.rs Backfill completion items only for the active exec turn (#34226) 2026-07-19 20:36:18 +00:00
ephemeral.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
hooks.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
mcp_required_exit.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
mod.rs Add managed worktrees to codex exec (#42652) 2026-09-04 01:56:38 +00:00
originator.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
output_schema.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
prompt_stdin.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
resume.rs Include shared histories in rollout compression (#42039) 2026-09-01 12:23:20 +00:00
sandbox.rs Add macOS Seatbelt filesystem integration tests (#39665) 2026-08-20 08:28:35 +00:00
seatbelt.rs Allow trusted symlinks beneath CODEX_HOME on macOS (#42716) 2026-09-04 10:12:03 +00:00
server_error_exit.rs [codex] Use expect in integration tests (#28441) 2026-06-15 21:53:47 -07:00
worktree.rs Support managed worktrees for interactive sessions and forks (#43069) 2026-09-05 18:06:26 +00:00