Skip to content

Harden Git remote collection and limit remote URL metadata - #61488

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/522ffe291db6113ca9856fc98309609c8abe4ac0
Nov 14, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Harden Git remote collection and limit remote URL metadata

Why

Parsing git remote -v can mistake partial clone filter text for remote entries. Large remote URLs can also push turn metadata beyond the Responses API's 8,096-character limit.

What changed

  • Read fetch URLs from NUL-delimited Git configuration, sanitize credentials, and let Git resolve insteadOf rewrites and empty URL resets without contacting remotes.
  • Resolve ambiguous URLs with bounded concurrency and a shared deadline, and expose an observer that publishes verified URLs as they become available.
  • When turn metadata exceeds the limit, fit complete remote URLs into the remaining budget while preserving other metadata. Prioritize origin, then shorter entries; omit URLs rather than truncate repository identities. Apply this to both client metadata and compatibility headers.

Testing

Add regression coverage for partial clone filter injection, URL rewrites and resets, malformed and non-UTF-8 configuration, GIT_CONFIG overrides, progressive updates, and long remote URLs. Add metadata tests for the exact size boundary, oversized remote omission, ASCII serialization, and preservation of other fields.

## Why

Parsing `git remote -v` can mistake partial clone filter text for remote entries. Large remote URLs can also push turn metadata beyond the Responses API's 8,096-character limit.

## What changed

- Read fetch URLs from NUL-delimited Git configuration, sanitize credentials, and let Git resolve `insteadOf` rewrites and empty URL resets without contacting remotes.
- Resolve ambiguous URLs with bounded concurrency and a shared deadline, and expose an observer that publishes verified URLs as they become available.
- When turn metadata exceeds the limit, fit complete remote URLs into the remaining budget while preserving other metadata. Prioritize `origin`, then shorter entries; omit URLs rather than truncate repository identities. Apply this to both client metadata and compatibility headers.

## Testing

Add regression coverage for partial clone filter injection, URL rewrites and resets, malformed and non-UTF-8 configuration, `GIT_CONFIG` overrides, progressive updates, and long remote URLs. Add metadata tests for the exact size boundary, oversized remote omission, ASCII serialization, and preservation of other fields.

GitOrigin-RevId: 522ffe291db6113ca9856fc98309609c8abe4ac0
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/522ffe291db6113ca9856fc98309609c8abe4ac0 branch from 80c94f3 to 048431d Compare November 14, 2026 08:27
@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-14T08:27:13.517753Z 80c94f3 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 048431d into main Nov 14, 2026
10 of 23 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/522ffe291db6113ca9856fc98309609c8abe4ac0 branch November 14, 2026 08:27
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 14, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 048431dc Deployed Nov 14, 2026 by Pengpengwanga via Translate non-English issue #26004
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