Repository navigation
Conversation
sipsma
force-pushed
the
sipsma/serve-listed-clients
branch
2 times, most recently
from
November 12, 2026 19:40
469e484 to
0a0a42d
Compare
A module serves modules from its own tree when its function runs, after the engine has looked the call up in the cache. A module loaded from the host is keyed on the clients its workspace's config lists, and a module another module loaded from its tree, whose entrypoint sources or the include that replaces them narrowed its context to its own files, on nothing beyond those files. Either returned results computed before a module it served changed: one the config doesn't list, or any, served from such a narrowed module. Such a module now serves only itself and the clients that the config governing it in its own tree lists, and its calls are keyed on those clients and theirs in turn, each read from the config governing that client. The list is read from the module's tree, so it is the same however the module was reached, including from a process it starts. Serving any other module fails with an error that says what to list. A module a host module served from its tree, at any depth, serves only listed clients too: its own key covers the tree, but the host module's key covers it only as its own files and the clients it lists. Git modules and directory modules whose context is their whole tree keep serving any module from it: their key already covers it. Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
A local module loaded through a workspace reads its source through that workspace, which carries its edits and its owner's route to the host. Its dagger.toml, which lists the clients it may serve and its calls are keyed on, was read straight from the host instead. Where the module's host could not be reached that way, such as a module an LLM reloaded from its edited workspace, every call failed to compute its cache key. Read the config through the module's workspace, as its source is read, and from the host only for a module loaded without one. An edited dagger.toml in the workspace now counts as well. Signed-off-by: Erik Sipsma <[email protected]>
Reading a workspace module's dagger.toml through its workspace, as the previous commit did, is refused when the call's key is computed in a client that neither owns the workspace nor descends from its owner: a module an LLM reloaded from a workspace it edited is owned by the module that edited it, while its tools are keyed in the LLM's caller. Every call of the reloaded module then failed to compute its key. A local module loaded through a workspace now takes its clients from the workspace's config as the session parsed it when it loaded the workspace, which needs no read. That list holds only the workspace's own dagger.toml, as it was when the workspace loaded. Any other module still reads the config governing it from its tree, and the shared tree reader is back to reading a local module's files from its host. Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
sipsma/serve-listed-clients
branch
from
November 19, 2026 23:04
0a0a42d to
b88efe5
Compare
tiborvass
approved these changes
Nov 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.
A module's code can serve other modules from the repository it came from (#14490). That happens when its function runs, which is after the engine has looked the call up in the cache. So whatever a module can serve has to be covered by the call's cache key, or a change to a served module comes back as the old answer from the cache.
Main already covers this for git modules (the commit is in the key), for directory modules whose context is the whole directory, and, since #15080, for git workspaces with uncommitted edits. Three cases still return the old answer:
dagger.tomldoesn't list as its client;sources, or theincludethat replaces them (core: replace entrypoint resources with sources #14693), that another module served from a local checkout, serving its own client;What changes
A module whose key doesn't cover its whole tree now serves only itself and the clients
dagger.tomllists for it, and its calls are keyed on those clients and theirs in turn. That covers:sourcesorincludenarrowed to their own files, or that are read through a directory-backed workspace;For a module loaded through a workspace, the list comes from the workspace's config as the session parsed it when it loaded the workspace. Reading the workspace's files is refused to a client that neither owns the workspace nor descends from its owner, and a call's key can be computed in such a client, for example an LLM's tools on a module the LLM reloaded from a workspace it edited. Any other module reads the
dagger.tomlnearest it in its own tree, on the host for a local module, and each client's own clients come from the config nearest that client. Either way, the list is the same however the module was reached, including from a process the module starts.Serving an unlisted module fails with an error that says what to add, relative to the config that governs the module:
Git modules, and directory modules whose context is the whole directory, keep serving any module from their tree, because their key already covers it.
Every module that dagger/dagger's own modules serve is already listed in its
dagger.toml, through the generated client bindings, which serve only listed clients.Tests
TestServeModuleCallerTreeCache(TestModuleLoading) gains cases for each path:sourcesmodule and anincludemodule refuse an unlisted module;dagger.tomlreach the caller's key;TestDeclaredLocalClientsincore/workspacecovers reading the governing config.