fix: Opencode hangs after exit (#3481)

Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
Haris Gušić
2025-10-31 05:57:58 +01:00
committed by GitHub
parent 51e4c9fc4c
commit c1ada302f9
12 changed files with 86 additions and 36 deletions

View File

@@ -77,14 +77,16 @@ export namespace Config {
log.debug("loading config from OPENCODE_CONFIG_DIR", { path: Flag.OPENCODE_CONFIG_DIR })
}
const promises: Promise<void>[] = []
for (const dir of directories) {
await assertValid(dir)
installDependencies(dir)
promises.push(installDependencies(dir))
result.command = mergeDeep(result.command ?? {}, await loadCommand(dir))
result.agent = mergeDeep(result.agent, await loadAgent(dir))
result.agent = mergeDeep(result.agent, await loadMode(dir))
result.plugin.push(...(await loadPlugin(dir)))
}
await Promise.all(promises)
// Migrate deprecated mode field to agent field
for (const [name, mode] of Object.entries(result.mode)) {