## What changed
- Add the experimental `worktrees` feature and a shared `--worktree` flag for new and forked `codex exec` sessions.
- Create each enabled session in a managed Git worktree, use that checkout as the session working directory, and bind the checkout to the new thread.
- Share the configured worktree pool with Desktop while leaving automatic cleanup disabled for CLI allocations.
- Reject unsupported commands, remote execution, ignored user configuration, ephemeral sessions, and use without the feature enabled before allocating a worktree.
## Testing
- Cover flag placement and inheritance, supported and rejected command combinations, worktree allocation and thread ownership, configuration gating, and compatibility with existing worktree-backed sessions.
GitOrigin-RevId: 011ff4639b09e8992c50d7b823df23e71798670e
## What changed
- Add `WorktreeManager::list` to return managed linked worktrees associated
with the repository containing a requested working directory.
- Preserve the requested repository-relative working directory in each result
and sort results by worktree root.
- Exclude primary and unrelated checkouts, paths outside the managed layout,
unsafe working directories, aliases, and stale or mismatched Git
registrations.
## Testing
Add coverage for repository filtering, native paths, nested working
directories, stale registrations, aliases, and layout validation.
GitOrigin-RevId: 385133914bd601e6c72858166853a1d42f7722ee
## What changed
- Add `WorktreeManager::create` to create detached, Desktop-compatible worktrees from `HEAD` or an explicit base while preserving the source working-directory path.
- Isolate worktree Git operations from inherited repository selectors, hooks, filesystem monitors, and configured content filters.
- Validate the destination working directory and roll back incomplete worktrees and empty allocation buckets on failure.
## Testing
- Cover layout, base selection, annotated tags, nested working directories, Git environment isolation, filter suppression, source checkout preservation, unsafe symlinks, and creation rollback.
GitOrigin-RevId: bf172c3ff4268dab603d00a1d547485fcd0de368
## What changed
- Add `WorktreeManager` APIs to bind a managed linked worktree to a thread and read its owner.
- Store the versioned `codex-thread.json` record in Git metadata with atomic, no-clobber writes, making repeat bindings idempotent while rejecting conflicting owners.
- Validate the managed worktree layout and reject primary, nested, and unmanaged checkouts before accessing ownership metadata.
- Run Git metadata queries with repository-selecting environment variables removed and hooks, filesystem monitoring, attributes, and LFS smudging disabled.
## Testing
- Add integration coverage for rejecting primary and unmanaged worktrees and for writing and reading the expected ownership schema.
GitOrigin-RevId: afec9a0ab711fe4017074bcec5807d860e9c88d0
## What changed
- Add the `codex-worktree` crate for resolving managed worktree settings from
the existing `[desktop]` configuration.
- Default the worktree root to `$CODEX_HOME/worktrees`, automatic cleanup to
enabled, and retained worktrees to 15.
- Validate configured roots, cleanup flags, and retention counts before
exposing the effective settings.
## Testing
- Cover defaults, configured values, and invalid root and retention settings.
GitOrigin-RevId: 1b279c62ef41e3c8eb540ce9beaf0f6cd96d903f