You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
core: plugin event subscriptions receive events from every location #57474
A plugin's ctx.event.subscribe() receives events from every loaded location, not only its own. Events a plugin publishes carry no location, so they reach every client.
Plugin activation rebuilds the fiber context from only a Scope and the loggers (packages/core/src/plugin.ts:70), which drops Location.Service. The bus uses the ambient Location to filter subscriptions (bus.ts:734) and to stamp publishes (bus.ts:515). Internal plugins are not affected.
I hit this with a plugin that calls ctx.command.reload() on skill.updated. Every copy of it, one per loaded location, reloaded on any location's skill change. A shared opencode serve --service with about 15 TUI clients logged about 135,000 command.updated events in 9 hours.
Thanks for the detailed write-up and for tracking down the cause.
I think this is a duplicate of #56290. That issue reports the same ctx.event.subscribe() problem, and its reproduction found that the multiplier is the number of loaded locations, as you describe. Possible duplicates and related items, most likely first:
Activity
opencode-agent commentedon Oct 20, 2026
Thanks for the detailed write-up and for tracking down the cause.
I think this is a duplicate of #56290. That issue reports the same
ctx.event.subscribe()problem, and its reproduction found that the multiplier is the number of loaded locations, as you describe. Possible duplicates and related items, most likely first:ctx.event.subscribe()receives events from every location, because plugin activation dropsLocation.Service.notifypublishes such ascommand.updatedwhen a plugin callsctx.<domain>.reload(), which is your second point about events carrying no location.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
WilliamAGH commentedon Oct 20, 2026
Duplicate of #56290; the fix is tracked in #57186.