Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/goose/src/agents/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub static PLATFORM_EXTENSIONS: Lazy<HashMap<&'static str, PlatformExtensionDef>
PlatformExtensionDef {
name: todo_extension::EXTENSION_NAME,
description:
"Enable a todo list for Goose so it can keep track of what it is doing",
"Enable a todo list for goose so it can keep track of what it is doing",
default_enabled: true,
client_factory: |ctx| Box::new(todo_extension::TodoClient::new(ctx).unwrap()),
},
Expand Down
42 changes: 19 additions & 23 deletions crates/goose/src/agents/todo_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,24 @@ impl TodoClient {
icons: None,
website_url: None,
},
instructions: Some(indoc! {r#"
Task Management

Use todo_write for tasks with 2+ steps, multiple files/components, or uncertain scope.
Your TODO content is automatically available in your context.
instructions: Some(
indoc! {r#"
Your todo content is automatically available in your context.

Workflow:
- Start: write initial checklist
- During: update progress
- End: verify all complete

Warning: todo_write overwrites entirely; always include ALL content you want to keep

Keep items short, specific, action-oriented. Not using the todo tool for complex tasks is an error.

For autonomous work, missing requirements means failure - document all requirements in TODO immediately.

Template:
- [ ] Implement feature X
- [ ] Update API
- [ ] Write tests
- [ ] Run tests
- [ ] Run lint
- [ ] Blocked: waiting on credentials
"#}.to_string()),
- [x] Requirement 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this missing some template wording @tlongwell-block ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's right in the diff. Just hard to grok in the unified view. I trimmed it down a lot because I think it was a bit repetitious

- [ ] Task
- [ ] Sub-task
- [ ] Requirement 2
- [ ] Another task
"#}
.to_string(),
),
};

Ok(Self {
Expand Down Expand Up @@ -251,12 +244,15 @@ impl McpClientTrait for TodoClient {
async fn get_moim(&self) -> Option<String> {
let session_id = self.context.session_id.as_ref()?;
let metadata = SessionManager::get_session(session_id, false).await.ok()?;
let state = extension_data::TodoState::from_extension_data(&metadata.extension_data)?;

if state.content.trim().is_empty() {
return None;
match extension_data::TodoState::from_extension_data(&metadata.extension_data) {
Some(state) if !state.content.trim().is_empty() => {
Some(format!("Current tasks and notes:\n{}\n", state.content))
}
_ => Some(
"Current tasks and notes:\nOnce given a task, immediately update your todo with all explicit and implicit requirements\n"
.to_string(),
),
}

Some(format!("Current tasks and notes:\n{}\n", state.content))
}
}
Loading