Skip to content

fix(git): handle empty delta bundles - #408

Merged
worstell merged 1 commit into
mainfrom
worstell/fix-empty-bundles
Sep 16, 2026
Merged

worstell merged 1 commit into
mainfrom
worstell/fix-empty-bundles

Conversation

@worstell

@worstell worstell commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Cachew returns HTTP 204 only after an upstream fetch confirms that the snapshot needs no delta. Missing bases and failed fetches or bundle builds retain the normal Git fetch fallback.

Bundle builds hold the fetch lock and have a five-minute limit. Requests for the same bundle share one local build. Background builds continue after client disconnects, but stop on server shutdown. A waiting fetch is skipped only if another fetch succeeded.

Completed bundles stream to waiting clients while cache publication runs separately. Cache failures do not force current waiters to rebuild.

Generated with Amp

@worstell
worstell marked this pull request as ready for review September 15, 2026 18:07
@worstell
worstell requested a review from a team as a code owner September 15, 2026 18:07
@worstell
worstell requested review from joshfriend and removed request for a team September 15, 2026 18:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 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-09-16T17:58:20.984706Z 16e8a94 New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eea5414674

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/strategy/git/snapshot.go
@worstell
worstell force-pushed the worstell/fix-empty-bundles branch from eea5414 to 31eab46 Compare September 15, 2026 18:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 31eab4636a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/gitclone/manager_test.go Outdated
@worstell
worstell force-pushed the worstell/fix-empty-bundles branch from 31eab46 to b6b76c9 Compare September 15, 2026 19:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6b76c906c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/strategy/git/git.go Outdated
@worstell
worstell force-pushed the worstell/fix-empty-bundles branch from b6b76c9 to 0db068a Compare September 15, 2026 19:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0db068a4a8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/strategy/git/snapshot.go Outdated
Comment thread internal/strategy/git/snapshot.go
@worstell
worstell force-pushed the worstell/fix-empty-bundles branch from 0db068a to e1fc498 Compare September 15, 2026 19:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1fc498a74

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/strategy/git/snapshot.go
@worstell
worstell force-pushed the worstell/fix-empty-bundles branch from e1fc498 to aecda48 Compare September 15, 2026 19:49

@joshfriend joshfriend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startDeltaBundleFetch in the client only considers a 200 to be a success for fetching a delta bundle

@worstell
worstell force-pushed the worstell/fix-empty-bundles branch from aecda48 to 8e0a707 Compare September 16, 2026 17:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e0a70710f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/strategy/git/snapshot.go Outdated
Comment thread internal/strategy/git/snapshot.go Outdated
Verify an empty delta against fresh upstream refs before returning the no-content outcome. Keep ref inspection and bundle creation consistent so concurrent fetches cannot turn an empty delta into an arbitrary Git failure.

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0a667-aa3c-7519-8f18-52fce84e7724
@worstell
worstell force-pushed the worstell/fix-empty-bundles branch from 8e0a707 to 16e8a94 Compare September 16, 2026 17:53
@worstell
worstell merged commit bffcb4d into main Sep 16, 2026
8 checks passed
@worstell
worstell deleted the worstell/fix-empty-bundles branch September 16, 2026 17:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16e8a94de0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

go func() {
defer build.release()
defer s.bundleBuilds.Delete(key)
publishCtx, cancel := context.WithDeadline(s.ctx, deadline)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retain failed publications while the bundle is still in use

When the cache is a no-op backend or cacheBundle fails, this unconditional deletion removes the only discoverable copy as soon as the publication attempt ends, even if the owner or existing waiters are still streaming build.file. A request arriving during that streaming window therefore misses both the cache and bundleBuilds and regenerates the same expensive bundle under the fetch exclusion. Fresh evidence after the earlier cache-publication comment is that the generated result is now shared with existing waiters, but this deletion still prevents later concurrent callers from retaining it; delay deletion after publication failure until the active consumers release the build.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants