Repository navigation
Closed
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:
- 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.
- 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.
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.- Server endpoints: \POST /config/reload, \GET /config/reload/status, \POST /config/bootstrap-complete\ for TUI reconnection after instance reload.
- 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 feat: add /reload slash command #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
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Aug 19, 2026
This issue might be a duplicate of existing issues. Please check:
If this is intentionally a follow-up with a distinct implementation proposal (working fork, auto-resume, etc.), consider leaving a comment on #6719 linking here rather than opening a separate issue.
AndyS77 commentedon Aug 19, 2026
PR created: #43458
AndyS77 commentedon Aug 19, 2026
This is intentionally a follow-up with a working implementation, not a duplicate.
Why a new issue instead of continuing on #6719:
The related issues (#6719, #8751, #39987) are all still open and relevant — this issue is the one with a concrete PR attached: #43458
vuuminhphuoc commentedon Sep 5, 2026
+1 for /reload with auto-resume.
Concrete pain from daily use: I iterate on agent files (
agents/*.md, model routing like9router/gemini-pro, combo membership) several times per session. Every change requires quitting the TUI and reopening to take effect, which kills session context and flow.Related hazard worth noting: editing an agent file while a server/session is live can leave sessions in a broken state until restart (see #46245). A /reload that re-reads config + agents + skills/commands and resumes the session would fix both the friction and that class of staleness bugs.
feat(opencode): add /reload slash command with auto-resume
neriousy commentedon Oct 19, 2026
This is implemented in v2:
/reloadrebuilds configuration and services without restarting the TUI, and running sessions continue with fresh services at the next step boundary. You can also runopencode reloadfrom the CLI. Upgrade withnpm i -g @opencode/cli@latest. If you still see this on v2, please open a new issue with the details.