Repository navigation
Conversation
eunomie
marked this pull request as ready for review
September 23, 2026 13:49
eunomie
force-pushed
the
serve-module-cache-deps
branch
from
September 24, 2026 08:21
7f690af to
84b144f
Compare
This was referenced Sep 25, 2026
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
A hook can then add engine-computed identity that call displays omit. Signed-off-by: Yves Brissaud <[email protected]>
A module serves its clients at run time, after the cache lookup, so a changed target left the caller's cached result stale. Signed-off-by: Yves Brissaud <[email protected]>
A git module's code can serve modules beside it in its repository, which the module's own files, and so its cache key, do not cover. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
force-pushed
the
serve-module-cache-deps
branch
from
October 1, 2026 15:37
ceff7b9 to
84239a7
Compare
eunomie
added a commit
to eunomie/dagger
that referenced
this pull request
Oct 1, 2026
…ll-story * upstream/pr-14299: core: key git module calls on their commit core: key module calls on declared clients dagql: let dynamic input hooks set implicit inputs workspace: map module scopes to local clients core: reproduce stale serveModule caller results Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
to eunomie/dagger
that referenced
this pull request
Oct 3, 2026
Extends the local-client mapping from dagger#14299; local clients, and the call key built from them, are unchanged. Signed-off-by: Yves Brissaud <[email protected]>
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
A caller can serve a local client's module and cache a function result computed from it. Today, if only the client's target module changes, the caller's cached result can stay stale: the served module never enters the caller's cache key, so the cache lookup hits even though the inputs really changed.
Fix
Before a module function's cache lookup, the call gains one implicit input: a digest of the local clients the caller's
dagger.tomldeclares for that module's scope, plus those clients' own declared clients, recursively.dagger calloutput or in Dagger Cloud's trace.The change is built from four commits: a reproduction test for the stale result; a workspace helper mapping each module scope to its local client paths; a small dagql addition letting a dynamic-input hook set an implicit input after the hook runs (so a function's cache-key hook can add one); and the fix itself, which keys module calls on their declared clients.
Test
core/integration/module_serve_test.goaddsTestServeModuleDeclaredClientCachewith four subtests:dagger calldisplay.The test was verified failing before the fix and passing after, on the reproduction.
Trade-offs (reviewed and accepted)
dagger.tomlare tracked; an undeclaredserveModuleaddress is not.Known side effect
Replaying a recorded call by ID now recomputes this digest from the caller's current clients rather than reusing the recorded value. This matches how other engine-computed implicit inputs already behave.
Also: key git module calls on their commit
A fifth commit extends the same cache-key work to git modules. A call to a git module could return a stale cached result after a commit that changed only a sibling module the module serves: the module's identity covered only its own loaded files, not the rest of its repository.
moduleImplementationScoped(core/schema/module.go) now adds the module's git commit to its scoped cache key, so the whole repository tree at that commit is covered. It is a one-line change, covered byTestServeModuleGitCommitCache.Cost: the cache key of every git-loaded module changes once (a one-time invalidation on upgrade), and results are no longer shared between two commits of a repository even when the module's own files did not change; consumers at the same commit still share. Directory and host modules are unchanged.
📄 Understanding this change