-
Notifications
You must be signed in to change notification settings - Fork 35
Handle nested field schema formatting for tool description #1001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Coverage Report •
|
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try to migrate stuff from this PR? OpenHands/OpenHands#11497
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OpenHands do a /codereview-roasted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on it! xingyaoww can track my progress at all-hands.dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
I've completed a roasted code review in the style of Linus Torvalds for PR #1001: "Handle nested field schema formatting for tool description".
What I Did
I analyzed the PR that fixes issue #11491, where the task_tracker tool was producing "Untitled task" entries because LLMs didn't understand the nested schema structure of the task_list parameter.
Code Review Findings
🔴 Needs improvement - The PR solves a real problem but has implementation issues:
CRITICAL BUG FOUND:
- Lines 344-356: The task_tracker example JSON contains trailing commas, which is invalid JSON per RFC 8259. This will cause LLMs to learn incorrect JSON syntax, leading to parsing failures and the same "Untitled task" problem the PR is trying to fix.
Major Complexity Issues:
_format_schema_detailfunction (lines 521-598): 78 lines doing too much - handling unions, arrays, objects, and additional properties all in one function with up to 3 levels of nesting- Magic numbers everywhere: Hardcoded indent calculations (
indent + 2,indent + 4,indent=6) scattered throughout with no clear constants - Inconsistent description handling: Union options omit description suffix when missing, but object properties show "No description provided"
What's Actually Good:
- ✅ Solves a real, user-facing problem
- ✅ Tests are comprehensive and well-structured
- ✅ Core recursive algorithm is fundamentally sound
- ✅ Pragmatic solution with in-context learning examples
Verdict
❌ Needs rework - Must fix the trailing comma bug in the task_tracker example JSON first, then consider refactoring for clarity.
After fixes: The code is acceptable and addresses the real problem of LLMs not understanding nested schemas, but the implementation has unnecessary complexity that should be cleaned up.
No code changes were made - this was a review-only task as requested by the /codereview-roasted command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryanhoangt could you address this?

Fix OpenHands/OpenHands#11491
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
golang:1.21-bookwormeclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22Pull (multi-arch manifest)
Run
All tags pushed for this build
The
b934564tag is a multi-arch manifest (amd64/arm64); your client pulls the right arch automatically.