Rules are ordered and first-match-wins: model glob, path glob, required context, hook/retry overrides, pass <endpoint>[,<endpoint>] [as <model>] or block. Endpoints carry shell pre-hooks (exit != 0 = not yet, retried with backoff after an optional wake command), an offline window after a failed connect, and two timeouts (idle + total) so a thinking model logs still_working instead of looking hung. tests/run.sh: 14 checks against C stubs (failing, gated, slow, dead endpoints).
12 lines
416 B
Bash
Executable File
12 lines
416 B
Bash
Executable File
#!/bin/sh
|
|
# Usable right now? One short GET against the endpoint's own model list.
|
|
# Exit 0 = yes. Anything else = not now, and the reason goes to stdout.
|
|
url="${JUNCTION_BASE%/}/models"
|
|
code=$(curl -s -o /dev/null -m 5 -w '%{http_code}' "$url" 2>/dev/null) || {
|
|
echo "no_answer_from_${JUNCTION_BACKEND}"; exit 1
|
|
}
|
|
case "$code" in
|
|
2*) exit 0 ;;
|
|
*) echo "http_${code}_from_${JUNCTION_BACKEND}"; exit 1 ;;
|
|
esac
|