Skip to content

Defer Git worktree status until the turn starts - #62437

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/00f465a5621d672d8b6d9063c384fb62e493c79f
Nov 19, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/00f465a5621d672d8b6d9063c384fb62e493c79f

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Defer Git worktree status until the turn starts

Why

A turn interrupted during setup can be discarded before it runs. Starting
the worktree scan during setup can spend time scanning for a turn that
will never send a model request.

What changed

Collect HEAD and remote URLs in the background after turn setup, and
start the worktree status scan only after the turn is admitted to run.
Model requests use the latest available Git metadata while collection
continues, and later requests can include the worktree status once it
is available.

Use shared background Git root discovery for the memory extraction
change probe and pass the resolved root into the probe.

Testing

Regression tests cover requests proceeding while status is blocked,
later requests carrying the updated HEAD, remote URL, and dirty
status, and an interrupted wake skipping the worktree scan.

## Why

A turn interrupted during setup can be discarded before it runs. Starting
the worktree scan during setup can spend time scanning for a turn that
will never send a model request.

## What changed

Collect `HEAD` and remote URLs in the background after turn setup, and
start the worktree status scan only after the turn is admitted to run.
Model requests use the latest available Git metadata while collection
continues, and later requests can include the worktree status once it
is available.

Use shared background Git root discovery for the memory extraction
change probe and pass the resolved root into the probe.

## Testing

Regression tests cover requests proceeding while status is blocked,
later requests carrying the updated `HEAD`, remote URL, and dirty
status, and an interrupted wake skipping the worktree scan.

GitOrigin-RevId: 00f465a5621d672d8b6d9063c384fb62e493c79f
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/00f465a5621d672d8b6d9063c384fb62e493c79f branch from ed77a21 to 83f73a8 Compare November 19, 2026 06:03
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-19T06:03:36.256572Z ed77a21 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit 83f73a8 into main Nov 19, 2026
11 of 24 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/00f465a5621d672d8b6d9063c384fb62e493c79f branch November 19, 2026 06:03
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 83f73a81 Deployed Nov 19, 2026 by asaborio via Identify potential duplicates (open issues fallback) #64294
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.

2 participants