Repository navigation
core: keep git content digests type-distinct - #13998
Merged
Merged
Conversation
This was referenced Aug 29, 2026
vito
marked this pull request as ready for review
August 29, 2026 01:12
sipsma
reviewed
Aug 29, 2026
The GitRef, GitCommit, and tree Directory content digests were all hashed from the same url + SHA + bool inputs, so calls returning different types could produce the same digest. Cache equivalence is keyed on content digest, so a lookup could hand back a Directory where a GitCommit was expected, or vice versa. Mix a per-type discriminator into each digest so the three can no longer collide. Signed-off-by: Alex Suraci <[email protected]>
vito
force-pushed
the
extract/dagql-typed-cache
branch
from
August 29, 2026 01:59
37b8ff4 to
e177422
Compare
sipsma
approved these changes
Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cache equivalence in DagQL is keyed on content digest, and three Git-related content digests are hashed from the same url + SHA + bool inputs while returning different types:
dagger/core/schema/git.go
Lines 1147 to 1149 in 106d628
GitRefdagger/core/schema/git.go
Lines 1488 to 1490 in 106d628
GitCommitdagger/core/schema/git.go
Lines 938 to 947 in 106d628
DirectoryWhen the inputs line up (e.g.
commitdigestsdiscardGitDir=falsewhiletreedigestskeepsGitDir=false), the digests collide and a lookup can hand back aDirectorywhere aGitCommitwas expected, or vice versa. The latter two collided in my case.What this does
Mixes a per-type discriminator string (
gitRef,gitCommit,gitTree) into each digest's inputs so the three can no longer collide. Existing cache entries for these calls are invalidated once by the digest change, which is the usual cost of a cache-identity fix.Extracted from the
llm-workspace-dev-envstack; independent of the other extractions.🤖 Generated with Claude Code