Repository navigation
fix(server): stop waiting for plugins in the model, provider, generate, voice and websearch handlers - #63814
fix(server): stop waiting for plugins in the model, provider, generate, voice and websearch handlers#63814rekram1-node wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
I recommend merging this change: it is an exact revert of #63040. All seven changed files match their versions just before it, so the handlers are back to the #62796 behaviour.
I ran opencode serve from source in a project with a local plugin whose setup takes 7 s. On the base, GET /api/model returned 503 Location plugins did not finish activating after about 5.2 s. With this PR it returned 200 in about 0.1 s with the current (empty) list, and the full catalog once loading finished. The updated provider.test.ts passes here and fails on the base. The packages/server tests (127 pass) and typecheck:tsc pass. In the TUI, base and PR look the same 30 s into a cold start, so there are no screenshots.
Public API: nothing in the schema changes (SDK, client, OpenAPI). At runtime, model.list, model.default, provider.list, generate.*, voice.* and websearch.query no longer return 503 ServiceUnavailableError (service: "plugin") after 5 s. They now answer straight away with what is loaded, possibly an empty or partial list. Callers that relied on the wait need to wait themselves or refresh on *.updated, which the TUI, client data layer and ACP already do.
No concerns.
|
Windows results for #63814, with a plain-
Answers carry 0 model / session ids, which matches the design note in AGENTS.md ("lists may be empty or partial on a cold Location"). No 503 anywhere on #63814, and the successful calls come back several seconds sooner than the failing control. On your Two notes for anyone reproducing from source:
Separately, still open and not covered by this PR: a |
…e, voice and websearch handlers Reverts #63040.
5c278f9 to
6b02b00
Compare
There was a problem hiding this comment.
I recommend merging this change: it is still sound after the rebase. The only new change is that generate.video.create (from #64140) no longer waits for plugins either. It is still blocked first when the video_generate flag is off, and a video model that hasn't loaded yet now fails with not-found, as AGENTS.md describes. Nothing in packages/server/src waits for plugins any more.
I re-ran serve from source with a plugin whose setup takes 7 s. On the base, /api/model returned 503 after about 5 s. With this PR it returned 200 straight away with the current (empty) list. The packages/server tests (132 pass, including the video-generation tests) and typecheck:tsc pass.
Public API: the same as before, with generate.video.create added to the list. These endpoints no longer return 503 ServiceUnavailableError (service: "plugin") while plugins load, and nothing in the schema changes.
No new concerns.
Issue for this PR
Reverts #63040. Helps #63130.
Type of change
What does this PR do?
#63040 put a 5 s wait for plugins (503 after it) back on
model.list,model.default,provider.list,generate.*,voice.*andwebsearch.query, because managed policy and the Console config apply after providers register, so a denied provider or free model could be listed or used while a Location activates. In the #core thread that gap was accepted (blocking the Console plugin on its fetch is fine, a brief free-models flash is fine, MDM is the real lockdown), so this goes back to #62796: no handler waits.The cost of the waits is real: a slow Location, like 2000 linked skills in #63130, returns 503 from
/api/modelon every request, and the desktop app no longer retries 503s since #62830, so its model picker stays empty until loading ends.The video generation start added since (#64140) used the same wait and drops it too. The mobile apps no longer depend on the wait: the fixes shipped in Android v0.8.0 and iOS v0.507.0.
AGENTS.md drops the temporary exception, and the provider test goes back to checking that catalog reads answer while a plugin is still loading.
How did you verify your code works?
packages/server(132) andpackages/cli(408) tests with an isolated HOME,bun run check, andtypecheck:tscin packages/server.Checklist
Added by the opencode bot (AI-generated).
Related: #63130, #63273, #61359
Public API: model/provider/generate (incl. video.create)/voice/websearch endpoints no longer return 503 while plugins load (no schema change)