feat(config): support layered OpenCode config sources with revision-guarded saves (#358)

* feat(config): support layered OpenCode config sources with revision-guarded saves

* refactor(config): harden multi-source OpenCode config handling

- extract shared config-source helpers and default source name
- reject shadowed removals with 409 and require sources/revision
- restart the server on reload with session resume
- mirror multiple host config files on import and warn on removals
- skip restart for mcp-only saves
- drop removedFields and CONFIG_PATCH_TIMEOUT_MS

* fix(config): return null when archiving broken OpenCode config fails
This commit is contained in:
Chris Scott authored and GitHub committed 2026-09-20 15:51:40 -04:00
1 parent 97370a8296
commit b5dd900efb
53 files changed
+3003 -1665

No files matched your search

@@ -17,7 +17,6 @@ vi.mock('bun:sqlite', () => ({
vi.mock('../../src/services/opencode-single-server', () => ({
opencodeServerManager: {
restart: vi.fn(),
reloadConfig: vi.fn(),
getVersion: vi.fn(),
fetchVersion: vi.fn(),
clearStartupError: vi.fn(),
@@ -27,7 +26,6 @@ vi.mock('../../src/services/opencode-single-server', () => ({
},
ConfigReloadError: class ConfigReloadError extends Error {
validationIssues = []
removedFields = []
},
}))
@@ -242,7 +240,6 @@ describe('OpenCode Server Auth Routes', () => {
isOperationInProgress: vi.fn(() => false),
checkHealth: vi.fn().mockResolvedValue(true),
restart: vi.fn().mockResolvedValue(undefined),
reloadConfig: vi.fn().mockResolvedValue(undefined),
clearStartupError: vi.fn(),
getLastStartupError: vi.fn(() => null),
isLastStartupErrorNonRecoverable: vi.fn(() => false),