Skip to content

engine: fix nested execs created by modules to not be module clients#11458

Merged
sipsma merged 3 commits intodagger:mainfrom
sipsma:nested-module-load-error
Dec 3, 2025
Merged

engine: fix nested execs created by modules to not be module clients#11458
sipsma merged 3 commits intodagger:mainfrom
sipsma:nested-module-load-error

Conversation

@sipsma
Copy link
Copy Markdown
Contributor

@sipsma sipsma commented Nov 20, 2025

There was some vestigial looking code when creating execs that resulted in nested execs created by modules to be marked as being clients for that module. This is subtly incorrect since they are not actually module clients (i.e. clients for function calls of the module), they are just execs created by the module.

This broke some cases of trying to load further modules from these nested execs because filesync tries to find the "non-module parent client", and would thus skip over the nested exec client up to the main caller.


reported by a user here: https://discord.com/channels/707636530424053791/1440182254126108763/1440182254126108763

@sipsma sipsma force-pushed the nested-module-load-error branch from 82542ee to 92a57fe Compare November 21, 2025 02:50
@sipsma sipsma added this to the v0.19.8 milestone Nov 21, 2025
@sipsma sipsma force-pushed the nested-module-load-error branch from 92a57fe to 15dab67 Compare November 21, 2025 19:40
@sipsma sipsma force-pushed the nested-module-load-error branch 2 times, most recently from a1cde97 to f375208 Compare December 2, 2025 19:59
@sipsma sipsma requested review from grouville and vito December 2, 2025 20:15
Copy link
Copy Markdown
Contributor

@vito vito left a comment

Choose a reason for hiding this comment

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

Nice, this could be pretty handy for agents

Comment on lines +1360 to +1365
for i := len(client.parents) - 1; i >= 0; i-- {
parent := client.parents[i]
if parent.mod != nil {
return parent.mod, nil
}
}
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.

neat

There was some vestigial looking code when creating execs that resulted
in nested execs created by modules to be marked as being clients for
that module. This is subtly incorrect since they are not actually module
clients (i.e. clients for function calls of the module), they are just
execs created by the module.

This broke some cases of trying to load further modules from these
nested execs because filesync tries to find the "non-module parent
client", and would thus skip over the nested exec client up to the main
caller.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
@sipsma sipsma force-pushed the nested-module-load-error branch from f375208 to e073cf9 Compare December 3, 2025 18:51
Copy link
Copy Markdown
Member

@grouville grouville left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@sipsma sipsma merged commit d263199 into dagger:main Dec 3, 2025
76 of 82 checks passed
raykao pushed a commit to raykao/dagger that referenced this pull request Dec 9, 2025
…agger#11458)

* engine: fix nested execs created by modules to not be module clients

There was some vestigial looking code when creating execs that resulted
in nested execs created by modules to be marked as being clients for
that module. This is subtly incorrect since they are not actually module
clients (i.e. clients for function calls of the module), they are just
execs created by the module.

This broke some cases of trying to load further modules from these
nested execs because filesync tries to find the "non-module parent
client", and would thus skip over the nested exec client up to the main
caller.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>

* integ test

Signed-off-by: Erik Sipsma <erik@sipsma.dev>

* fix service hostnames

Signed-off-by: Erik Sipsma <erik@sipsma.dev>

---------

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
raykao pushed a commit to raykao/dagger that referenced this pull request Dec 14, 2025
…agger#11458)

* engine: fix nested execs created by modules to not be module clients

There was some vestigial looking code when creating execs that resulted
in nested execs created by modules to be marked as being clients for
that module. This is subtly incorrect since they are not actually module
clients (i.e. clients for function calls of the module), they are just
execs created by the module.

This broke some cases of trying to load further modules from these
nested execs because filesync tries to find the "non-module parent
client", and would thus skip over the nested exec client up to the main
caller.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>

* integ test

Signed-off-by: Erik Sipsma <erik@sipsma.dev>

* fix service hostnames

Signed-off-by: Erik Sipsma <erik@sipsma.dev>

---------

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
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