[PR #1175] [CLOSED] serve: a tool's "parameters" / "input_schema" that is not an object is a 400 naming it, not an AttributeError on its first call (#592 follow-up) #3287

Closed
opened 2026-11-07 14:40:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1175
Author: @Avicennasis
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/tools-schema-object


📝 Commits (1)

  • f22fdb0 serve: a tool's "parameters" / "input_schema" that is not an object is a 400 naming it, not an AttributeError on its first call (#592 follow-up)

📊 Changes

2 files changed (+34 additions, -1 deletions)

View changed files

📝 serve/frontend.py (+10 -1)
📝 serve/test_server.py (+24 -0)

📄 Description

Follow-up to #635 / 0.1.39's #592 fix, as you offered there: the schema check.

_tool_list takes a tool with a name and lets its schema be anything. A parameters (OpenAI) or input_schema (Anthropic) that is a string, a number or a list passes the 400 and reaches parse_tool_call and OutputParser as the tool's schema, whose .get("properties") raises AttributeError: 'str' object has no attribute 'get' in the request thread the first time the model calls that tool. On 0.1.40.1's main, with the test suite's CallingEngine and a tool_choice naming a tool whose parameters is "x": a non-streaming request gets the connection closed with no response (RemoteDisconnected); a streaming one gets a 200 and a stream that ends after the first, empty delta, with no error and no finish_reason.

Now a schema is an object when it is there (absent, null and {} go on as before); anything else is a 400 naming the tool's index, its name and the field, before anything is sent, on both APIs with the key each one uses. The test covers a string, a list and a number on /v1/chat/completions (wrapped and bare) and a string, a list and a boolean on /v1/messages, plus the three shapes that still answer. ClientShapes passes as a whole.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1175 **Author:** [@Avicennasis](https://github.com/Avicennasis) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/tools-schema-object` --- ### 📝 Commits (1) - [`f22fdb0`](https://github.com/Niko1221/Strata/commit/f22fdb0fe7243f9287e65d4bd86eb02c8b678b6a) serve: a tool's "parameters" / "input_schema" that is not an object is a 400 naming it, not an AttributeError on its first call (#592 follow-up) ### 📊 Changes **2 files changed** (+34 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `serve/frontend.py` (+10 -1) 📝 `serve/test_server.py` (+24 -0) </details> ### 📄 Description Follow-up to #635 / 0.1.39's #592 fix, as you offered there: the schema check. `_tool_list` takes a tool with a name and lets its schema be anything. A `parameters` (OpenAI) or `input_schema` (Anthropic) that is a string, a number or a list passes the 400 and reaches `parse_tool_call` and `OutputParser` as the tool's schema, whose `.get("properties")` raises `AttributeError: 'str' object has no attribute 'get'` in the request thread the first time the model calls that tool. On 0.1.40.1's `main`, with the test suite's `CallingEngine` and a `tool_choice` naming a tool whose `parameters` is `"x"`: a non-streaming request gets the connection closed with no response (`RemoteDisconnected`); a streaming one gets a 200 and a stream that ends after the first, empty delta, with no error and no finish_reason. Now a schema is an object when it is there (absent, null and `{}` go on as before); anything else is a 400 naming the tool's index, its name and the field, before anything is sent, on both APIs with the key each one uses. The test covers a string, a list and a number on `/v1/chat/completions` (wrapped and bare) and a string, a list and a boolean on `/v1/messages`, plus the three shapes that still answer. `ClientShapes` passes as a whole. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:40:22 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3287
No description provided.