Skip to content

Preserve partial Git metadata when worktree status is slow - #61939

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/e7b7c250bfc0e23fb8962fcd5cd5febd7c69e2bd
Nov 17, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Preserve partial Git metadata when worktree status is slow

Why

Memory requests have a one-second Git metadata deadline. Waiting for all Git lookups together discards an already observed HEAD or remote URL when the worktree scan exceeds that deadline. Shared status scans can also describe a different HEAD from the independent lookup.

What changed

  • Publish HEAD, verified remote URLs, and worktree status incrementally, retaining available metadata at the memory request deadline.
  • Read HEAD and change status together using Git porcelain v2, and reject status observations that conflict with an independently observed HEAD.
  • Run a positive-only change probe over up to four recently modified root directories during memory extraction preparation. Use a completed probe only when full status is unknown and its HEAD matches the request metadata, without waiting for it before sending the request.

Testing

Add coverage for partial metadata at the deadline, delayed lookups, stale and unborn HEAD observations, positive-only probes, shared scans, and porcelain parsing. Extend remote credential redaction coverage to partial clones.

## Why

Memory requests have a one-second Git metadata deadline. Waiting for all Git lookups together discards an already observed HEAD or remote URL when the worktree scan exceeds that deadline. Shared status scans can also describe a different HEAD from the independent lookup.

## What changed

- Publish HEAD, verified remote URLs, and worktree status incrementally, retaining available metadata at the memory request deadline.
- Read HEAD and change status together using Git porcelain v2, and reject status observations that conflict with an independently observed HEAD.
- Run a positive-only change probe over up to four recently modified root directories during memory extraction preparation. Use a completed probe only when full status is unknown and its HEAD matches the request metadata, without waiting for it before sending the request.

## Testing

Add coverage for partial metadata at the deadline, delayed lookups, stale and unborn HEAD observations, positive-only probes, shared scans, and porcelain parsing. Extend remote credential redaction coverage to partial clones.

GitOrigin-RevId: e7b7c250bfc0e23fb8962fcd5cd5febd7c69e2bd
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/e7b7c250bfc0e23fb8962fcd5cd5febd7c69e2bd branch from 6bf1537 to cc356fd Compare November 17, 2026 02:00
@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-17T02:00:15.564732Z 6bf1537 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 cc356fd into main Nov 17, 2026
9 of 23 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/e7b7c250bfc0e23fb8962fcd5cd5febd7c69e2bd branch November 17, 2026 02:00
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 17, 2026
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.

1 participant