Repository navigation
Conversation
There was a problem hiding this comment.
The fix works. With the issue's effect: async () => ({}) plugin, the base returns 503 "Location plugins did not finish activating" from /api/provider and /api/model, before and after a 20 s wait. With this PR, both return 200 with the catalog. I ran the reproduction from #63816 against both checkouts from source. effect-return.test.ts and module.test.ts pass (10/10), and tsc -b for packages/core is clean.
Checking at the call site in plugin.ts is the right layer: it is the one place where every plugin's effect runs, and the loader can't check the return value without calling it. A failed result goes to the same error entry as other load failures. A synchronous throw from effect still fails the plugin as before. The test is small and clear.
Public API: unchanged. This only adds a runtime check and an error message in core.
No blocking concerns.
Related: #63814
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Issue for this PR
Fixes #63816
Type of change
What does this PR do?
A plugin whose
effectreturns a Promise — the easy mistake of writing anasynceffect, or returning a 1.x-style hook map — passed the loader's "is a function" check, then hung activation forever:/api/providerand/api/model503'd with "Location plugins did not finish activating" and the TUI had no models. Activation now checks the return value ofeffectand, when it is not an Effect, fails that plugin with a clear message and marks it failed, so activation completes and the provider catalog stays available.No feature flag is needed for this bug fix.
How did you verify your code works?
packages/core/test/plugin/effect-return.test.ts: activates a plugin with an asynceffectreturning{}and one returning a hook map, and asserts both end up failed with the "must return an Effect" message andawaitActivationresolves. The test hangs ondev(30s timeout) and passes with the fix.bun test --timeout 30000 test/plugin/effect-return.test.ts test/plugin/module.test.tsinpackages/core: 10 pass, 0 fail.bun run typecheckinpackages/core: no errors.Screenshots / recordings
Not applicable — server-side behavior, no UI change.
Checklist
Added by the opencode bot (AI-generated).
Related: #63814