Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the list-parameter schema fix.
No open issues 🎉
What changed in this PR
Fixes make_tool_server failing with KeyError: 'array' when building endpoints for tools with list parameters.
Changes:
- Changes the shared type map to use JSON Schema’s
"array"name for Pythonlist. - Adds a regression test that creates a server for a
list[int]tool, posts an array, and checks the summed result.
| File | Description |
|---|---|
tests/test_tools.py |
Adds an endpoint regression test for list parameters. |
src/aviary/tools/base.py |
Corrects the list mapping from "list" to "array". |
Review effort: Balanced
Author
|
Let me know if you have any thoughts on this one. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's a bug in the tool server:
Tool.from_functiondescribes alist[int]parameter with the JSON Schema type"array", but the type map the server uses to build the request model has"list". Somake_tool_serverraisesKeyError: 'array'for any tool with a list parameter, before any endpoint exists.This changes the
listentry of the type map insrc/aviary/tools/base.pyfrom"list"to"array", the JSON Schema name, so the lookup finds it, the server builds, andPOST {"values": [1, 2]}reaches the tool.Test:
test_make_tool_server_array_parameterintests/test_tools.pyfails on main and passes here. Core tests: 181 passed, 1 skipped (2 live cases deselected); ruff, mypy, refurb and pylint pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N
Note
Low Risk
Single-line mapping fix in shared type metadata; behavior change is limited to enabling list/array tool parameters on the tool server.
Overview
Fixes
make_tool_serverfailing withKeyError: 'array'when a tool parameter is typed as a Pythonlist.type_mapinbase.pynow mapslistto the JSON Schema type"array"(not"list"), matching whatTool.from_functionemits via Pydantic and whatcreate_request_model_from_toolresolves throughreverse_type_map. Tools with list parameters can build HTTP request models and servePOSTbodies with JSON arrays.Adds
test_make_tool_server_array_parameter, which stands up a tool server forlist[int]and asserts a summed result from{"values": [1, 2, 3]}.Reviewed by Cursor Bugbot for commit a960c31. Configure here.