Compare commits

...

1 Commits

Author SHA1 Message Date
J
053783a766 fix(agent): raise opencode model-discovery timeout to 15s (MUL-2888)
Newer opencode (1.15+) syncs its hosted free-model catalog over the
network on `opencode models`, which can take ~6s. The previous 5s cap
killed the command, discoverOpenCodeModels returned an empty list, and
the daemon reported it as a successful empty result — so the runtime
showed online but the model picker was empty ("暂无可用模型").

Fixes #3627

Co-authored-by: multica-agent <github@multica.ai>
2026-06-03 12:15:48 +08:00

View File

@@ -342,7 +342,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")
hideAgentWindow(cmd)