GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — fix(server): await plugin activation before listing plugins by potoior · Pull Request #54676 · anomalyco/opencode Conversation
|
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This fixes the problem. I ran the #54654 reproduction from source: on the base branch, the first opencode plugin list in each of three new directories printed "No plugins found". With this PR, every call listed the plugin. The new test passes here and fails when copied onto the base, and typecheck is clean in server, protocol and client.
Public API: GET /api/plugin (plugin.list) can now return 503 ServiceUnavailableError if plugins haven't finished loading within 5s. This is an addition, and the generated client's declaredStatuses gain 503. It is backwards compatible apart from the new error status. Existing callers keep the same request and success response, but the first call on a directory that hasn't loaded yet can now take up to 5s.
Concerns:
packages/protocol/openapi.json wasn't regenerated. bun run check:generated in packages/protocol fails with this PR. Please run bun run generate there and commit the result.awaitPlugins wait to model.list, and this PR follows that newer pattern. Maintainers may want to confirm that blocking plugin.list is the intended direction.plugin.check and plugin.update still read the plugin list without waiting (see inline comment).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return yield* response(Plugin.Service.use((plugin) => plugin.list())) | ||
| }), | ||
| ) | ||
| .handle("plugin.check", (ctx) => |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
plugin.check (and plugin.update below it) also builds its inventory from plugins.list() without waiting. On a directory the server hasn't loaded yet, plugin check <target> / plugin update <target> can wrongly fail with "Plugin package is not in the current server inventory". The CLI's inventory.ts also calls plugin.list first, so with this PR that path waits, but the server handlers still race when called directly. You don't need to fix this here. If you do, yield* awaitPlugins at the start of both handlers would keep the endpoints consistent.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @Hona @thdxr — this PR is ready for review. CI is green ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Keeps these endpoints consistent with plugin.list so a cold location can't fail with a false 'not in the current server inventory'. Declares ServiceUnavailableError on plugin.check and regenerates the client/openapi.
|
Feedback addressed: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 72-hour window. Feel free to open a new pull request that follows our guidelines. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
cli:opencode plugin list prints "No plugins found" on the first call per cold location
There was an error while loading. Please reload this page.