Skip to content

fix: PATCH /config writes to correct project config file#12347

Closed
saba-ch wants to merge 1 commit intoanomalyco:devfrom
saba-ch:fix/config-update-wrong-file
Closed

fix: PATCH /config writes to correct project config file#12347
saba-ch wants to merge 1 commit intoanomalyco:devfrom
saba-ch:fix/config-update-wrong-file

Conversation

@saba-ch
Copy link
Copy Markdown
Contributor

@saba-ch saba-ch commented Feb 5, 2026

What does this PR do?

Config.update() writes to config.json in the project directory, but the config loader only reads opencode.jsonc and opencode.json — so project-level config updates via PATCH /config are silently lost.

This changes update() to use a new projectConfigFile() helper (mirrors the existing globalConfigFile() pattern) that picks whichever of opencode.jsonc / opencode.json already exists, defaulting to opencode.json.

Fixes #4194
Fixes #6984

How did you verify your code works?

All 57 config tests pass (bun test test/config/config.test.ts). Updated the existing "updates config and writes to file" test to assert against opencode.json instead of config.json.

Config.update() was writing to config.json which is never read by the
config loader. Now writes to opencode.jsonc or opencode.json (whichever
exists), matching the files the loader actually reads. Mirrors the
existing globalConfigFile() pattern.

Fixes anomalyco#4194
Fixes anomalyco#6984
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 5, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions bot closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config autoupdate only respected at global path PATCH /config uses wrong config file

1 participant