authorgravatar for me@t3.ggTheo Browne <me@t3.gg> 2026-09-06 17:02:29-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-06 17:02:29-07:00
log9ab0635db6abb1abf15e664141a0f8b6f0c33eae
tree38758c78d38eb27507181d271b38cd8022adb3a2
parentd3d4ea42ee569f20d8a79562974355f659dc46d9
signature Signed by PGP key B5690EEEBB952194

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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>

1 files changed, 4 insertions(+), 3 deletions(-)

apps/server/src/provider/opencodeRuntime.ts+4-3
...@@ -945,10 +945,11 @@ const makeOpenCodeRuntime = Effect.gen(function* () {...@@ -945,10 +945,11 @@ const makeOpenCodeRuntime = Effect.gen(function* () {
945 ...commandContext,945 ...commandContext,
946 }).pipe(Effect.exit);946 }).pipe(Effect.exit);
947947
948 // First attempt — run all inventory commands in parallel.948 // Every OpenCode CLI command opens the same shared SQLite database. Running them
949 // concurrently causes "database is locked" failures, so run them one at a time.
949 const [initialModelsResult, initialAgentsResult, initialSkillsResult] = yield* Effect.all(950 const [initialModelsResult, initialAgentsResult, initialSkillsResult] = yield* Effect.all(
950 [runModelsCli(), runAgentsCli(), runSkillsCli()],951 [runModelsCli(), runAgentsCli(), runSkillsCli()],
951 { concurrency: "unbounded" },952 { concurrency: 1 },
952 );953 );
953 let modelsResult = initialModelsResult;954 let modelsResult = initialModelsResult;
954 let agentsResult = initialAgentsResult;955 let agentsResult = initialAgentsResult;
...@@ -966,7 +967,7 @@ const makeOpenCodeRuntime = Effect.gen(function* () {...@@ -966,7 +967,7 @@ const makeOpenCodeRuntime = Effect.gen(function* () {
966 needsAgentsRetry ? runAgentsCli() : Effect.succeed(agentsResult),967 needsAgentsRetry ? runAgentsCli() : Effect.succeed(agentsResult),
967 needsSkillsRetry ? runSkillsCli() : Effect.succeed(skillsResult),968 needsSkillsRetry ? runSkillsCli() : Effect.succeed(skillsResult),
968 ],969 ],
969 { concurrency: "unbounded" },970 { concurrency: 1 },
970 );971 );
971 modelsResult = m2;972 modelsResult = m2;
972 agentsResult = a2;973 agentsResult = a2;