Skip to content

test(k8s): run gateway smoke calls after LiteLLM upgrade #4885

Open

Description

@devops-cli-service

Update 2026-11-26 (infra move): the gateway is in dan-petty/homelab and runs a newer image.

Run the calls against LiteLLM 1.111.0 or later (k8s/llm/gateway/deployment.yaml of dan-petty/homelab). The group names and fallbacks are in k8s/llm/gateway/config.yaml there. The command devops k8s gateway-check stays devops-cli work. The manual calls are in k8s/README.md, "Smoke check after a gateway upgrade".


Split from #4428.

The LiteLLM upgrade changes the provider path of each hosted model group. No offline test reaches a provider. A short live call shows that a group still answers. The calls need the upgraded gateway in the cluster and the provider keys of Secret llm-gateway-secrets. The gateway manifest is in dan-petty/homelab, and it names LiteLLM 1.111.0. Acceptance criteria: - One short chat call to claude-sonnet-5-5 returns a reply with ANTHROPIC_API_KEY. - One short chat call to claude-haiku-5-5 returns a reply with ANTHROPIC_API_KEY. - One short chat call to gemini-3.8-flash returns a reply with GEMINI_API_KEY. - One short chat call to deepseek-v4.1-flash-1017 returns a reply with OPENROUTER_API_KEY. - A call to claude-sonnet-5-5 with response_format returns a valid structured reply. - Each result is a comment on the upgrade issue. A failed call opens a fix issue with devops gh issues create and the label source/agent.

Proposed design

Problem statement

The LiteLLM upgrade changes the provider path of each hosted model group. No offline test reaches a provider. A short live chat call is the only proof that a group answers.

This item adds devops k8s gateway-check. The command sends one chat call per hosted group through the gateway. It uses the gateway master key. It checks the reply, the served model and the structured reply of claude-sonnet-5-5. It prints a Markdown table and a devops gh issues create command for each failed group. The command and its offline tests need no cluster, key or network. A person runs the live check after the gateway upgrade to LiteLLM 1.111.0 or later.

Acceptance criteria

Requirement: One request per hosted group

devops k8s gateway-check SHALL build one chat request for each of claude-sonnet-5-5, claude-haiku-5-5, gemini-3.8-flash and deepseek-v4.1-flash-1017.

Scenario: Four group requests

  • WHEN the offline test runs the command with the process, HTTP and keyring fakes and --dry-run
  • THEN the plan lists four requests and each request names one of the four groups

Requirement: Gateway key, not a provider key

The check MUST send the gateway master key from keyring llm_gateway_master_key as its bearer and MUST NOT read ANTHROPIC_API_KEY, GEMINI_API_KEY or OPENROUTER_API_KEY.

Scenario: Bearer key

  • WHEN the keyring fake holds llm_gateway_master_key and the offline test runs the check against the HTTP fake
  • THEN each request carries Authorization: Bearer <the keyring value> and no request header or body carries a provider key

Requirement: Missing gateway key

The command MUST fail with a configuration error that names keyring llm_gateway_master_key when the keyring holds no gateway key.

Scenario: No gateway key

  • WHEN the keyring fake holds no llm_gateway_master_key and the check runs without --dry-run
  • THEN the command exits non-zero with an error that names llm_gateway_master_key and the HTTP fake records no request

Requirement: Served model, not a fallback

The check MUST fail when a reply carries no x-litellm-model-name header or names a model other than the expected deployment model of the requested group.

Scenario: Fallback reply

  • WHEN the HTTP fake answers the claude-sonnet-5-5 request with the header openrouter/deepseek/deepseek-v4.1-flash-1017:floor
  • THEN the check fails with an error that names claude-sonnet-5-5 and the served model

Requirement: Structured reply of Sonnet

The request to claude-sonnet-5-5 SHALL carry a response_format of type json_schema, and the check MUST fail when the reply does not match that schema.

Scenario: Reply that misses a schema key

  • WHEN the HTTP fake answers the claude-sonnet-5-5 request with a JSON object that misses one key of the schema
  • THEN the check fails with an error that names the missing key

Requirement: Empty reply fails

The check SHALL fail when a group returns a reply with no content.

Scenario: Empty content

  • WHEN the HTTP fake answers the gemini-3.8-flash request with empty content
  • THEN the check fails with an error that names gemini-3.8-flash

Requirement: Result table and fix command

The command SHALL print one Markdown table row per group and SHALL print a devops gh issues create command with the label source/agent for each failed group.

Scenario: One failed group

  • WHEN the HTTP fake fails deepseek-v4.1-flash-1017 and answers the other three groups
  • THEN the table marks that group as failed, the other rows pass, and one devops gh issues create command names that group and the label source/agent

Requirement: Dry run makes no call

The command SHALL provide --dry-run that lists every request and makes no HTTP request.

Scenario: Dry run

  • WHEN the offline test runs the command with --dry-run and the HTTP fake records every request
  • THEN the plan lists the four calls and the HTTP fake records none

Requirement: Pending a person after the merge

