GeezerVison is showing github.com — server: long-running daemon stops activating configured providers after config hot-reload; restart fixes · Issue #66199 · anomalyco/opencode
server: long-running daemon stops activating configured providers after config hot-reload; restart fixes #66199DescriptionSummary
A long-running OpenCode server daemon stops exposing providers defined in the
config (providers) even though it keeps parsing them. The provider/model
catalog appears empty (only built-in + auth-based providers remain) until the
service is restarted. Restart reliably restores every configured provider.
Environment
- opencode version: 2.2.0 (latest channel)
- OS: Linux 6.8.0-1062-oracle (aarch64, Ubuntu 22.04)
- Terminal: xterm-256color (tmux)
- Shell: /bin/bash
- Install/channel: latest
- Active plugins: none declared in
opencode.json / opencode.jsonc; a local
repo plugin (shared-config) is configured via the plugin dir, and the
config reload path logs plugin-reload errors (see Additional Context).
Reproduction
- Configure one or more custom OpenAI-compatible providers under
providers in ~/.config/opencode/opencode.json (e.g. an entry with
package: "@opencode/ai/providers/openai-compatible", settings.baseURL
settings.apiKey, and explicit models).
- Start the OpenCode service and confirm the models appear in
/api/model.
- Leave the service running for a long time (days). While it is up, edit or
reload the config (hot-reload). The config watcher emits
provider.updated / model.updated events.
- Query
/api/provider and /api/model.
Expected Behavior
Every provider defined in providers (and its models) continues to be exposed
by the running service after config reloads, matching the freshly-started state.
Actual Behavior
GET /api/config still contains the full providers map (Agnes, LiteLLM,
etc.) with all models — the daemon parses them.
GET /api/provider only lists built-in opencode and auth-backed providers
(e.g. inception); none of the config-defined providers are activated.
GET /api/model therefore lacks all custom-provider models.
- Restarting the service (
opencode service restart) fully restores every
provider without any config change.
Additional Context
- Frequency: intermittent, correlates with a daemon that has been alive for
multiple days. In this case the service ran ~13 days before the catalog
went empty; the same symptom is documented recurring on this host.
- Associated log lines during the config hot-reload (role=server):
message="failed to reload plugins" cause="TypeError: r is not a function. (In 'r()', 'r' is an instance of Object)"
message="Failed to drain Session" cause="Session.AgentNotFoundError: Agent not found: \"gentle-orchestrator\""
- Workaround:
opencode service restart restores the catalog reliably and is
the only thing that does.
- This is not related to memory pressure: no kernel OOM events, ample free RAM.
- Model IDs redacted for brevity; provider names are generic (Agnes, LiteLLM).
Activityopencodejr commented on Nov 24, 2026 Thanks for the detailed report and the log lines. I think this is a duplicate of #49982.
The key line is failed to reload plugins … TypeError: r is not a function. (In 'r()', 'r' is an instance of Object). With that error, a plugin reload fails partway through, and whatever had been registered after the failing plugin stays missing until the service restarts. In #49982 that was custom agents and commands. Your report shows it for the config-defined providers, and your Agent not found: "gentle-orchestrator" line is the same follow-on error seen there.
Possible duplicates and closely related issues, ordered from most to least likely:
You're on 2.2.0. A user in #49982 confirmed that on v2.3.0 (which includes #63548) agents survive the failed reload without a restart. Please upgrade and check whether your providers survive too. Also worth checking: in #49982 the trigger was a plugin whose setup returns an object instead of a cleanup function, so your local shared-config plugin may be the one returning an object.
I'm closing this issue now as a duplicate of #49982. If it still happens after upgrading, please add your details (version, the shared-config plugin's setup shape, and the log lines) to #49982. Replying here will reopen this issue.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|