anomalyco / anomalyco/opencode

Config.update() writes runtime local config to ignored project-root config.json (re-open)

Open
#42,276 1 comment 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Aug 13, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

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.

Related:

  • Duplicate of #28966 (auto-closed after inactivity)
  • Previous fix attempt PR #28967 was closed unmerged, the bug is still present on dev
Proposed fix

Write runtime local updates to the file the loader reads last (existing .opencode/opencode.jsonc, else .opencode/opencode.json, else plain opencode.json / opencode.jsonc), merging with existing content.

Plugins

No response

OpenCode version

v1.18.2 and current dev

Steps to reproduce
  1. Start with a project where a runtime config update changes agent config through the config update path
  2. Trigger the config update
  3. Let the instance get disposed/reloaded
  4. Use the updated config again after reload
Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.