feat(opencode): add /reload slash command with auto-resume - #43458
Open
AndyS77 wants to merge 1 commit into
Open
feat(opencode): add /reload slash command with auto-resume#43458AndyS77 wants to merge 1 commit into
AndyS77 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(). Closes anomalyco#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
1 task
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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