GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix: Config Get returns stale data after Patch by Liyw979 · Pull Request #20636 · anomalyco/opencode

Conversation

@Liyw979

@Liyw979 Liyw979 commented Apr 2, 2026

Copy link
Copy Markdown
  • Change config file path from config.json to opencode.json to match the auto-loader which reads from .opencode/opencode.json
  • Add invalidate() call to clear config cache after writing, ensuring subsequent Config.get() calls return updated data

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

Description

After calling the patch /config endpoint to add a custom agent configuration, immediately reading from the /configreturned stale data without the newly patched agent configuration.

What does this PR do?

This PR fixes a configuration caching issue where Config.get() returns stale data after calling Config.update(). The fix ensures that:

  1. Updates are written to the correct file (opencode.json not config.json) that the auto-loader reads
  2. The config cache is cleared after writing, so subsequent reads reflect the updated configuration

How did you verify your code works?

I added a failing test case

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 2, 2026
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No issue referenced. Please add Closes #<number> linking to the relevant issue.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the needs:title label Apr 2, 2026
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Hey! Your PR title Fix: Config Get returns stale data after Patch doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

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

Based on the search results, I found one potentially related PR:

Related PR:

  • fix: resolve config file read/write mismatch in update endpoint #15045 - "fix: resolve config file read/write mismatch in update endpoint"
    • This appears to be addressing a similar issue with config file read/write mismatches in the update endpoint, which relates to the core problem being fixed in PR Fix: Config Get returns stale data after Patch #20636.

The other results are not relevant duplicates - PR #14743 is about Anthropic prompt caching (unrelated) and PR #20316 is about sandboxing configuration (different feature).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Liyw979
fix: Config.update writes to correct file and clears cache
4be7b35
- Change config file path from config.json to opencode.json to match the
  auto-loader which reads from .opencode/opencode.json
- Add invalidate() call to clear config cache after writing
- Add integration test for patch then get config flow
@Liyw979
Liyw979 force-pushed the dev branch from eae0c02 to 4be7b35 Compare April 2, 2026 08:53
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 2, 2026
@github-actions github-actions Bot closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs:title

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Liyw979
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.