Repository navigation
fix(sdk): resolve structured builtin tool specs remotely - #4691
Merged
Merged
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
Python API breakage checks — ✅ PASSEDResult: ✅ PASSED |
Contributor
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
Contributor
VascoSch92
approved these changes
Aug 27, 2026
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.
HUMAN:
AGENT:
This PR was created by an AI agent (OpenHands) on behalf of the user.
Why
Automation preset runs can send an explicit structured
FinishToolspec through a remote conversation. The client-side preset helper registersFinishToollocally, but the serialized tool spec is resolved in the agent-server process. If that server process has not registered the SDK built-in in the global tool registry, remote initialization fails withToolDefinition 'FinishTool' is not registered.Summary
Tool(...)specs that are not present in the process-local registry.FinishToolspecs resolve without a registry entry.Issue Number
N/A
How to Test
Commands run locally:
uv run pytest tests/sdk/tool/test_response_schema.py tests/sdk/tool/test_registry.py tests/tools/test_preset_default.py -q uv run pytest tests/sdk/conversation/test_local_conversation_mcp.py -q uv run pytest tests/sdk/conversation/test_utility_llm_span_metadata.py -q uv run pytest $(cat /tmp/sdk-tail-files.txt) -q uv run pre-commit run --files openhands-sdk/openhands/sdk/tool/registry.py tests/sdk/tool/test_response_schema.py tests/sdk/conversation/test_local_conversation_mcp.py tests/sdk/conversation/test_utility_llm_span_metadata.pyResults:
tests/sdk/conversation/test_utility_llm_span_metadata.pyonward: 3928 passed, 7 skipped, 10 xfailed.A full
uv run pytest tests/sdk -qwas also started after the MCP fix. It progressed past the original MCP failure and later exposed the utility span metadata order-sensitivity fixed in this PR.Video/Screenshots
N/A — backend SDK behavior covered by unit tests.
Design Doc
N/A
Type
Notes
Structured response note: the fallback does not switch
FinishToolback to unstructured mode. Remote conversations already serializeresponse_schemaon the explicitTool(name="FinishTool", ...)spec; this change only lets the server resolve that built-in spec before applying the schema.Opened as draft because the PR template requires the human-only
HUMANsection to be filled by a human before marking ready for review.@malhotra5 can click here to continue refining the PR
🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.13-nodejs22-slimgolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:da3389c-pythonRun
All tags pushed for this build
About Multi-Architecture Support
da3389c-python) is a multi-arch manifest supporting both amd64 and arm64da3389c-python-amd64) are also available if needed