Repository navigation
OpenCode 2 plugin setup: parallel registration with a bounded registration stage
What changed
On OpenCode 2 hosts, the plugin's five host-domain registrations (agents and commands, tools, context hook, tool hooks, session/prompt hooks) now run concurrently instead of one after another. They share a single 3.5 s registration-stage budget; each registration keeps its own non-fatal error isolation, so one failing or stalled domain no longer delays or blocks the others.
If a registration is still pending when the budget fires, setup completes with the registrations that finished and records an operator-visible warning naming the pending domain(s) (surfaced through /swarm diagnose). A registration that completes after plugin cleanup has started is disposed on arrival instead of being left live.
The startup model-roster preflight now reads the config with the async loader, so its 2 s budget is an enforceable bound rather than a no-op wrapped around a synchronous read.
Why
The OpenCode 2 host awaits plugin activation and caps some early requests at 5 s, so a stalled registration should not hold setup open. The 60 s init, preflight and cleanup budgets are unchanged on purpose: the shared init core has its own fail-open budgets, and a rejected setup is recorded by the host as a failed plugin load.
Migration steps
None.
Breaking changes
None.
Known caveats
A registration that takes longer than 3.5 s now leaves the plugin partially registered (with a deferred warning) instead of delaying setup for up to 60 s per stage. Measured registration cost is about 30 ms.
The 3.5 s budget bounds only the registration stage; it is not an overall setup() deadline. Init, the startup preflight and cleanup keep their existing 60 s budgets, so total setup time on a slow host can still exceed the OpenCode 2 host's 5 s early-request window. No single end-to-end setup deadline is introduced.
7.198.2 (2026-10-17)
Performance Improvements
- host/v2: run v2 registrations concurrently under a bounded registration stage (1dadb24)