fix(llm): nightly uses the gateway's models; no OpenAI defaults #575

Merged
sharang merged 1 commits from fix/nightly-llm-models into main 2026-10-29 07:43:22 +00:00
Owner

Why

SigNoz showed a 98 % error rate on LiteLLM. Almost all of it is the nightly scan regression (.gitea/workflows/nightly.yml, cron 03:00 UTC): it sets LITELLM_URL and the key but no model, so the agent falls back to gpt-4o / text-embedding-3-small — names our gateway does not serve. Result: ~372 chat + 54 embedding requests every night at 03:03–03:07 UTC, all 400 ProxyModelNotFoundError (425/night since at least 16 Oct). Stage and prod set the models and are not affected.

What

  1. nightly.yml — LITELLM_MODEL: Qwen3.8-27B, LITELLM_EMBED_MODEL: bge-multilingual-gemma2 (as stage/prod). The control judge then really runs in the nightly; its control refs stay advisory.
  2. No OpenAI defaults — compliance-agent config and AgentConfig::default() leave both models empty. LlmClient refuses before sending (LLM off: LITELLM_MODEL is not set, same for embeddings), the agent logs one warning at start, and callers take their existing "LLM unavailable" path. .env.example and docs/features/help-chat.md updated.

Checks

cargo fmt --check; clippy -D warnings for compliance-core, compliance-agent, compliance-dashboard (server); cargo test -p compliance-core -p compliance-agent --lib (951 passed) and -p compliance-core --tests. New tests: no chat model → no request reaches a fake gateway; no embed model → no request.

Not in this PR

The nightly also fails since 21 Oct, for other reasons (LLM errors are advisory only):

  • firmware-zephyr-example: the fixture is pinned, but actions/deploy-pages@v5 / upload-artifact@v7 are resolved at scan time, so the baseline breaks on every upstream patch release (5.0.1, 7.0.2).
  • mobile-public-android-nowinandroid (since 28 Oct): mobsfscan:android_manifest_missing_explicit_allow_backup on copyright.xml:1 — a manifest rule on a non-manifest file; it passed on 27 Oct.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4

## Why SigNoz showed a **98 % error rate on LiteLLM**. Almost all of it is the nightly scan regression (`.gitea/workflows/nightly.yml`, cron 03:00 UTC): it sets `LITELLM_URL` and the key but no model, so the agent falls back to `gpt-4o` / `text-embedding-3-small` — names our gateway does not serve. Result: ~372 chat + 54 embedding requests **every night at 03:03–03:07 UTC**, all `400 ProxyModelNotFoundError` (425/night since at least 16 Oct). Stage and prod set the models and are not affected. ## What 1. **nightly.yml** — `LITELLM_MODEL: Qwen3.8-27B`, `LITELLM_EMBED_MODEL: bge-multilingual-gemma2` (as stage/prod). The control judge then really runs in the nightly; its control refs stay advisory. 2. **No OpenAI defaults** — `compliance-agent` config and `AgentConfig::default()` leave both models empty. `LlmClient` refuses before sending (`LLM off: LITELLM_MODEL is not set`, same for embeddings), the agent logs one warning at start, and callers take their existing "LLM unavailable" path. `.env.example` and `docs/features/help-chat.md` updated. ## Checks `cargo fmt --check`; clippy `-D warnings` for compliance-core, compliance-agent, compliance-dashboard (server); `cargo test -p compliance-core -p compliance-agent --lib` (951 passed) and `-p compliance-core --tests`. New tests: no chat model → no request reaches a fake gateway; no embed model → no request. ## Not in this PR The nightly also **fails** since 21 Oct, for other reasons (LLM errors are advisory only): - `firmware-zephyr-example`: the fixture is pinned, but `actions/deploy-pages@v5` / `upload-artifact@v7` are resolved at scan time, so the baseline breaks on every upstream patch release (5.0.1, 7.0.2). - `mobile-public-android-nowinandroid` (since 28 Oct): `mobsfscan:android_manifest_missing_explicit_allow_backup` on `copyright.xml:1` — a manifest rule on a non-manifest file; it passed on 27 Oct. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
sharang added 1 commit 2026-10-28 22:12:20 +00:00
fix(llm): nightly uses the gateway's models; no OpenAI defaults
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 9m47s
48265723fb
The nightly scan regression set LITELLM_URL and the key but no model, so
the agent asked for gpt-4o / text-embedding-3-small, which LiteLLM
refuses: about 425 failed requests every night at 03:03 UTC (98 % of the
gateway's error spans in SigNoz). The workflow now sets the models stage
and prod run (Qwen3.8-27B, bge-multilingual-gemma2).

Without LITELLM_MODEL / LITELLM_EMBED_MODEL the agent no longer falls
back to OpenAI names: LlmClient refuses before sending (chat and
embeddings), the agent warns once at start, and callers take their
existing "LLM unavailable" path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
sharang force-pushed fix/nightly-llm-models from 7e16f49249 to 48265723fb 2026-10-28 22:12:20 +00:00 Compare
sharang merged commit b247c5b359 into main 2026-10-29 07:43:22 +00:00
Sign in to join this conversation.