[PR #13409] feat(experimental): add non-destructive alternative to instance/dispatch to re-hydrate skills/agents/tools #14653

Open
opened 2026-02-16 18:19:25 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13409

State: open
Merged: No


What does this PR do?

Note: this is a proposal to enable a new hot reload functionality

This PR enables hot reloading of opencode config (skill/agents/opencode.json/commands).

Shared walkthrough here on X:
https://x.com/benjaminshafii/status/2022764591378501888?s=20

Motivation

I've been working on OpenWork, an alternative GUI for opencode focused on non-coding use cases, and I've really to needed to have some form of reloading of the opencode config.

This new PR enables users to work with opencode config as a "living" system. Users can prompt opencode to add skills/plugin/etc. have them instantly available. Unlike calling /instance/dispose this is less destructive and we don't kill existing sessions.

I really need this as part of OpenWork. I have basically three options:

  1. I maintain my own fork, which I don't mind in principle, but it's a bit hard to handle. I'm a team of one right now.
  2. We merge a version of this feature into opencode
  3. provide inferior UX to my users (currently forcing instance dispose which kills all active sessions)

Implementation Decisions

The general idea is we leave it up to the server consumer to trigger hot reload via an endpoint and we provide events that allows the consumer to see if there's any reason to reload.

Tried to followOPENCODE_EXPERIMENTAL_* conventions.

Implemented 1 new endpoints:
/experimental/hotreload

Implemented a new set of events:
opencode.hotreload.{changed,applied}

Out of scope:

  • Global Config is ignored: this is purely scoped at the project level

Happy to reduce the surface area of the scope to only skills and/or agents to start with these are the most critical for my workflows.

Previous issues

This has been mentioned in a few issues:

which referred to the same thing. I haven't spotted a PR.

--

I'm happy to find a way to get this to the finish line. My biggest concern is if it's even a direction that you'd want opencode to take.

How did you verify your code works?

⚠️ I tested it. (partly!) . I'm running some tests right now but wanted to get this in your field of view to see if that's even a direction that you guys are interested in pursuing.

--

Test behavior:

  1. Run the new bin file
  2. create a skill/plugin/mcp/...
  3. [optional: listen for opencode.hotreload.changed event]
  4. call hot reload /experimental/hotreload endpoint
  5. try to access the skill agent etc

Ran this within opencode

image

Would appreciate input to know if that's a direction you'd be open to take

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13409 **State:** open **Merged:** No --- ### What does this PR do? *Note: this is a proposal to enable a new hot reload functionality* **This PR enables hot reloading of opencode config** (skill/agents/opencode.json/commands). Shared walkthrough here on X: https://x.com/benjaminshafii/status/2022764591378501888?s=20 ## Motivation I've been working on [OpenWork](https://github.com/different-ai/openwork), an alternative GUI for opencode focused on non-coding use cases, and I've really to needed to have some form of reloading of the opencode config. This new PR enables users to work with opencode config as a "living" system. Users can prompt opencode to add skills/plugin/etc. have them instantly available. **Unlike calling `/instance/dispose`** this is less destructive and **we don't kill existing sessions**. I really need this as part of OpenWork. I have basically three options: 1. I maintain my own fork, which I don't mind in principle, but it's a bit hard to handle. I'm a team of one right now. 2. We merge a version of this feature into opencode 3. provide inferior UX to my users (currently forcing instance dispose which kills all active sessions) ## Implementation Decisions **The general idea is we leave it up to the server consumer to trigger hot reload via an endpoint and we provide events that allows the consumer to see if there's any reason to reload.** Tried to follow`OPENCODE_EXPERIMENTAL_*` conventions. Implemented 1 new endpoints: `/experimental/hotreload` Implemented a new set of events: `opencode.hotreload.{changed,applied}` Out of scope: - **Global Config is ignored**: this is purely scoped at the project level Happy to reduce the surface area of the scope to only skills and/or agents to start with these are the most critical for my workflows. ## Previous issues This has been mentioned in a few issues: - Fixes #8751 - Fixes #10899 which referred to the same thing. I haven't spotted a PR. -- I'm happy to find a way to get this to the finish line. My biggest concern is if it's even a direction that you'd want opencode to take. ### How did you verify your code works? ⚠️ I tested it. (partly!) . I'm running some tests right now but wanted to get this in your field of view to see if that's even a direction that you guys are interested in pursuing. -- Test behavior: 1. Run the new bin file 2. create a skill/plugin/mcp/... 3. [optional: listen for `opencode.hotreload.changed` event] 4. call hot reload `/experimental/hotreload` endpoint 5. try to access the skill agent etc Ran this within opencode <img width="1296" height="672" alt="image" src="https://github.com/user-attachments/assets/cac09286-53cb-41ca-b1b6-a9c0a4e16a4c" /> --- **Would appreciate input to know if that's a direction you'd be open to take**
yindo added the pull-request label 2026-02-16 18:19:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14653