Skip to content

fetch-pack: accept absolute-path packfile URIs - #76

Open
friel-openai wants to merge 1 commit into
codexfrom
af/codex/packfile-uri-absolute-path
Open

fetch-pack: accept absolute-path packfile URIs#76
friel-openai wants to merge 1 commit into
codexfrom
af/codex/packfile-uri-absolute-path

Conversation

@friel-openai

@friel-openai friel-openai commented Aug 27, 2026

Copy link
Copy Markdown

Packfile URIs require a scheme and authority even when the pack and the
repository are served by the same HTTP(S) server.

Allow the server to advertise an absolute-path reference, as defined by
RFC 3986, section 4.2. Resolve it using the remote's scheme and
authority, following section 5.2.2. For example, /foo.pack from
https://example.com/repo.git resolves to https://example.com/foo.pack.
Packfile URIs do not support local paths, so there is no ambiguity with
a local file named /foo.pack.

Add a separate packfile-uris-absolute-path fetch capability. The client
declares support only for HTTP(S) remotes whose scheme is allowed by
fetch.uriprotocols. This flag does not change the server's URI selection.
When uploadpack.blobPackfileUri contains an absolute-path reference,
reject packfile-URI requests without the flag before starting
pack-objects. Leave fetches that do not request packfile URIs unchanged.

Handle only references beginning with a single slash. Redact their paths
in packet traces, as we do for absolute URIs.


I wonder if we should handle relative URIs in one go here. Should this
also support //foo.example/bar.pack and bar.pack (or ../bar.pack)?
We could then use one capability for relative references, rather than
negotiate each form separately.

If we're doing that, should we just follow RFC 3986, including the
query-only, fragment-only, and empty forms? Or would you prefer
to keep this patch small and stick to absolute-path references for now?

@friel-openai friel-openai added the git Changes to the Git project label Aug 27, 2026
@friel-openai
friel-openai marked this pull request as ready for review August 27, 2026 08:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-27T08:33:53.864633Z 7f5d2ed Draft marked ready
ℹ️ 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.

@friel-openai
friel-openai force-pushed the af/codex/packfile-uri-absolute-path branch 2 times, most recently from 5176602 to b2bf236 Compare August 27, 2026 17:13
Packfile URIs require a scheme and authority even when the pack and the
repository are served by the same HTTP(S) server.

Allow the server to advertise an absolute-path reference, as defined by
RFC 3986, section 4.2 [1]. Resolve it using the remote's scheme and
authority, following section 5.2.2 [2]. For example, /foo.pack from
https://example.com/repo.git resolves to https://example.com/foo.pack.
Packfile URIs do not support local paths, so there is no ambiguity with
a local file named /foo.pack.

Add a separate packfile-uris-absolute-path fetch capability. The client
declares support only for HTTP(S) remotes whose scheme is allowed by
fetch.uriprotocols. This flag does not change the server's URI selection.
When uploadpack.blobPackfileUri contains an absolute-path reference,
reject packfile-URI requests without the flag before starting
pack-objects. Leave fetches that do not request packfile URIs unchanged.

Handle only references beginning with a single slash. Redact their paths
in packet traces, as we do for absolute URIs.

[1] https://www.rfc-editor.org/rfc/rfc3986.html#section-4.2
[2] https://www.rfc-editor.org/rfc/rfc3986.html#section-5.2.2

Signed-off-by: Friel <friel@openai.com>
@friel-openai
friel-openai force-pushed the af/codex/packfile-uri-absolute-path branch from b2bf236 to 44c64ac Compare August 27, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

git Changes to the Git project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant