Skip to content

Conversation

@xsawyerx
Copy link
Member

Plugins were caching a single DSL instance at import time. In a multi‑app process, that meant plugin->dsl and bare dsl calls resolved to the DSL of the first app that loaded the plugin, breaking per‑app behavior.

This change makes the plugin dsl accessor resolve dynamically on each call by walking the call stack to find the consuming app's DSL, and explicitly skips plugin packages to avoid recursion. This preserves compatibility with bare dsl usage while restoring correct per‑app resolution.

This approach keeps the existing API (including bareword dsl) as is.

Plugins were caching a single DSL instance at import time. In a
multi‑app process, that meant `plugin->dsl` and bare dsl calls
resolved to the DSL of the first app that loaded the plugin,
breaking per‑app behavior.

This change makes the plugin `dsl` accessor resolve dynamically
on each call by walking the call stack to find the consuming
app's DSL, and explicitly skips plugin packages to avoid
recursion.  This preserves compatibility with bare `dsl` usage
while restoring correct per‑app resolution.

This approach keeps the existing API (including bareword `dsl`)
as is.
@xsawyerx
Copy link
Member Author

Also fixes #1630.

Copy link
Contributor

@cromedome cromedome left a comment

Choose a reason for hiding this comment

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

I've spent a while reviewing, and it looks correct to me. I wouldn't mind another set of eyes on it though.

@yanick ??? :)

@cromedome cromedome requested a review from yanick January 30, 2026 01:33
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