diff --git a/lib/jeannie/commands.sh b/lib/jeannie/commands.sh index 60c4a35..53b8c4b 100644 --- a/lib/jeannie/commands.sh +++ b/lib/jeannie/commands.sh @@ -2087,8 +2087,9 @@ doctor_k8s() { local holmes_combined local holmes_config="${LAB_HOLMES_CONFIG_FILE:-/data/homelab-ai-stack/holmes-config.yaml}" local holmes_api_key="${LAB_AI_GATEWAY_API_KEY:-${OPENAI_API_KEY:-sk_omniroute}}" - local holmes_model="${LAB_HOLMES_MODEL:-${AI_STACK_AGENT_SMART_MODEL:-agent-smart-free}}" + local holmes_model="${LAB_HOLMES_MODEL:-${AI_STACK_AGENT_FAST_MODEL:-agent-fast-free}}" local holmes_fast_model="${LAB_HOLMES_FAST_MODEL:-${AI_STACK_AGENT_FAST_MODEL:-agent-fast-free}}" + local holmes_max_steps="${LAB_HOLMES_MAX_STEPS:-6}" local arg require_debian_server "doctor-k8s" @@ -2135,7 +2136,7 @@ EOF # shellcheck disable=SC1090 . "${tools_env_file}" holmes_api_key="${OPENAI_API_KEY:-${LAB_AI_GATEWAY_API_KEY:-${holmes_api_key}}}" - holmes_model="${LAB_HOLMES_MODEL:-${AI_STACK_AGENT_SMART_MODEL:-${holmes_model}}}" + holmes_model="${LAB_HOLMES_MODEL:-${AI_STACK_AGENT_FAST_MODEL:-${holmes_model}}}" holmes_fast_model="${LAB_HOLMES_FAST_MODEL:-${AI_STACK_AGENT_FAST_MODEL:-${holmes_fast_model}}}" fi if [[ "${holmes_model}" != */* ]]; then @@ -2182,6 +2183,19 @@ EOF failures=$((failures + 1)) fi + : >"${artifact_dir}/problem-pod-details.txt" + awk 'NR > 1 {print $1, $2}' "${artifact_dir}/problem-pods.txt" | + while read -r pod_namespace pod_name; do + [[ -n "${pod_namespace}" && -n "${pod_name}" ]] || continue + { + printf -- '---- %s/%s ----\n' "${pod_namespace}" "${pod_name}" + kubectl --kubeconfig "${kubeconfig}" -n "${pod_namespace}" describe pod "${pod_name}" 2>&1 | + sed -n '/Events:/,$p' | + tail -n 35 + printf '\n' + } >>"${artifact_dir}/problem-pod-details.txt" + done + cat >"${prompt_file}" <"${holmes_stdout}" 2>"${holmes_stderr}" @@ -2265,6 +2284,8 @@ EOF $(sed -n '1,160p' "${holmes_stdout}" 2>/dev/null || true) +$([[ "${holmes_status}" == "124" ]] && printf 'Holmes timed out after %s seconds. The deterministic Kubernetes artifact above is still valid.\n' "${holmes_timeout}" || true) + ## Holmes stderr $(sed -n '1,120p' "${holmes_stderr}" 2>/dev/null || true) diff --git a/lib/jeannie/pipeline.sh b/lib/jeannie/pipeline.sh index a95e6e7..9d1a017 100644 --- a/lib/jeannie/pipeline.sh +++ b/lib/jeannie/pipeline.sh @@ -5477,7 +5477,7 @@ LAB_AI_GATEWAY_API_KEY=${api_key} LAB_AI_GATEWAY_MODEL=${smart_model} AI_STACK_AGENT_FAST_MODEL=${fast_model} AI_STACK_AGENT_SMART_MODEL=${smart_model} -HOLMES_MODEL=openai/${smart_model} +HOLMES_MODEL=openai/${fast_model} HOLMES_FAST_MODEL=openai/${fast_model} HERMES_OPENAI_BASE_URL=${endpoint} HERMES_OMNIROUTE_API_KEY=${api_key}