fix(plugin): reject bootstrap client reentry#31859
Open
ualtinok wants to merge 1 commit into
Open
Conversation
ualtinok
force-pushed
the
shared-server-runtime
branch
from
June 11, 2026 09:54
d7630c2 to
79f71f9
Compare
Contributor
|
Yo guys please please i am begging |
|
Please |
|
add! |
ualtinok
force-pushed
the
shared-server-runtime
branch
2 times, most recently
from
June 16, 2026 14:57
b8937cd to
cf38078
Compare
randomvariable
added a commit
to randomvariable/opencode
that referenced
this pull request
Jun 25, 2026
Guard the plugin HTTP client so requests issued from a plugin's server() hook while the instance's plugins are still loading return a 409 instead of re-entering the still-initializing instance and deadlocking. The guard is cleared once plugin loading and config-notify hooks complete. Ported from anomalyco#31859 (adapted onto this fork's createPluginClient transport). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
randomvariable
added a commit
to randomvariable/opencode
that referenced
this pull request
Jun 25, 2026
Guard the plugin HTTP client so requests issued from a plugin's server() hook while the instance's plugins are still loading return a 409 instead of re-entering the still-initializing instance and deadlocking. The guard is cleared once plugin loading and config-notify hooks complete. Ported from anomalyco#31859 (adapted onto this fork's createPluginClient transport). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
randomvariable
added a commit
to randomvariable/opencode
that referenced
this pull request
Jun 30, 2026
Guard the plugin HTTP client so requests issued from a plugin's server() hook while the instance's plugins are still loading return a 409 instead of re-entering the still-initializing instance and deadlocking. The guard is cleared once plugin loading and config-notify hooks complete. Ported from anomalyco#31859 (adapted onto this fork's createPluginClient transport). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ualtinok
force-pushed
the
shared-server-runtime
branch
from
July 2, 2026 08:19
49c7b0c to
0370eed
Compare
iceteaSA
added a commit
to iceteaSA/opencode
that referenced
this pull request
Jul 2, 2026
# Conflicts: # packages/opencode/src/plugin/index.ts
iceteaSA
added a commit
to iceteaSA/opencode
that referenced
this pull request
Jul 8, 2026
# Conflicts: # packages/opencode/src/plugin/index.ts
randomvariable
added a commit
to randomvariable/opencode
that referenced
this pull request
Jul 10, 2026
Guard the plugin HTTP client so requests issued from a plugin's server() hook while the instance's plugins are still loading return a 409 instead of re-entering the still-initializing instance and deadlocking. The guard is cleared once plugin loading and config-notify hooks complete. Ported from anomalyco#31859 (adapted onto this fork's createPluginClient transport). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ualtinok
force-pushed
the
shared-server-runtime
branch
from
July 15, 2026 07:18
2e129aa to
2cf22d6
Compare
randomvariable
added a commit
to randomvariable/opencode
that referenced
this pull request
Jul 17, 2026
Guard the plugin HTTP client so requests issued from a plugin's server() hook while the instance's plugins are still loading return a 409 instead of re-entering the still-initializing instance and deadlocking. The guard is cleared once plugin loading and config-notify hooks complete. Ported from anomalyco#31859 (adapted onto this fork's createPluginClient transport). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #31858
Type of change
What does this PR do?
This PR has been narrowed after upstream landed
87c33b3d85a6c874e7b5af6af8fd6784e0e1bfbd(fix(plugin): reuse active server for client requests).That upstream commit fixes the main runtime split for normal post-init plugin SDK calls: when
opencode serveor Desktop has an active listener, plugininput.clientnow targets the active listener instead of the default in-processServer.Default()runtime. That prevents the duplicate plugin load / duplicatepromptAsyncrunner split for the common live-server path.I verified that narrower upstream fix against the Docker repro: bare
opencode-ai@1.17.7no longer reproduces the main issue (plugin_init count: 1, and thepromptAsyncmarker has one assistant child with onestop).What remains unsolved is bootstrap re-entry. If a plugin calls
input.client.*while itsserver(input)/ config hooks are still loading, the active listener can route the request back into the same instance load. The instance is already booting and its deferred is not resolved yet, so the request can wait on the plugin load that is itself waiting on the request.This PR now focuses only on that remaining path:
409 Conflictinstead of re-entering the same instance load.Server.urlactive-listener bridge unchanged.How did you verify your code works?
opencode-ai@1.17.7: not reproduced (plugin_init count: 1;promptAsyncmarker had one assistant child / onestop).git diff --checkand source diagnostics for the narrowed patch.Screenshots / recordings
N/A
Checklist