Repository navigation
feat(opencode): split opencode.jsonc into tracked default + runtime overlay (#4544) - #4554
Merged
Merged
Conversation
…verlay (#4544) The tracked .opencode/opencode.jsonc carried both the deliberate configuration and the provider model catalogs bin/sync-models.mjs rewrites in place \u2014 the drift source behind the #4464 divergence. Split by ownership, using the fork server native OPENCODE_CONFIG layering (companion: developing-today-forks/opencode#1429): - .opencode/opencode.jsonc keeps deliberate config only: the five sync-owned providers (antigravity-direct, openai-codex, google, openai, cloudflare-gateway) lose their models maps (238 entries); shells stay, models-only google/openai blocks disappear. The maps move verbatim to ~/.local/state/opencode/opencode-runtime.jsonc (migration verified: default+overlay deep-equals the old file). - bin/sync-models.mjs resolves the runtime overlay first, so the timer, the wrapper, and bare invocations all maintain the overlay once it exists; historical fallbacks unchanged pre-split. - home/common/default.nix: sync-models service pinned to the overlay via OPENCODE_CONFIG_PATH; OPENCODE_CONFIG + OPENCODE_CONFIG_PATH in home.sessionVariables so the server and children inherit the layer. - bin/opencode-route-proxy.mjs deep-merges the overlay over its config at load (OPENCODE_ROUTE_PROXY_RUNTIME_CONFIG), cache keyed on both files \u2014 the proxy resolves the same effective catalog. - bin/provider-catalog-sync.mjs diffs the merged effective config (--runtime-config) and skips the five sync-owned providers on --apply; sync-models owns their writes. - pm-stack aggregator: AA coverage + catalog read the effective config (default + overlay) so the split costs no coverage parity.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #4544. Companion fork change: developing-today-forks/opencode#1429 (merged —
Config.updatewrites into the explicitOPENCODE_CONFIGfile when one is configured).What
.opencode/opencode.jsoncwas both the tracked, deliberate OpenCode configuration and the filebin/sync-models.mjsrewrites in place — the drift source behind the #4464 divergence. This splits it by ownership, using the fork server's native config layering (verified against the deployed build: config documents from multiple sources deep-merge per provider/model, and theOPENCODE_CONFIGsource ranks above the global file and is watched for hot reload):.opencode/opencode.jsonc) — deliberate config only. The five sync-owned providers (antigravity-direct,openai-codex,google,openai,cloudflare-gateway) lose theirmodelsmaps (238 entries); shells stay; the models-onlygoogle/openaiblocks disappear. Verified: the new file deep-equals the old file minus exactly those five maps.~/.local/state/opencode/opencode-runtime.jsonc, untracked, machine-maintained) — holds only the five providers'modelsmaps, moved verbatim. Migration proof: default + overlay deep-equals the pre-split effective config exactly.bin/sync-models.mjsresolves the overlay first (env still wins), so the timer, the HM wrapper, and bare invocations maintain the overlay once it exists; the historical fallback chain is unchanged pre-split.home/common/default.nix— the sync-models service is pinned to the overlay (OPENCODE_CONFIG_PATH);OPENCODE_CONFIG+OPENCODE_CONFIG_PATHjoinhome.sessionVariablesso the server, CLI invocations, and children inherit the layering across relaunches.bin/opencode-route-proxy.mjsdeep-merges the overlay over its config at load (OPENCODE_ROUTE_PROXY_RUNTIME_CONFIG, default the state path), cache keyed on both files — the proxy resolves the same effective catalog as the server.bin/provider-catalog-sync.mjsdiffs the merged effective config (--runtime-config, default the state path) and skips the five sync-owned providers on--apply— sync-models owns their writes. New tests pin the merge, the owned set, and the overlay diffing.Tests
node --test bin/sync-models.test.mjs bin/provider-catalog-sync.test.mjs bin/opencode-route-proxy.test.mjs— 63 pass (3 new overlay tests in catalog-sync).bun test test/aa.test.ts(aggregator) — 42 pass.home/common/default.nixparses; all edited scripts passnode --check.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.