Bug
When a user manually adds a config section to opencode-synced.overrides.jsonc that already exists in the repo's base config, and removes it from their local config, stripOverrides restores the base value instead of removing it.
Steps to Reproduce
opencode.json has a server section → pushed to repo
- User adds
server section to opencode-synced.overrides.jsonc (wants it local-only)
- User removes
server from opencode.json
- Run
/sync-push → reports "No local changes to push"
- Repo still contains
server section (should be stripped)
Root Cause
In stripOverrides() (src/sync/config.ts:239-243):
if (isPlainObject(overrideValue) && isPlainObject(currentValue)) {
// recurse...
continue;
}
if (baseValue === undefined) {
delete result[key];
} else {
result[key] = baseValue; // ← restores base when override is object but local doesn't have key
}
When overrideValue is a plain object but currentValue is undefined (key not in local config), the code falls through to the scalar branch and restores the base value instead of deleting the key.
Expected Behavior
If an override declares a key that doesn't exist in the local config, it should be stripped from the repo result regardless of whether the base config has it. The override means "this key is local-only."
Fix
Add a check for currentValue === undefined before the baseValue check:
if (currentValue === undefined || baseValue === undefined) {
delete result[key];
} else {
result[key] = baseValue;
}
Bug
When a user manually adds a config section to
opencode-synced.overrides.jsoncthat already exists in the repo's base config, and removes it from their local config,stripOverridesrestores the base value instead of removing it.Steps to Reproduce
opencode.jsonhas aserversection → pushed to reposerversection toopencode-synced.overrides.jsonc(wants it local-only)serverfromopencode.json/sync-push→ reports "No local changes to push"serversection (should be stripped)Root Cause
In
stripOverrides()(src/sync/config.ts:239-243):When
overrideValueis a plain object butcurrentValueis undefined (key not in local config), the code falls through to the scalar branch and restores the base value instead of deleting the key.Expected Behavior
If an override declares a key that doesn't exist in the local config, it should be stripped from the repo result regardless of whether the base config has it. The override means "this key is local-only."
Fix
Add a check for
currentValue === undefinedbefore thebaseValuecheck: