Skip to content

fix(ai): name benchmark servers and models by host and port - #2666

Merged
dan-petty merged 5 commits into
mainfrom
fix/2481-benchmark-server-labels
Oct 29, 2026
Merged

dan-petty merged 5 commits into
mainfrom
fix/2481-benchmark-server-labels

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

A configured server URL can hold userinfo, which the client sends as Basic authentication. The benchmarks named a server or a model by the text of the URL. Thus the password reached the terminal, the report, the saved JSON file and the kept run.

  • Add server_label and model_label in ai/benchmark/labels.py. They give host[:port] and model@host[:port] from the httpx2 origin, as the AI client names the server of a reply. A URL with no origin shows as unknown.
  • Both runners keep the URL for the requests and write the label. The setup of a kept run lists the labels of --servers and --models.
  • The benchmark errors use the label. A refused --servers entry shows its position and its label.
  • The embeddings engine names an endpoint in its errors and logs without the userinfo. The request still goes to the URL with the userinfo.
  • Old saved reports and kept runs are not rewritten. A person who put a password in a server URL must change it and delete these files.
  • The masking of a user name alone, such as a token, is a separate question: fix(security): redact_text leaves the user name of a URL with no password, so a token used as the user name shows in text #2662.

Change: openspec/changes/archive/2026-10-29-2481-benchmark-server-labels/
Closes #2481

Plans #2481: the benchmarks name each server by host and port, never by a
configured URL with its password.
A server URL in ai.ollama_urls or --servers can hold userinfo, which the client
sends as Basic authentication. The benchmarks wrote the whole URL in the
Workers line, the progress lines, the server of each result and the saved
report. The embedding benchmark also wrote it in its log line.

server_label gives host[:port] from the httpx2 origin, as the AI client names the
server of a reply, and unknown for a URL with no origin. Both runners keep the
URL for the requests and write the label. The setup of a kept run lists labels.
The help of --servers says so.

Closes #2481
A --models entry can be model@endpoint, and the endpoint can hold userinfo,
which the client sends as Basic authentication. The chat benchmark named the
model by the whole entry in the output, in models_evaluated, in each model
field and in the saved report. The setup of the kept run listed --models as
typed, for the chat and the embedding benchmark.

model_label gives model@host[:port]. BenchmarkRunner names each model by it and
keeps the entry in a map for the requests. The setup of the kept run lists the
labels. The help of --models says so. The helpers move to labels.py.
The masking of an error message hides the password of a URL, not a user name
alone, such as a token. A refused --servers entry and a refused embedding
endpoint quoted the URL. The error of a failed embedding run came from the
embeddings engine, which named its endpoint with the URL of the request, so the
error went into the report with the userinfo.

The benchmark builds its errors from server_label, and a refused --servers entry
shows its position and its label. The engine names an endpoint without userinfo
in its errors, their details and its log lines, and still sends the request to
the URL with the userinfo.
@dan-petty dan-petty added scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/security Type security: a vulnerability or a leak labels Oct 29, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results on this branch (HEAD):

  • uv run devops ci test tests/test_ai_benchmark.py tests/test_embedding_benchmark.py tests/test_embedding_benchmark_failure.py tests/test_rag_embeddings.py: 164 passed.
  • Tests reached by the changed sources (devops ci test <sources>): 886 passed.
  • ruff check, ruff format, mypy on the changed modules, devops openspec check and devops docs check: clean.

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main): 21 tests fail on the base and pass on this branch. Summary line:

21 failed on base (21 failed and 141 passed in tests/test_ai_benchmark.py, tests/test_embedding_benchmark.py, tests/test_rag_embeddings.py; 0 errored).

The tests that fail on the base are: the dry run and the CLI run of the chat benchmark for a server and for a model@endpoint entry, a server with no origin, a refused --servers entry (5 cases), the embedding dry run, the CLI run with --servers and with --models, a failed embedding run with a password and with a user name alone, the endpoint errors of the embedding benchmark, and the endpoint text of the embeddings engine.

@dan-petty
dan-petty marked this pull request as ready for review October 29, 2026 15:03
@dan-petty
dan-petty merged commit 8a08031 into main Oct 29, 2026
17 checks passed
@dan-petty
dan-petty deleted the fix/2481-benchmark-server-labels branch October 29, 2026 15:07
dan-petty-release Bot added a commit that referenced this pull request Oct 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.16.5](v0.16.4...v0.16.5)
(2026-10-29)


### Bug Fixes

* **ai:** name benchmark servers and models by host and port
([#2666](#2666))
([8a08031](8a08031)),
closes [#2481](#2481)
* **config:** the audit-keys alert names the removal commands
([#2663](#2663))
([3eb138d](3eb138d)),
closes [#2513](#2513)
* **k8s:** the MCP tool k8s_logs takes no Loki URL
([#2668](#2668))
([39fae85](39fae85)),
closes [#2635](#2635)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/security Type security: a vulnerability or a leak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ai): the benchmarks name each server by host and port, never by a configured URL with its password

1 participant