anomalyco / anomalyco/opencode

[FEATURE]: /reload slash command with auto-resume

Open
#43,454 4 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Aug 19, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

This is a follow-up to #6719 and the shelved PR #9871, with a working implementation on a fork.

Problem: Any change to config, agents, skills, MCP servers, or plugins requires a full restart of opencode. This interrupts running sessions and loses context.

Proposed solution: A /reload\ slash command that hot-reloads everything without restarting the TUI:

  1. ConfigReload service — per-workspace state tracking with pending/executing/done lifecycle. Queues reload if sessions are active, executes when idle. Coalesces repeated requests during an active reload.
  2. Auto-resume — after reload completes, the interrupted session is automatically resumed via \SessionPrompt.loop(). No synthetic continuation prompt; the loop reloads history from DB and continues with fresh config.

  3. eload_config\ tool
    — agent-callable tool that triggers reload and stops the current turn via \stopAfterToolResult. The agent can reload config mid-session and the session continues automatically.
  4. Server endpoints: \POST /config/reload, \GET /config/reload/status, \POST /config/bootstrap-complete\ for TUI reconnection after instance reload.
  5. Bootstrap cycle tracking — TUI acknowledges reload completion with a matching cycle number, preventing stale acks from dismissing the reload overlay prematurely.

Working implementation:
eload-command\ branch on https://github.com/AndyS77/opencode

Key differences from PR #9871:

  • Auto-resume: the interrupted session is automatically resumed after reload (PR #9871 did not resume)
  • Error handling: \store.reload()\ failures are logged instead of silently swallowed (\Effect.ignore\ → \Effect.catchCause)
  • No dead code: removed \ oid ConfigReload.Event\ and \s any\ casts
  • Tests cover auto-resume path with mocked \SessionPrompt.Service\

What gets reloaded:

  • Global + project config (\opencode.json/\ \opencode.jsonc)
  • Agents, skills, commands (from .opencode/\ and config)
  • MCP server connections (disconnect + reconnect)
  • Plugin registry (full re-import)
  • Provider configuration and auth
  • LSP connections, file watchers, permissions, formatters

Related issues: #6719, #8751, #39987, #37426

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.