Uh oh!
There was an error while loading. Please reload this page.
feat(opencode): add /reload slash command with auto-resume - #43458
feat(opencode): add /reload slash command with auto-resume#43458AndyS77 wants to merge 1 commit into
Conversation
Add a /reload slash command that hot-reloads all configuration, plugins, MCP servers, skills, and agents without restarting the TUI. After reload, the interrupted session is automatically resumed via SessionPrompt.loop(). Closesanomalyco#6719 ConfigReload service: - Per-workspace state tracking with pending/executing/done lifecycle - Queues reload if sessions are active, executes when idle - Coalesces repeated reload requests during an active reload - Emits config.reload.pending/executing/done events for TUI sync - Bootstrap cycle tracking for TUI reconnection after instance reload - Auto-resume: after reload completes, calls SessionPrompt.loop() to continue the interrupted session with fresh config Server endpoints: - POST /config/reload — triggers reload, returns immediate/queued status - GET /config/reload/status — poll-based status for non-TUI clients - POST /config/bootstrap-complete — TUI acknowledges reload completion reload_config tool: - Agent-callable tool that triggers reload and stops the current turn - stopAfterToolResult stops the processor loop cleanly - Session is auto-resumed after reload completes Session integration: - SessionRunState wires ConfigReload.start/finish into onBusy/onIdle - Runner.onBusy called on Idle→Running transition - Processor handles stopAfterToolResult via ctx.blocked Workspace routing: - URL-decode x-opencode-directory header for encoded paths Co-Authored-By: opencode <opencode@anomalyco> Agent: @Feature-dev Model: glm/zai-glm-52 Scope: anomalyco#6719
Enough1122
commented
Aug 22, 2026
The ConfigReload state machine itself is well designed — per-workspace states, cycle-numbered bootstrap acknowledgements that reject stale acks, coalescing, and genuinely good lifecycle test coverage. However:
|
Issue for this PR
Closes#43454
Type of change
What does this PR do?
Adds a /reload\ slash command that hot-reloads all configuration, plugins, MCP servers, skills, and agents without restarting the TUI. After reload, the interrupted session is automatically resumed via \SessionPrompt.loop().
Follow-up to the shelved PR #9871, with key improvements:
How it works
eload_config\ tool calls \POST /config/reload\
The
eload_config\ tool stops the current turn via \stopAfterToolResult\ (sets \ctx.blocked = true). The turn stops cleanly, the runner goes idle, reload executes, and the session is resumed.
What gets reloaded
How did you verify your code works?
Checklist
Co-Authored-By: zai-glm-52 noreply@ai.local
Agent: @Feature-dev
Scope: #43454