Skip to content

[1.0-beta] Disable workspace inheritance from module dependencies - #13229

Merged
shykes merged 3 commits into
mainfrom
codex/workspace-disable-workspace-inheritance
Jul 21, 2026
Merged

shykes merged 3 commits into
mainfrom
codex/workspace-disable-workspace-inheritance

Conversation

@dagger-codex

@dagger-codex dagger-codex Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Driver: @shykes

Direct client calls can still give module A a contextual Workspace. Module dependencies no longer inherit it. A must pass a Workspace to B explicitly.

Before

B inherited the client's workspace through A.

flowchart LR
  C[Client workspace] --> A[Module A]
  A --> B[Module B dependency]
  C -. implicit .-> A
  C -. inherited .-> B
Loading

After

The implicit workspace stops at A. B only gets one if A passes it.

flowchart LR
  C[Client workspace] --> A[Module A]
  A --> B[Module B dependency]
  C -. implicit .-> A
  A -. explicit Workspace arg .-> B
Loading

@dagger-codex dagger-codex Bot changed the title fix: isolate workspace from module dependencies Disable workspace inheritance from module dependencies May 27, 2026
Comment thread engine/server/session_workspaces.go Resolved
@@ -0,0 +1,428 @@
# Disable Workspace Inheritance From Runtime Dependencies

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to future/done/YYYY-MM-DD-<name>.md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 42c6907.

@dagger-codex
dagger-codex Bot force-pushed the codex/workspace-disable-workspace-inheritance branch 3 times, most recently from df3bf1d to ea4ad1c Compare May 27, 2026 07:51
@eunomie
eunomie requested review from a team as code owners May 27, 2026 15:44
@vito
vito requested a review from a team as a code owner May 27, 2026 17:23
@dagger-codex
dagger-codex Bot force-pushed the codex/workspace-disable-workspace-inheritance branch 2 times, most recently from c8f3036 to 688c860 Compare May 27, 2026 23:17
@dagger-codex dagger-codex Bot changed the title Disable workspace inheritance from module dependencies [workspace] Disable workspace inheritance from module dependencies May 28, 2026
@tiborvass
tiborvass force-pushed the workspace branch 2 times, most recently from b9b4b5f to 4e36540 Compare May 30, 2026 05:10
@eunomie
eunomie force-pushed the workspace branch 3 times, most recently from 70d629a to 12bcb30 Compare May 30, 2026 21:01
@tiborvass
tiborvass force-pushed the workspace branch 2 times, most recently from be2a5bd to eeaa57a Compare June 1, 2026 18:12
@dagger-codex
dagger-codex Bot force-pushed the codex/workspace-disable-workspace-inheritance branch 2 times, most recently from 3083ee2 to 90fbffb Compare June 1, 2026 21:30
@dagger-codex dagger-codex Bot changed the title [workspace] Disable workspace inheritance from module dependencies [1.0-beta] [workspace] Disable workspace inheritance from module dependencies Jun 3, 2026
Comment thread core/modfunc.go Resolved
vito added a commit that referenced this pull request Jul 18, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 18, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 19, 2026
Revert carrying the bound workspace across module calls (a5ec46c) and
adopt the explicit contract from #13229: a module function calling a
dependency no longer hands it the workspace implicitly.

The carry threaded the caller's bound Workspace through the nested client
session, so a dependency's auto-injected Workspace! resolved against it.
That is ambient inheritance across the module boundary, which we don't
want.

loadWorkspaceArg now errors when a running module function omits a
Workspace argument (callerInModuleFunction), and inheritWorkspaceBinding
stops inheriting through a module-runtime parent so a dependency's
currentWorkspace resolves to none. Direct clients and rolled-up group
leaves (generators, checks, agents, services, LLM tool dispatch) still
resolve their bound workspace through the in-process context binding, so
only cross-module dependency calls change.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 19, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 19, 2026
Revert carrying the bound workspace across module calls (a5ec46c) and
adopt the explicit contract from #13229: a module function calling a
dependency no longer hands it the workspace implicitly.

