codex/codex-rs/git-utils/src
Benjamin Carlsson d30f9cc72a Include linked worktrees in TUI session discovery (#43279)
## Why

Directory-scoped session lookup misses conversations in linked worktrees of the same repository. Managed worktree creation also runs synchronous Git work on the TUI event loop.

## What changed

- With `worktrees` enabled for local sessions, include corresponding directories across linked checkouts in resume and fork pickers and `--last` lookup. Group them together in the agents overview and show checkout paths for picker entries from another worktree.
- Validate shared Git metadata and backlinks, preserve relative working directories and logical path aliases, and reject directory symlink escapes. Keep the expanded directory filter stable across pagination until the listing restarts.
- Fall back to the originally requested directory when an older daemon rejects an array-valued `cwd` filter.
- Create managed worktrees on a blocking worker, check transition blockers before allocation, and revalidate the source session before switching. Report retained checkout paths and cleanup instructions if the transition cannot complete.
- Start the in-session picker server in a separate task to avoid exhausting the TUI event future's stack.

## Testing

Add coverage for linked-checkout discovery, feature gating, picker selection and rendering, project grouping, pagination stability, and legacy daemon fallback. Extend worktree lifecycle tests to cover running-agent blockers and recovery after the source session changes during creation.

GitOrigin-RevId: 4a8a36c0dba3d32d72600f2edf8258a29fb4cb07
History 2026-09-06 20:52:29 +00:00
..
apply.rs Use the shared environment scrubber in git-utils (#37843) 2026-08-10 15:50:53 +00:00
baseline.rs Ignore configured hooks in git helpers (#22843) 2026-05-15 10:07:54 -07:00
branch.rs Move git utilities into a dedicated crate (#15564) 2026-03-24 13:26:23 -07:00
errors.rs Move git utilities into a dedicated crate (#15564) 2026-03-24 13:26:23 -07:00
fsmonitor.rs [codex] preserve fsmonitor for worktree Git reads (#26880) 2026-06-08 21:32:46 -07:00
fsmonitor_tests.rs [codex] preserve fsmonitor for worktree Git reads (#26880) 2026-06-08 21:32:46 -07:00
git_process.rs Use the shared environment scrubber in git-utils (#37843) 2026-08-10 15:50:53 +00:00
git_process_tests.rs Terminate timed-out Git process trees (#36793) 2026-08-03 20:00:49 +00:00
info.rs Sanitize credentials from Git remote metadata (#40713) 2026-08-25 21:34:05 +00:00
lib.rs Include linked worktrees in TUI session discovery (#43279) 2026-09-06 20:52:29 +00:00
operations.rs Add managed worktree creation (#42196) 2026-09-02 03:46:24 +00:00
platform.rs Move git utilities into a dedicated crate (#15564) 2026-03-24 13:26:23 -07:00
status.rs Coalesce concurrent Git status scans (#37151) 2026-08-05 20:23:35 +00:00
status_tests.rs Coalesce concurrent Git status scans (#37151) 2026-08-05 20:23:35 +00:00
trust.rs Harden unsandboxed patch filesystem access (#39659) 2026-08-20 08:10:08 +00:00
worktree.rs Include linked worktrees in TUI session discovery (#43279) 2026-09-06 20:52:29 +00:00
worktree_tests.rs Include linked worktrees in TUI session discovery (#43279) 2026-09-06 20:52:29 +00:00