Cookbook Running: short-circuit polls for Ollama sidecar tasks so status stays running

Three different background loops (_reconnectTask reachability poll,
_checkServeReachability, _pollBackgroundStatus) each independently
flipped Ollama sidecar tasks between running and stopped because the
`docker exec ollama-rocm ollama show <tag>` cmd exits cleanly after
its verification print, which the loops misread as the serve dying.

Added _isOllamaSidecarTask(task) and an early-bail in each of the
three loops so the task stays pinned to running once the show-cmd
exits 0. Also the tmux-graceful-kill path prepends a
`docker exec ollama-rocm ollama stop <tag>` before tearing down
the tmux session, so the Ollama-side model load gets unloaded too
(was leaving the model resident in the daemon after Stop).
This commit is contained in:
pewdiepie-archdaemon
2026-06-19 00:33:48 +00:00
parent ee6fd8ffe8
commit 63d9b12b22
+7
View File
@@ -141,6 +141,13 @@ async function _openDownloadForGgufTask(task) {
function _terminalServeDiagnosis(task, outputText) {
const out = String(outputText || task?.output || '');
if (!task || task.type !== 'serve' || !['stopped', 'error', 'crashed', 'failed'].includes(task.status) || !out.trim()) return null;
// Suppress the crash diagnosis when the output proves the server
// actually became reachable — e.g. an early `exit 127` from a failed
// build attempt was followed by the shim/Python fallback successfully
// starting Uvicorn. Without this, the user sees a confusing "build
// stopped before the server became reachable" toast while the server
// is right there serving requests.
if (_serveOutputLooksReady(task)) return null;
// Pip tasks (Reinstall vLLM, Upgrade torch, etc.) ride on the serve task
// type so they get a tmux session + show up in Running tab — but they are
// NOT serve invocations. Their output is pip's own; the generic