Repository navigation
Conversation
A module source loaded through Workspace.moduleSource carries that workspace, and its subpath is relative to it. The entrypoint was given the calling client's workspace instead, so a chain of local modules could not resolve its local dependencies. Signed-off-by: Yves Brissaud <[email protected]>
A module loaded by git ref, from a directory, or from a local path outside the caller's workspace received the caller's workspace, so its entrypoint could not find the module it serves. Signed-off-by: Yves Brissaud <[email protected]>
A module inside the caller's workspace still received the caller's workspace, so the same entrypoint saw a different kind of tree depending on where its module was loaded from. Signed-off-by: Yves Brissaud <[email protected]>
The workspace is now the module's own context, so an SDK entrypoint could no longer resolve the local clients the caller declared for the module in the workspace config. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
force-pushed
the
fix-entrypoint-source-workspace
branch
from
September 21, 2026 15:05
25c37a0 to
099e8bb
Compare
Contributor
|
I don't think this is what we want. We actually want the caller's workspace IMO. If the entrypoint wants the module's source we should make sure they can call |
Member
Author
I'll double check but I think the issue is exactly there. The entrypoint requires its own workspace access. Without that the entrypoint cannot load its own module. |
Member
Author
|
Closing it, will be replaced by a better design |
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.
Give a module entrypoint a workspace built from its own module source
Problem
The engine calls a module's entrypoint to load its types and dispatch its calls, and passes it a
Workspace. It passed the workspace of the caller, not of the module.So any module that does not live in the caller's workspace got a tree that does not contain it. Its entrypoint could not find its own files: types loaded, every call failed. In practice a module published to git cannot be called at all — which is what blocks module sharing for the Go and Python SDKs.
Fix
Build the entrypoint's workspace from the module's own source, whatever the source kind:
includesnameThe caller's workspace is no longer used here. A function that declares a
Workspaceargument still gets the caller's, because the caller passes it.Two consequences:
includes. Git and directory modules are unaffected.Notes for review
ModuleSource.Git.UnfilteredContextDirrather than rebuilding aGitRef: the tree is already loaded, it keeps.git, and it is content-addressed by commit. A test asserts two sessions get the sameWorkspace.address.NewWorkspaceSourceRootlessLocalreads as empty by design), so it reuses the include-filtered context the loader already produced. No new engine API, no extra host read.📄 Understanding this change