The carry threaded the caller's bound Workspace through the nested client
session, so a dependency's auto-injected Workspace! resolved against it.
That is ambient inheritance across the module boundary, which we don't
want.

loadWorkspaceArg now errors when a running module function omits a
Workspace argument (callerInModuleFunction), and inheritWorkspaceBinding
stops inheriting through a module-runtime parent so a dependency's
currentWorkspace resolves to none. Direct clients and rolled-up group
leaves (generators, checks, agents, services, LLM tool dispatch) still
resolve their bound workspace through the in-process context binding, so
only cross-module dependency calls change.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 19, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 20, 2026
Revert carrying the bound workspace across module calls (a5ec46c) and
adopt the explicit contract from #13229: a module function calling a
dependency no longer hands it the workspace implicitly.

The carry threaded the caller's bound Workspace through the nested client
session, so a dependency's auto-injected Workspace! resolved against it.
That is ambient inheritance across the module boundary, which we don't
want.

loadWorkspaceArg now errors when a running module function omits a
Workspace argument (callerInModuleFunction), and inheritWorkspaceBinding
stops inheriting through a module-runtime parent so a dependency's
currentWorkspace resolves to none. Direct clients and rolled-up group
leaves (generators, checks, agents, services, LLM tool dispatch) still
resolve their bound workspace through the in-process context binding, so
only cross-module dependency calls change.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 20, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
@shykes
shykes force-pushed the codex/workspace-disable-workspace-inheritance branch from 3f77d59 to 9982452 Compare July 21, 2026 10:52
shykes and others added 3 commits July 21, 2026 15:48
Runtime calls into dependency modules used to inherit a contextual
Workspace from the caller, either through an omitted Workspace argument
or through currentWorkspace. They no longer do.

Callers now pass a Workspace explicitly when a dependency needs one.
Direct client calls can still supply one.

