-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Align Dynamic Task Interface with Recipe Interface #4311
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
Conversation
DOsinga
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.
Sorry, didn't really get through this or really to the meat of the thing, looks promising so far, questions so far mostly about whether we are having premature backwards compatibility stuff
I've now removed all the backwards compatibility branches around text instructions |
|
overall it looks good, would like to see how others feel |
|
@tlongwell-block I'm not seeing this make use of subagents at all - is that expected? DOesn't seem to break anything but I dont' really follow this change, seems fine otherwise, but not sure what expectation is (is there another change to get it to plan better to make use of subagents more efficiently?) but have been using it today, and seems A-ok, FWIW |
|
almost there - but I think the system prompt has to be adjusted for sub-agents to be more effective. |
| - [ ] Implement feature X | ||
| - [ ] Update API | ||
| - [ ] Write tests | ||
| - [ ] Run tests (subagent in parallel) |
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.
nice!
michaelneale
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.
have tried this out, benches well apparently, and addresses a bunch of things I wanted to fix with a subagent hardening PR, a good improvement.
|
also for subagents to be useful at all - need this so it doesn't flood the session. |
| "anyOf": [ | ||
| {"required": ["instructions"]}, | ||
| {"required": ["prompt"]} | ||
| ] |
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.
Looks like this addition broke the integration with providers using llama.cpp: #4815
I'm not 100% familiar with the codebase yet, but I'm trying to propose a fix in the upcoming days. I have tracked it down to this line of code.
I'm testing this with ramalama + llama3.2 (with llama.cpp).
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.
cc: @iandouglas
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.
@r0x0d is that lamma.cpp with rust or out of process? (have a branch playing with former as it is easier to ensure it works, but less powerful).
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.
So, I'm suing ramalama for that, and playing out with goose from main brranch (latest commit).
I've seen that with ollama it works fine, the problem seems to be with llama.cpp
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
This PR unifies the dynamic task and subrecipe systems by treating dynamic tasks as inline recipes, enabling agents to leverage the full power of the recipe infrastructure without requiring recipe files.
Key Changes
1. Unified Task Format
Dynamic tasks now accept all recipe fields (instructions, prompt, extensions, settings, retry, response schema, etc.), providing agents with ad-hoc access to recipe capabilities previously only available through recipe files.
2. Extension Control
Agents can now precisely control subagent extensions:
[]: No extensions (sandboxed execution)This addresses a critical bug where subagents always loaded all enabled extensions regardless of task specification.
3. Output Control
Added
return_last_onlyflag allowing agents to receive only the final message from subagents instead of the full conversation, reducing token usage and improving efficiency when intermediate steps aren't needed.Benefits
Performance
Safety
Power
Implementation Details
The implementation leverages existing recipe validation and building infrastructure, requiring minimal new code (~300 lines). Dynamic tasks are converted to inline recipes internally, maintaining backward compatibility while providing forward-looking capabilities.
Technical Approach
TaskConfigto include extensions fieldSubAgent::new()to respect specified extensionsTesting
Breaking Changes
None. All existing dynamic task usage continues to work unchanged.
Migration Path
Existing code requires no changes. New features are opt-in through additional fields in the dynamic task parameters.