Skip to content

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

Closed

Description

@AndyS77

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 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

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

Activity

  1. github-actions commented on Aug 19, 2026

    @github-actions
    Contributor

    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.

  2. AndyS77 commented on Aug 19, 2026

    @AndyS77
    Author

    PR created: #43458

  3. AndyS77 commented on Aug 19, 2026

    @AndyS77
    Author

    This is intentionally a follow-up with a working implementation, not a duplicate.

    Why a new issue instead of continuing on #6719:

    • [FEATURE]: slash command for reload #6719 covers the original /reload\ request but the associated PR (feat: add /reload slash command #9871) was shelved by the author after 7 months and 20+ rebases
    • This issue documents the working implementation on a fork with key improvements over PR feat: add /reload slash command #9871 (auto-resume, error handling, test coverage for the resume path)
    • The scope here is narrower and implementation-focused — it tracks the specific design decisions (auto-resume via \SessionPrompt.loop(), \stopAfterToolResult\ mechanism, bootstrap-cycle tracking) that differ from the original proposal

    The related issues (#6719, #8751, #39987) are all still open and relevant — this issue is the one with a concrete PR attached: #43458

  4. vuuminhphuoc commented on Sep 5, 2026

    @vuuminhphuoc

    +1 for /reload with auto-resume.

    Concrete pain from daily use: I iterate on agent files (agents/*.md, model routing like 9router/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.

  5. added a commit that references this issue on Sep 14, 2026
    dfd8e40
  6. neriousy commented on Oct 19, 2026

    @neriousy
    Member

    This is implemented in v2: /reload rebuilds configuration and services without restarting the TUI, and running sessions continue with fresh services at the next step boundary. You can also run opencode reload from the CLI. Upgrade with npm i -g @opencode/cli@latest. If you still see this on v2, please open a new issue with the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions