Repository navigation
core: serve a module's local clients from its own tree - #14490
Merged
Merged
Conversation
This was referenced Oct 5, 2026
eunomie
force-pushed
the
eunomie/module-clients-2-own-tree
branch
from
October 5, 2026 16:10
dc565e8 to
d76cf07
Compare
eunomie
marked this pull request as ready for review
October 5, 2026 16:31
eunomie
force-pushed
the
eunomie/module-clients-2-own-tree
branch
from
October 6, 2026 11:05
d76cf07 to
f9ffefd
Compare
Base automatically changed from
eunomie/module-clients-1-declared-client-key
to
main
October 6, 2026 12:26
A module's code runs in a process its entrypoint starts, so the path resolved in the caller's workspace, which serves the wrong module. Signed-off-by: Yves Brissaud <[email protected]>
A path inside the tree can still reach outside it through a symlink, and a directory with no module config is not a module to serve. Signed-off-by: Yves Brissaud <[email protected]>
A process the module starts has no module, so the nearest non-module client was the process itself, whose container lacks the module's files. Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
eunomie
force-pushed
the
eunomie/module-clients-2-own-tree
branch
from
October 6, 2026 12:26
f9ffefd to
e8e61db
Compare
TomChv
approved these changes
Oct 6, 2026
eunomie
added a commit
to eunomie/python-sdk
that referenced
this pull request
Oct 7, 2026
A module that calls a local client asks the engine to serve it from the tree the module was loaded from; an engine without dagger/dagger#14490 looks in the caller's workspace instead and answers "dir module source does not contain a dagger config file". The check asserted its way into that wall on the floor release and on the engine CI runs, where nothing in this SDK could have made the call work. The first call is now the probe: that answer, from the engine itself rather than a version string, skips the rest and says so in the check's output, naming the issue. Every other engine takes the assertions as they were, and the one that fails for another reason still fails, now with its output in the message. Signed-off-by: Yves Brissaud <[email protected]>
This was referenced Oct 20, 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
When a module's code — a Python or Go process the module's entrypoint starts — calls
serveModulewith a local path for one of its clients, the engine resolved the path in the caller's workspace instead of the module's own repository. So it could serve the wrong module: for a git module, the caller's module with the same name.Change
serveModulenow finds the nearest module in the calling process's parent chain and resolves the path inside that module's own tree:A path that leaves the tree, including through a symlink, is refused, and the target must hold a module config. A call with no module in the chain behaves as before. The module cannot forge its identity: the chain is set by the engine.
Why
It lets a module load its own local clients from generated code alone — no
dagger.tomldeclaration and no handover from the entrypoint — in every SDK. It replaces the approach of the closed #14225 for this purpose, and does not change whichWorkspacea Dang entrypoint receives.Tests
TestModuleTreePathandTestModuleParentAndItsHost.TestModuleLoading/TestServeModuleCallerTree: a git module serves its own sibling and not the caller's; a directory module; escape refused; symlink escape refused; a non-module call unchanged; a host module's child process. PlusTestServeModuleFromModuleandTestServeModuleLocalAddress.Notes for reviewers
ModuleParentHostClientMetadata) to thecore.Queryinterface and two test mocks..gitexcluded,.gitignorenot honoured), which costs time on large repositories.