fix(server): run OpenCode CLI commands sequentially (#10427)

Co-authored-by: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Theo BrowneandClaude Fable 5.1 authored and GitHub committed 2026-09-06 17:02:29 -07:00
1 parent d3d4ea42ee
commit 9ab0635db6
1 file changed
+4 -3
+4 -3
View File
@@ -945,10 +945,11 @@ const makeOpenCodeRuntime = Effect.gen(function* () {
...commandContext,
}).pipe(Effect.exit);
// First attempt — run all inventory commands in parallel.
// Every OpenCode CLI command opens the same shared SQLite database. Running them
// concurrently causes "database is locked" failures, so run them one at a time.
const [initialModelsResult, initialAgentsResult, initialSkillsResult] = yield* Effect.all(
[runModelsCli(), runAgentsCli(), runSkillsCli()],
{ concurrency: "unbounded" },
{ concurrency: 1 },
);
let modelsResult = initialModelsResult;
let agentsResult = initialAgentsResult;
@@ -966,7 +967,7 @@ const makeOpenCodeRuntime = Effect.gen(function* () {
needsAgentsRetry ? runAgentsCli() : Effect.succeed(agentsResult),
needsSkillsRetry ? runSkillsCli() : Effect.succeed(skillsResult),
],
{ concurrency: "unbounded" },
{ concurrency: 1 },
);
modelsResult = m2;
agentsResult = a2;