Skip to content

Conversation

@iodev
Copy link
Owner

@iodev iodev commented Nov 28, 2025

Summary

  • Add ability to reload opencode.json configuration and restart MCP servers from the TUI without restarting opencode
  • Accessible via command palette (Ctrl+P → "Reload config")

Changes

  • Add POST /config/reload server endpoint that:

    • Calls Instance.dispose() to clear cached state (config, MCP connections)
    • Re-reads opencode.json from disk
    • Restarts all MCP server connections
    • Returns status with number of MCP servers configured
  • Add "Reload config (opencode.json)" command to TUI command palette:

    • Shows toast notifications for progress/success/failure
    • Refreshes sync store with new providers, agents, config, and MCP status

Motivation

Previously, modifying opencode.json (especially MCP server configuration) required restarting opencode entirely. This change allows hot-reloading the configuration.

- Add POST /config/reload server endpoint that disposes cached state and re-reads opencode.json
- Add 'Reload config (opencode.json)' command to TUI command palette (Ctrl+P)
- Expose baseUrl from SDK context for direct API calls
- Add config.reload command type and ConfigReloaded event

This allows users to modify opencode.json (e.g., add/change MCP servers) and reload
the configuration without restarting opencode entirely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants