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:
Closing this as a duplicate of #56290, since we haven't heard back. Both reports are about ctx.event.subscribe() in a plugin receiving events from every loaded location, because plugin activation drops Location.Service. Please follow #56290 for progress. Two open PRs address it: #56346, and #57186, which also stamps the location on command.updated and similar events published when a plugin calls ctx.<domain>.reload(). If your case turns out to be different, reply here and we can reopen it. Thanks for the detailed analysis.
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.
opencode-agent commentedon Oct 21, 2026
Closing this as a duplicate of #56290, since we haven't heard back. Both reports are about
ctx.event.subscribe()in a plugin receiving events from every loaded location, because plugin activation dropsLocation.Service. Please follow #56290 for progress. Two open PRs address it: #56346, and #57186, which also stamps the location oncommand.updatedand similar events published when a plugin callsctx.<domain>.reload(). If your case turns out to be different, reply here and we can reopen it. Thanks for the detailed analysis.