Files
codex/codex-rs/git-utils/Cargo.toml
T
ningyi-oai 048431dcbe Harden Git remote collection and limit remote URL metadata (#61488)
## 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
2026-11-14 08:26:47 +00:00

43 lines
1.1 KiB
TOML

[package]
name = "codex-git-utils"
version.workspace = true
edition.workspace = true
license.workspace = true
readme = "README.md"
[lints]
workspace = true
[dependencies]
codex-utils-process = { workspace = true }
anyhow = { workspace = true }
chrono = { workspace = true }
codex-file-system = { workspace = true }
codex-protocol = { workspace = true }
codex-utils-absolute-path = { workspace = true }
codex-utils-path-uri = { workspace = true }
codex-utils-pty = { workspace = true }
futures = { workspace = true, features = ["alloc"] }
gix = { workspace = true }
once_cell = { workspace = true }
regex = "1"
schemars = { workspace = true }
serde = { workspace = true, features = ["derive"] }
similar = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros", "process", "rt", "sync", "time"] }
ts-rs = { workspace = true, features = [
"uuid-impl",
"serde-json-impl",
"no-serde-warnings",
] }
walkdir = { workspace = true }
[dev-dependencies]
codex-utils-cargo-bin = { workspace = true }
pretty_assertions = { workspace = true }
[lib]
doctest = false