Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(agent): raise opencode model-discovery timeout to 15s (MUL-2888) (#3689)

Bohan Jiangfcb5099ec5a1
diff --git a/server/pkg/agent/models.go b/server/pkg/agent/models.go
index 8879cc1f84..b16df16273 100644
--- a/server/pkg/agent/models.go
+++ b/server/pkg/agent/models.go
@@ -352,7 +352,11 @@ func discoverOpenCodeModels(ctx context.Context, executablePath string) ([]Model
if _, err := exec.LookPath(executablePath); err != nil {
return []Model{}, nil
}
- runCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
+ // Newer opencode (1.15+) syncs its hosted free-model catalog over the
+ // network on `opencode models`, which can take ~6s; the previous 5s cap
+ // timed out and returned an empty list, so the runtime showed online but
+ // the model picker was empty. See multica-ai/multica#3627.
+ runCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
defer cancel()
cmd := exec.CommandContext(runCtx, executablePath, "models", "--verbose")
hideAgentWindow(cmd)