A person MUST run uv run devops k8s gateway-check against the gateway at LiteLLM 1.111.0 or later and MUST post the result table as a comment on the upgrade issue.

Scenario: Live smoke check

  • WHEN a person runs uv run devops k8s gateway-check against the upgraded gateway and posts the table
  • THEN the comment on the upgrade issue holds one row per group, and each failed row has a devops gh issues create command with the label source/agent

Existing Tool Considered

No alternatives check has run. No open maintained tool covers the whole need. httpx and kubectl port-forward cover the transport. The in-repo devops k8s crawl4ai-check and devops k8s searxng-check commands give the shape of a live check: a port-forward, a keyring token, one request per case, a report table, a --dry-run plan and exit 1 on a failed row. The project builds devops k8s gateway-check at about 300 lines in src/devops_cli/k8s/gateway_check.py and src/devops_cli/commands/k8s/gateway_check.py, with about 250 lines of tests. The build costs about 60k tokens to write, review and keep, and half a day, with no new dependency.

Key questions

  • Which hosted groups does the check cover?: The check covers claude-sonnet-5-5, claude-haiku-5-5, gemini-3.8-flash and deepseek-v4.1-flash-1017. [sources: k8s/README.md, src/devops_cli/config/constants.py:3056]
  • Which key does the check send to the gateway?: The check sends the gateway master key from keyring llm_gateway_master_key as Authorization: Bearer. It reads no provider key. [sources: k8s/README.md, src/devops_cli/k8s/cluster_secrets.py:34, src/devops_cli/commands/k8s/crawl4ai_check.py:140]
  • How does the check prove that the named group answered rather than its fallback?: The check compares the reply header x-litellm-model-name with the expected deployment model of the requested group. It fails when the header is absent or names another model. (best practice) [sources: src/devops_cli/ai/client/network.py:178, src/devops_cli/config/constants.py:3056, k8s/README.md]
    • Chosen: Compare the x-litellm-model-name header. The header names the deployment model that served the call, so a fallback is visible.
    • Rejected: Check the reply model field. The router writes the requested group alias in the reply body, so a fallback reply carries the same value.
    • Rejected: Disable fallbacks for the call. The repository documents no per-request switch, and a config change would change production.
  • How can a live check run without breaking the hermetic test floor?: Add devops k8s gateway-check in the shape of devops k8s crawl4ai-check. The offline tests fake the process, HTTP and keyring edges. A person runs the live part. (best practice) [sources: docs/TESTING.md:69, docs/TESTING.md:74, openspec/changes/archive/2026-11-08-3894-crawl4ai-check-command/proposal.md:7, src/devops_cli/commands/k8s/crawl4ai_check.py:115]
    • Chosen: Add a devops k8s gateway-check command. The command has a --dry-run plan, offline tests and a report, and it fits the live check pattern.
    • Rejected: Add a pytest case gated by a live URL. docs/TESTING.md:69 fakes all network edges and docs/TESTING.md:74 forbids a skip on host state.
    • Rejected: Add a shell script under scripts/. It has no --dry-run, no request plan, no report table and no offline test.
  • How does the run record each result and report a failed group?: The command prints one Markdown table with a row per group. For each failed group it prints one devops gh issues create command with the label source/agent. A person posts the table and runs the command. (best practice) [sources: openspec/changes/archive/2026-11-07-1885-audit-five-dashboard-tabs-against-open/proposal.md:48, docs/CLUSTER.md:214, k8s/README.md]
    • Chosen: Print the table and the fix command. The run holds no GitHub token, the offline tests check the text, and a person already runs the live check.
    • Rejected: Post the comment with a GitHub token. It needs a token in the run, and no offline test can check the post.
    • Rejected: Write the comment by hand from the log. It loses the exact reply and the group name and adds a step for each run.
  • How does the check test the structured reply of claude-sonnet-5-5?: The request to claude-sonnet-5-5 carries a response_format of type json_schema. The check fails when the reply misses a schema key. (best practice) [sources: k8s/README.md, src/devops_cli/ai/client/network.py:178]
    • Chosen: Send a response_format with json_schema. The gateway group supports native structured output, and the schema gives a checkable reply.
    • Rejected: Parse a text reply with a regular expression. A text reply gives no schema and cannot show a missing key.
    • Rejected: Send no response_format. The issue asks for a structured reply from claude-sonnet-5-5.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/test
    scope/k8s
    status/new
    value/medium
    effort/low
    on Nov 12, 2026
  2. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    ContributorAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. The check is necessary but it waits on the bump merge and the pod roll, and no user is blocked.
    • Value: Medium. The live calls show that each hosted model group still answers after the upgrade.
    • Effort: Low. Five short calls need the live cluster and the provider keys, and each result is a comment.
    • Related: test(k8s): Smoke-test gateway groups after LiteLLM upgrade #4428, which asks for a different change. Both items check that the gateway model groups answer after the LiteLLM upgrade, and the candidate is one part split from #4428.
  3. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: Does the owner's hold on claude-sonnet-5-5 cover a one-call smoke check? (a person decides)

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  4. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agentstatus/newtype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions