• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubernetes-sigs / inference-perf / 42110332967
87%

Build:
DEFAULT BRANCH: main
Ran 05 Nov 2026 09:21PM UTC
Jobs 1
Files 138
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Nov 2026 09:11PM UTC coverage: 85.803% (+0.06%) from 85.741%
42110332967

push

github

web-flow
Send tool schemas unchanged by default; add opt-in api.clean_tool_schemas (#1026)

Fixes #1025

**Old behavior:** Every tool parameter schema was always rewritten
before being sent (`_clean_parameters` / `_clean_schema` in
`apis/chat.py`, also used by `apis/anthropic_messages.py`). The rewrite
dropped keys such as `default`, `title`, `minimum` and `maxItems`,
collapsed `anyOf`/`oneOf` into `type: string`, coerced object-valued
`additionalProperties` to `false` and added `properties: {}` to bare
objects. So the server tokenized different tool definitions than the
ones in the recorded trace, and the replayed prompt (and its token
count) no longer matched the original.

**New behavior:** Tool schemas are sent as recorded, for both `chat`
(`tools[].function.parameters`) and `anthropic_messages`
(`tools[].input_schema`). Some servers reject valid JSON Schema they
don't support. For those, the same cleanup is now available behind a new
flag, `api.clean_tool_schemas`. It is tested and defaults to `false`, so
by default requests carry the original schemas. Set
`api.clean_tool_schemas: true` (or `--api.clean_tool_schemas true`) to
enable it:

```yaml
api:
  type: chat
  clean_tool_schemas: true
```

The cleanup runs once in
`openAIModelServerClientSession.process_request`, right after
`to_request_body()`. This covers chat, Anthropic Messages and every
subclass (e.g. `SessionChatCompletionAPIData`) without touching each
request builder.

Changes:
- `apis/chat.py`, `apis/anthropic_messages.py`: remove `_clean_schema`,
`_clean_parameters` and `_ALLOWED_JSON_SCHEMA_KEYS`; tool `parameters` /
`input_schema` are passed through unchanged.
- `apis/tool_schema.py` (new): `clean_tool_schema()` (same rewrite rules
as before) and `clean_request_tool_schemas(payload, api_type)`, which
cleans the request body in place for `chat` and `anthropic_messages` and
leaves other API types alone.
- `config/apis/config.py`: new `APIConfig.clean_tool_schemas: bool =
False`.
- `client/m... (continued)

45 of 46 new or added lines in 4 files covered. (97.83%)

13284 of 15482 relevant lines covered (85.8%)

0.86 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
97.56
inference_perf/apis/tool_schema.py
Jobs
ID Job ID Ran Files Coverage
1 42110332967.1 05 Nov 2026 09:21PM UTC 138
85.8
GitHub Action Run
Source Files on build 42110332967
  • Tree
  • List 138
  • Changed 5
  • Source Changed 5
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #42110332967
  • 4c3e8b4d on github
  • Prev Build on main (#42096251049)
  • Next Build on main (#42111912680)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc