Description
Runtime local config updates made through Config.update() do not round-trip through instance disposal/reload correctly.
Config.update() writes to project-root config.json, but fresh project config loading reads the normal opencode.json / opencode.jsonc paths and local .opencode/opencode.json[c] overlays instead.
Because of that mismatch, a runtime config update can appear to work immediately, then disappear after the instance is disposed and reloaded.
I have a PR prepared for this.
Plugins
alvinunreal/oh-my-opencode-slim
OpenCode version
Observed on v1.15.7 and v1.15.10, and traced on current dev before fix.
Steps to reproduce
- Start with a project where a runtime config update changes agent config through the config update path
- Trigger the config update
- Let the instance get disposed/reloaded
- Use the updated config again after reload
Screenshot and/or share link
No response
Operating System
Linux
Terminal
No response
Expected behavior
Runtime local config updates should be persisted to the local config overlay that fresh reload already reads, so they survive disposal/reload.
Actual behavior
Runtime local updates are written to project-root config.json, which fresh project config loading does not read, so runtime-added config can disappear after reload.
Root cause
Config.update() writes config.json
- project config loading uses
opencode.json / opencode.jsonc + .opencode overlays
- the reload path itself appears fine; the persisted file target is wrong
Proposed fix
Write runtime local updates to the managed local overlay instead:
- prefer existing
.opencode/opencode.jsonc
- else existing
.opencode/opencode.json
- else create
.opencode/opencode.jsonc
This matches the normal local reload path and keeps runtime-managed overrides out of the project root.
Description
Runtime local config updates made through
Config.update()do not round-trip through instance disposal/reload correctly.Config.update()writes to project-rootconfig.json, but fresh project config loading reads the normalopencode.json/opencode.jsoncpaths and local.opencode/opencode.json[c]overlays instead.Because of that mismatch, a runtime config update can appear to work immediately, then disappear after the instance is disposed and reloaded.
I have a PR prepared for this.
Plugins
alvinunreal/oh-my-opencode-slim
OpenCode version
Observed on
v1.15.7andv1.15.10, and traced on currentdevbefore fix.Steps to reproduce
Screenshot and/or share link
No response
Operating System
Linux
Terminal
No response
Expected behavior
Runtime local config updates should be persisted to the local config overlay that fresh reload already reads, so they survive disposal/reload.
Actual behavior
Runtime local updates are written to project-root
config.json, which fresh project config loading does not read, so runtime-added config can disappear after reload.Root cause
Config.update()writesconfig.jsonopencode.json/opencode.jsonc+.opencodeoverlaysProposed fix
Write runtime local updates to the managed local overlay instead:
.opencode/opencode.jsonc.opencode/opencode.json.opencode/opencode.jsoncThis matches the normal local reload path and keeps runtime-managed overrides out of the project root.