-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: task tracker for session efficiency #3848
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
katzdave
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.
Cool! Will try it out some today.
|
|
||
| Ok(vec![Content::text(result)]) | ||
| } | ||
| "clear" => { |
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.
clear_all?
| let tasks = self.tasks.lock().unwrap(); | ||
| let mut task_list = Vec::new(); | ||
| for (task, status) in tasks.iter() { | ||
| task_list.push(format!("{} [{}]", task, status.as_str())); |
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.
Should we filter completed tasks so this doesn't grow infinitely?
Maybe mark_task_done is a good place to do this? Remove all done tasks first, then mark the current task as done. Will keep a record then of the most recently completed task for some history but won't be too long running.
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.
yeah - it was either that or I expect the agent to clear tasks, btu yes, that is a good idea to make it clear up front
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 think it may be important for it to keep a list of what it has done over time - until it clears them all, the more I think about it (we can limit it though). The list shoudln't ever be that big or will have other troubles
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 guess was thinking that having too many completed tasks isn't relevant but yeah I think knowing what you did in the past might be helpful contex.
|
|
||
| #[derive(Debug, Clone)] | ||
| pub struct TaskTracker { | ||
| tasks: Arc<Mutex<HashMap<String, TaskStatus>>>, |
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.
Priority and size might be worth considering but seems reasonable to experiment with in a followup.
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.
size - could cap it/push back, but priority - you mean like an order?
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.
yeah like order; claude has high, medium and low.
|
|
||
| match action { | ||
| "list" => { | ||
| let tasks = self.list_tasks(); |
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.
Will experiment with how eager goose is to call this, but maybe we want to add some kind of mechanism to force this onto the end of every message (but not keep it in the context as a traditional message, so we're always presenting the latest state).
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.
hrm - that is an interesting to experiment with, I found with opus/sonnet it is reasonably happy to call it, but yes, that could be good.
One thing I would like to think about @katzdave: should we tweak the prompt so it doesn't ALWAYS use this, ie for non trivial one shot things should it not always call task tracker? I worry it could slow it down eg for some recipe like things, something to think about if you have any intuition there.
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.
this needs to be a platform tool and it should be a system prompt part
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.
as in go into the system prompt? the list should @Kvadratni ?
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.
the usage instructions
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.
tool descriptions usually do go in there already
|
@katzdave ready for another look - some tweaks/simplifying. For size - could include some cap now if you think needed? here it is kicking in after a compaction:
(and in that session, I started with something simple so it didn't kick in) |
|
I think this is better done in this location: #3902 - but should check out if fine grained is better. |

this is a follow on from: #3670
this adds a task tracker tool as part of the developer extension, which is useful when sessions are heavily summarized, these will remain and help keep things on track (but are ephemeral)
this may help address things like: #3841
take a look @katzdave