Skip to content

Bound Git root discovery for metadata enrichment - #42132

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/bca46fc263e7a12a2f69146d8a0b3e7c7e0846cb
Sep 1, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Bound Git root discovery for metadata enrichment

Why

Git root discovery is optional metadata work, but filesystem probes can block. They should not exhaust Tokio's blocking pool, delay runtime shutdown, or prevent later turns from observing repository changes.

What changed

  • Add a shared GitRootDiscovery service that coalesces concurrent lookups for the same working directory and limits probes across directories.
  • Run probes on detached threads, retain in-flight work across caller cancellation, and discard completed results instead of caching them.
  • Use the service for turn and memory metadata enrichment, abort unused turn enrichment when its state is dropped, and limit memory metadata waits to one second.

Testing

Add coverage for probe sharing, capacity limits, cancellation, fresh discovery, runtime shutdown, memory timeouts, and repositories restored after startup prewarming.

## Why

Git root discovery is optional metadata work, but filesystem probes can block. They should not exhaust Tokio's blocking pool, delay runtime shutdown, or prevent later turns from observing repository changes.

## What changed

- Add a shared `GitRootDiscovery` service that coalesces concurrent lookups for the same working directory and limits probes across directories.
- Run probes on detached threads, retain in-flight work across caller cancellation, and discard completed results instead of caching them.
- Use the service for turn and memory metadata enrichment, abort unused turn enrichment when its state is dropped, and limit memory metadata waits to one second.

## Testing

Add coverage for probe sharing, capacity limits, cancellation, fresh discovery, runtime shutdown, memory timeouts, and repositories restored after startup prewarming.

GitOrigin-RevId: bca46fc263e7a12a2f69146d8a0b3e7c7e0846cb
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/bca46fc263e7a12a2f69146d8a0b3e7c7e0846cb branch from 23f9c8a to 8436b74 Compare September 1, 2026 20:42
@copyberry
copyberry Bot merged commit 8436b74 into main Sep 1, 2026
24 of 30 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/bca46fc263e7a12a2f69146d8a0b3e7c7e0846cb branch September 1, 2026 20:43
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 1, 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