fix: keep serve preflight errors visible (#398)

This commit is contained in:
spooky
2026-06-01 23:40:06 +10:00
committed by GitHub
parent 4b72dd407b
commit 15822e91ff
3 changed files with 44 additions and 6 deletions
+11
View File
@@ -214,6 +214,17 @@ def _validate_serve_cmd(v: str | None) -> str | None:
return v
def _append_serve_preflight_exit_lines(runner_lines: list[str], *, keep_shell_open: bool) -> None:
"""Append serve-runner lines that surface preflight failures before exit."""
runner_lines.append('if [ -n "$ODYSSEUS_PREFLIGHT_EXIT" ]; then')
runner_lines.append(' echo ""; echo "=== Process exited with code $ODYSSEUS_PREFLIGHT_EXIT ==="')
if keep_shell_open:
runner_lines.append(' exec "${SHELL:-/bin/bash}"')
else:
runner_lines.append(' exit "$ODYSSEUS_PREFLIGHT_EXIT"')
runner_lines.append('fi')
class ModelDownloadRequest(BaseModel):
repo_id: str
include: str | None = None # glob pattern e.g. "*Q4_K_M*"