-
Notifications
You must be signed in to change notification settings - Fork 2.6k
subtasks alpha version (still in development) #1123
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
|
|
i have found the failing test, it uses the private provider.cline member that does not exist anymore, it was a direct access to a private member of ClineProvider, this is a bad practice - even for test, i have recreated temporary the cline member as public - just for doing a |
|
i am currently working on 2 last tweaks:
and it should be:
|
f12f2c0 to
0176599
Compare
…setTaskNumber mock
…tTaskNumber, getTaskNumber)
|
Upon reviewing the code it appears that there are no new system instructions, that I read that correctly? It looks like your code he is simple in design: a stack of tasks is generated, and the new code hints in two to the parent task context with the completion message from the child task context (?) to let the parent proceed? I like that there is no involvement with system instructions, the behavior appears automatic. This also means that if there is a bug, it is probably only possible to interfere with users that use (FYI: I was able to get it to merge and tweaked the conflicting line I showed above, hopefully it will not affect anything. still, I think you will need a rebase or some merge magic to clean it up.) |
|
This is pretty cool, I have tried to crash it with some recursive top level instructions, but I couldn't...it performed great. These worked in sonnet-3.5, just paste them and create a task. It is fun if you enable "auto Modes", so you do not have to click approve...and then just watch it fly by: Fibonacci sequence:
Pascal's triangle:
Recursive binary search:
I think my instructions above are working, and I wanted to go inspect each step of the binary tree invocations, but there are just too many tasks in my history to inspect in a way that I understand the invocation order. These binary search instructions are probably working, but who knows. At least the final result looks right... So, is Suggestions, issues:
|
|
the way i see it sub-tasks is a gateway feature to some advanced future features that requires in memory interactions, the reasons i did not chose to reload from history are:
i do not see a downside to keeping a task running waiting on a promise for sub-task to end, the ai is not impacted, the memory consumption is negligible, the CPU is not loading due to several promise activated, and disk is continuously updated with changes the task is performing the second they occur (task does not wait to the end to persist) |
i have rebased and merged from the latest main to resolve conflicts (i hate manual merges - it is because these Cline and ClineProvider are stupidly huge) |
yes, there is no system_prompt changes, but there might be a need to add some, currently it is up to the user or model to call new_task, once it is done the control is returned to the main task, also if the user wants the model to leverage the power of the feature, he can prompt something like this: |
i agree with all the suggested improvements, but i do think a first release should occur, allowing users to try and submit bug reports and requirements (before we go dreaming what is required when the users might direct us to a completely different direction) the visualization and ability to see the task execution order, unique name for each sub-task (not just a number), the ability to break execution and resume from the appropriate sub-task ... all important parts that will need to be in a followup PRs rather then a huge change (IMO) regarding canceling sub-task, or deleting sub-task returning execution to the parent task - that is a planned and developed feature, the first behavior was exactly like you described (sub-task interrupted caused the sub-task to stop and thats it, it did not returned control to the parent, and there was no way to resume the task) i think we should ask the user what he wants to happen (resume parent task and tell it that the sub-task failed ? or exit the task execution and return to history view), since each intend a different thing when canceling a sub-task |
another benefit from this architecture is to reduce the context window size for each task (by not handling it all in a single context) and by that allowing even small models (local ollama models) to perform like the big ones. |
|
@shaybc please cc me or reference this PR# in your next PR or discussion or issue opened on this subject. this is a really great feature and I want to keep up on the neat things that you are doing with it . |







Description
added a feature to allow task to create a sub-tasks that can be executed in a separated way without dependence on the main task or previous tasks history, by that reducing the context size with the ai, avoiding forgetfulness, confusion and hallucinations by the llm,
this is wtill a WIP, haven't succeeded the llm to understand that the task has been performed by the sub-task, and for some reason it insist on re-executing the task again in the main/parent task, even when given the exact task description as a successfully done.
Type of change
new Feature
How Has This Been Tested?
locally, haven't really tested yet since the feature is not fully working
created a file called:
hello_world.pyused a prompt:
tried openAI, Gemini, Ollama models.
Checklist:
Additional context
Related Issues
Reviewers
@mrubens
Important
Adds subtask management to
Clineclass, allowing independent task execution and updates related tests and API handling.Cline.tswithisSubTaskandisPausedflags.setSubTask(),resumePausedTask(), andwaitForResume()methods inCline.ts.ClineProvider.tsto manage a stack ofClineinstances for task/subtask management.registerCommands.tsto useremoveClineFromStack()instead ofclearTask().ClineProvider.test.tsto test new subtask functionality.createClineAPI()inindex.tsto useremoveClineFromStack()for starting new tasks.This description was created by
for c3c3874. It will automatically update as commits are pushed.