mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
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:
1 parent
97370a8296
commit
b5dd900efb
53 files changed
+3003
-1665
No files matched your search
@@ -130,21 +130,6 @@ export class OpenCodeSupervisor {
|
||||
})
|
||||
}
|
||||
|
||||
async reloadConfig(reason: OpenCodeOperationReason): Promise<OpenCodeLifecycleStatus> {
|
||||
return this.runLifecycleOperation(async () => {
|
||||
this.setState('starting')
|
||||
|
||||
try {
|
||||
this.openCodeServerManager.clearStartupError()
|
||||
await this.openCodeServerManager.reloadConfig()
|
||||
return this.refreshHealthOrRecover(reason)
|
||||
} catch (error) {
|
||||
this.recordFailure(error)
|
||||
return this.recover(reason)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async checkNow(reason: OpenCodeOperationReason): Promise<OpenCodeLifecycleStatus> {
|
||||
if (reason === 'health_poll' && !this.isWatchEnabled()) {
|
||||
return this.getStatus()
|
||||
@@ -337,6 +322,7 @@ export class OpenCodeSupervisor {
|
||||
}
|
||||
|
||||
private async seedDefaultConfig(): Promise<void> {
|
||||
await archiveBrokenOpenCodeConfigFile()
|
||||
await seedOpenCodeConfigFile()
|
||||
this.openCodeServerManager.clearStartupError()
|
||||
await this.openCodeServerManager.restart()
|
||||
|
||||
Reference in new issue
Block a user