currentWorkspace is already hidden from module SDKs (#13659), so that
path is closed at the schema level.

Signed-off-by: Solomon Hykes <[email protected]>
Co-authored-by: Alex Suraci <[email protected]>
SDK codegen runs through workspace.generators().run(). It used to run in
the calling module's runtime client, where workspace inheritance is now
refused, so it failed with "no current workspace".

Record the workspace owner's client on GeneratorGroup and restore that
context before running, the same way withWorkspaceClientContext does.
The generator framework is trusted core code acting for the workspace
owner, not a module reaching into a dependency.

Signed-off-by: Solomon Hykes <[email protected]>
The release module calls dag.RustSDKDev() from its own runtime and relied
on the workspace argument being auto-injected. That is now refused with
"no current workspace".

Pass the release module's own workspace explicitly instead.

Rust is the only SDK-dev toolchain on the Workspace API; the others still
use +defaultPath and are unaffected.

Signed-off-by: Solomon Hykes <[email protected]>
@shykes
shykes force-pushed the codex/workspace-disable-workspace-inheritance branch from e41b997 to 1a12bd3 Compare July 21, 2026 14:01
@shykes
shykes merged commit cde6fe5 into main Jul 21, 2026
13 of 87 checks passed
@shykes
shykes deleted the codex/workspace-disable-workspace-inheritance branch July 21, 2026 14:03
vito added a commit that referenced this pull request Jul 21, 2026
Revert carrying the bound workspace across module calls (a5ec46c) and
adopt the explicit contract from #13229: a module function calling a
dependency no longer hands it the workspace implicitly.

The carry threaded the caller's bound Workspace through the nested client
session, so a dependency's auto-injected Workspace! resolved against it.
That is ambient inheritance across the module boundary, which we don't
want.

loadWorkspaceArg now errors when a running module function omits a
Workspace argument (callerInModuleFunction), and inheritWorkspaceBinding
stops inheriting through a module-runtime parent so a dependency's
currentWorkspace resolves to none. Direct clients and rolled-up group
leaves (generators, checks, agents, services, LLM tool dispatch) still
resolve their bound workspace through the in-process context binding, so
only cross-module dependency calls change.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 21, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 21, 2026
Revert carrying the bound workspace across module calls (a5ec46c) and
adopt the explicit contract from #13229: a module function calling a
dependency no longer hands it the workspace implicitly.

The carry threaded the caller's bound Workspace through the nested client
session, so a dependency's auto-injected Workspace! resolved against it.
That is ambient inheritance across the module boundary, which we don't
want.

loadWorkspaceArg now errors when a running module function omits a
Workspace argument (callerInModuleFunction), and inheritWorkspaceBinding
stops inheriting through a module-runtime parent so a dependency's
currentWorkspace resolves to none. Direct clients and rolled-up group
leaves (generators, checks, agents, services, LLM tool dispatch) still
resolve their bound workspace through the in-process context binding, so
only cross-module dependency calls change.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 21, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 21, 2026
Revert carrying the bound workspace across module calls (a5ec46c) and
adopt the explicit contract from #13229: a module function calling a
dependency no longer hands it the workspace implicitly.

The carry threaded the caller's bound Workspace through the nested client
session, so a dependency's auto-injected Workspace! resolved against it.
That is ambient inheritance across the module boundary, which we don't
want.

loadWorkspaceArg now errors when a running module function omits a
Workspace argument (callerInModuleFunction), and inheritWorkspaceBinding
stops inheriting through a module-runtime parent so a dependency's
currentWorkspace resolves to none. Direct clients and rolled-up group
leaves (generators, checks, agents, services, LLM tool dispatch) still
resolve their bound workspace through the in-process context binding, so
only cross-module dependency calls change.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 21, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 22, 2026
Revert carrying the bound workspace across module calls (a5ec46c) and
adopt the explicit contract from #13229: a module function calling a
dependency no longer hands it the workspace implicitly.

The carry threaded the caller's bound Workspace through the nested client
session, so a dependency's auto-injected Workspace! resolved against it.
That is ambient inheritance across the module boundary, which we don't
want.

loadWorkspaceArg now errors when a running module function omits a
Workspace argument (callerInModuleFunction), and inheritWorkspaceBinding
stops inheriting through a module-runtime parent so a dependency's
currentWorkspace resolves to none. Direct clients and rolled-up group
leaves (generators, checks, agents, services, LLM tool dispatch) still
resolve their bound workspace through the in-process context binding, so
only cross-module dependency calls change.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 22, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 24, 2026
Revert carrying the bound workspace across module calls (a5ec46c) and
adopt the explicit contract from #13229: a module function calling a
dependency no longer hands it the workspace implicitly.

The carry threaded the caller's bound Workspace through the nested client
session, so a dependency's auto-injected Workspace! resolved against it.
That is ambient inheritance across the module boundary, which we don't
want.

loadWorkspaceArg now errors when a running module function omits a
Workspace argument (callerInModuleFunction), and inheritWorkspaceBinding
stops inheriting through a module-runtime parent so a dependency's
currentWorkspace resolves to none. Direct clients and rolled-up group
leaves (generators, checks, agents, services, LLM tool dispatch) still
resolve their bound workspace through the in-process context binding, so
only cross-module dependency calls change.

Signed-off-by: Alex Suraci <[email protected]>
vito added a commit that referenced this pull request Jul 24, 2026
The over-broad inheritWorkspaceBinding gate returned early whenever a
module runtime client would inherit through another module runtime
parent. That also killed the legitimate frozen-workspace inheritance
that engine-internal codegen relies on: currentModuleAsSDK reads
Server.CurrentWorkspace directly to find the workspace a module is
installed in, so nested SDK codegen failed with "no current workspace:
workspace not loaded".

Drop the isModuleRuntimeClient gate and restore plain parent-workspace
inheritance. #13229's contract is still enforced by the loadWorkspaceArg
gate, and #13659 already hides currentWorkspace from module SDKs, so
dropping this gate does not reopen the dependency-reads-caller-workspace
vector.

Signed-off-by: Alex Suraci <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants