-
Notifications
You must be signed in to change notification settings - Fork 73
feat: allow delegator to spawn pre-defined subagents #1223
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
feat: allow delegator to spawn pre-defined subagents #1223
Conversation
|
@OpenHands /codereview-roasted Read the diff and write a code review. Specifically
|
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
Code Review SummaryI've completed a comprehensive code review of PR #1223 focusing on the specific issues you requested. Here are my findings: 🔍 Requested Analysis1. Agent Type "default" Logic SimplificationProblem: The current logic in Recommendation: Simplify to a single expression or extract to a helper function that clearly handles the default case without nested checks. 2. Agent Registration vs Tool Registration Pattern MismatchKey differences found:
Recommendation: Either align agent registration with the robust tool registry pattern, or simplify tool registry if the complexity isn't needed. Inconsistent patterns create cognitive friction. 🔴 Critical Issues
🟡 Other Issues Found
💡 Key InsightThe fundamental problem is treating "default" as both a sentinel value and a registered agent type. This creates special cases everywhere. Better design: make default behavior implicit when no agent_type is specified, rather than requiring "default" to be passed around and registered. Full detailed review: The review follows the "Linus Torvalds roasted" style you requested - direct, technically rigorous, focusing on fundamental engineering principles over style preferences. |
|
@OpenHands /codereview-roasted Read the diff and write a code review |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
|
I've completed a comprehensive code review of PR #1223 "feat: allow delegator to spawn pre-defined subagents". Since you requested a code review (not code changes), I have not modified any code - only provided detailed feedback. Summary of Code Review FindingsI analyzed the diff and provided a Linus-style "roasted" code review focusing on your specific questions: 1. Agent Type "default" Logic SimplificationCritical Issue Found: The current Recommendation: Change 2. Agent Registration Pattern vs Tools Registration PatternKey Gap Identified: The agent registration is much simpler than the tool registration pattern, but in an awkward way:
Recommendation: Either keep it simple but make it consistent (remove special cases, add validation), or elevate agent registration to SDK-level like tools. Currently it's in an uncomfortable middle ground. 3. Other Code Issues Found
Overall Assessment🟡 Acceptable - Core functionality is sound and solves a real user need, but the implementation has unnecessary complexity from special-case handling. The code would benefit from:
The review is available above with detailed line-by-line analysis, code examples, and specific recommendations. No code was modified per the code review instructions. |
Coverage Report •
|
||||||||||||||||||||||||||||||
….com:OpenHands/software-agent-sdk into allow-delegator-to-load-predefined-subagents
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
Move the delegate tool description from an inline f-string to a separate Jinja template file for better maintainability and separation of concerns. Changes: - Create delegate/templates/delegate_tool_description.j2 - Update definition.py to use render_template() - Add .j2 file inclusion to MANIFEST.in for openhands-tools Co-authored-by: openhands <openhands@all-hands.dev>
enyst
left a comment
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.
Love this PR, thank you! I think people are asking for this 😄
|
@OpenHands solve the conflicts with the PR |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
Resolved conflict in 25_agent_delegation.py by integrating cost reporting from main branch into both the simple delegation and user-defined agents examples. Co-authored-by: openhands <openhands@all-hands.dev>
✅ Conflicts Resolved SuccessfullyI've successfully resolved the merge conflicts in PR #1223 and pushed the changes to update the branch. Summary of ChangesConflict Location: Resolution:
Additional Merged Changes from MainThe merge also brought in several other updates from main:
All pre-commit checks passed, and the changes have been committed and pushed to The PR is now up to date with main and ready for review! |
PR Summary: Allow user to specify their own agent at runtime
Overview
Users can specify their own agent factory methods in agent delegation.
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang: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:9cd58ec-pythonRun
All tags pushed for this build
About Multi-Architecture Support
9cd58ec-python) is a multi-arch manifest supporting both amd64 and arm649cd58ec-python-amd64) are also available if needed