Skip to content

Conversation

@tlongwell-block
Copy link
Collaborator

What This Does

Moves the hardcoded TODO task management instructions out of the system prompt and into an extension, making them modular like other built-in extensions.

Key Changes

  • Created a lightweight TodoRouter extension that provides instructions and tool definitions
  • Removed hardcoded "Task Management" section from the system prompt
  • TODO tools execution stays in the agent (unchanged) - only the instructions moved

Why Keep Execution in the Agent?

MCP extensions are designed to be stateless, isolated processes. TODO tools need direct access to session storage for persistence. Rather than building complex state synchronization infrastructure (~800 lines), we use a "metadata-only" extension pattern:

  • The extension provides instructions and tool definitions
  • The agent handles execution where it naturally has session access

This is the right architecture - not a compromise. TODO tools are fundamentally part of session management, so keeping execution in the agent while making instructions modular gives us the best of both worlds.

Testing

  • All existing tests pass
  • TODO tools work exactly as before
  • Instructions now load from extension

@tlongwell-block tlongwell-block changed the title Remove To-Do tool instructions from system prompt, create To-Do exten… Remove To-Do tool instructions from system prompt Aug 30, 2025
@DOsinga
Copy link
Collaborator

DOsinga commented Aug 30, 2025

MCP extensions are designed to be stateless, isolated processes

they are unfortunately not necessarily stateless

I think we should keep the todo extension in the goose crate but just make it as MCP shared as possible same as we should do for platform tools. the extension manager already has an add_client method I think we should be able to use, or nearly should be able to use

workspace = true

[dependencies]
goose = { path = "../goose" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah this doesn't seem ideal, but at least it is in right direction

Example format:
```markdown
- [x] Analyze request fully
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think if we are moving the prompt here we need to make it clear similar to the old system.md one how to do it, including if we want it to use subagents at times (otherwise I found it will not) - https://github.com/block/goose/pull/4421/files#diff-507a51de1f94529d2674a027f5bf6e5eeed83ccfe9cbbe6cea674b75aef65ee8 like that

Copy link
Collaborator Author

@tlongwell-block tlongwell-block Sep 1, 2025

Choose a reason for hiding this comment

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

@tlongwell-block
Copy link
Collaborator Author

MCP extensions are designed to be stateless, isolated processes

they are unfortunately not necessarily stateless

I think we should keep the todo extension in the goose crate but just make it as MCP shared as possible same as we should do for platform tools. the extension manager already has an add_client method I think we should be able to use, or nearly should be able to use

Rough draft #4465

@michaelneale
Copy link
Collaborator

@tlongwell-block do you want to close this in favour of the draft one?

Also #4311 - what is relationship with that PR?

@tlongwell-block
Copy link
Collaborator Author

tlongwell-block commented Sep 3, 2025

@tlongwell-block do you want to close this in favour of the draft one?

Also #4311 - what is relationship with that PR?

#4311 is not related to this and should be considered separate

This PR, 4454, was meant to be the minimal solution to removing the To-Do tool instructions from the system prompt.

#4465 is just an alternative implementation of this PR after @DOsinga commented about trying this out as an internal MCP style approach

My personal preference is probably just to leave it in the system prompt and close both PRs just because I think this is a vital part of the agent tooling that is closely tied to how Goose in general will operate

@tlongwell-block
Copy link
Collaborator Author

Closing to declutter open PRs since this might take a while to think through

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants