Repair VoidBot embedding startup

This commit is contained in:
Meta Vens 2026-07-09 03:10:08 +01:00
commit 02bf57deae
2 changed files with 8 additions and 3 deletions

View file

@ -419,9 +419,13 @@ function Ensure-OllamaEndpoint {
throw "$Label is not reachable at $BaseUrl and the ollama CLI is not available."
}
$stdoutLog = Join-Path $LogDir "ollama-local.log"
$stderrLog = Join-Path $LogDir "ollama-local.err.log"
$process = Start-Process -FilePath $ollamaCommand.Source -ArgumentList "serve" -WorkingDirectory $repoRoot -RedirectStandardOutput $stdoutLog -RedirectStandardError $stderrLog -WindowStyle Hidden -PassThru
$baseUri = [Uri]$BaseUrl
$ollamaHost = if ($baseUri.IsDefaultPort) { $baseUri.Host } else { "$($baseUri.Host):$($baseUri.Port)" }
$logSlug = ($ollamaHost -replace '[^A-Za-z0-9_.-]', '-')
$stdoutLog = Join-Path $LogDir "ollama-local-$logSlug.log"
$stderrLog = Join-Path $LogDir "ollama-local-$logSlug.err.log"
$serveCommand = "set OLLAMA_HOST=$ollamaHost && `"$($ollamaCommand.Source)`" serve"
$process = Start-Process -FilePath "cmd.exe" -ArgumentList @("/c", $serveCommand) -WorkingDirectory $repoRoot -RedirectStandardOutput $stdoutLog -RedirectStandardError $stderrLog -WindowStyle Hidden -PassThru
$startedByScript = $true
$processId = $process.Id
}