Repository navigation
Conversation
Programmatic tools rejected output_json_schema values that used type: ["object"], a form JSON Schema, OpenAPI, and MCP generators emit. The params and strict-schema paths already treat that as an object.
seratch
enabled auto-merge (squash)
August 25, 2026 06:23
seratch
disabled auto-merge
August 25, 2026 06:23
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.
Summary
_json_schema_is_object()only treated\"type\": \"object\"as an object schema. JSON Schema also allows a one-element type array (\"type\": [\"object\"]), which OpenAPI and MCP generators commonly emit.That form already works for params because
ensure_strict_json_schema/_ensure_strict_rootnormalize it. The output path checks_json_schema_is_objectfirst, sofunction_tool(..., output_json_schema={\"type\": [\"object\"], ...})raisedUserErrorbefore conversion.Reproduction
Solution
Treat
type == [\"object\"]as an object, matching_ensure_strict_root. Other type arrays such as[\"object\", \"null\"]still fail the object gate / strict conversion.Test plan
type: [\"object\"]uv run pytest tests/test_programmatic_tool_calling.py tests/test_function_tool.py(202 passed)make format,make lint,make typecheckpassedmake tests: 9193 passed, 1 pre-existing failure intests/sandbox/test_run_cwd.py::test_python_skill_uses_absolute_root_from_nested_workdir(reproduced on unmodifiedmain)Issue number
N/A
Checks
/reviewbefore submitting this PR