You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
serve: InstanceStore.boot eagerly initializes every registered project directory - startup is O(projects), minute-scale #48917
opencode serve runs InstanceStore.boot at listen time, which eagerly initializes an instance for every row in project/project_directory. Each instance pays full init cost (project config load, plugin init, remote MCP client connects, LSP enumeration) — measured ~2–20s per directory. With ~19 projects / ~80 registered directories, the server isn't ready for several minutes. Downstream supervisors that spawn opencode serve and wait for readiness (e.g., Paseo) time out and kill it.
Environment
opencode-ai 1.18.30 (npm), Windows 11
~/.local/share/opencode/opencode.db (~3.3GB) accumulated over months of worktree-based sessions
Evidence
Log excerpt from a single run= of opencode serve — creating instance/fromDirectory/bootstrapping repeating per directory, each followed by config loads, plugin init, MCP connects, and the ~35-entry "enabled LSP servers" enumeration:
Accumulate projects/dirs in opencode.db (or insert project_directory rows directly).
opencode serve --port <port> and watch log/opencode.log — one creating instance/bootstrapping/init cycle per registered directory before the server is fully ready.
Time to readiness scales roughly linearly with registered directory count.
In v2, the server becomes ready without loading your registered project directories; a directory's config, plugins and MCP servers start only when a request actually needs that directory. Old or deleted directory registrations therefore no longer add to startup time. To get v2: npm i -g @opencode/cli@latest or curl -fsSL https://opencode.ai/v2/install | bash (desktop: update the app). If you still see this on v2, please open a new issue with the details.
Activity
neriousy commentedon Oct 19, 2026
In v2, the server becomes ready without loading your registered project directories; a directory's config, plugins and MCP servers start only when a request actually needs that directory. Old or deleted directory registrations therefore no longer add to startup time. To get v2:
npm i -g @opencode/cli@latestorcurl -fsSL https://opencode.ai/v2/install | bash(desktop: update the app). If you still see this on v2, please open a new issue with the details.