-
Notifications
You must be signed in to change notification settings - Fork 228
feat: add tasks tool with dependencies and cross-session persistence #1492
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
Draft
silvin-lubecki
wants to merge
19
commits into
docker:main
Choose a base branch
from
silvin-lubecki:feature/tasks-dependencies
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,550
−8
Draft
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
5159846
feat: add tasks tool with dependency management
silvin-lubecki 11add00
feat: add tests and TUI support for tasks tool
silvin-lubecki ad708d7
chore: use tasks tool in golang_developer agent
silvin-lubecki 67ff0c2
fix: address lint issues in tasks tool
silvin-lubecki 26b45aa
fix(tui): show blocker descriptions instead of IDs in tasks sidebar
silvin-lubecki 7633b5d
feat(tasks): add cross-session persistence
silvin-lubecki 50f8999
feat(tasks): always persist with auto-detected list ID from git repo
silvin-lubecki 5e86780
test(tasks): add tests for worktree and cross-repo task list IDs
silvin-lubecki 2aa86d1
docs: add tasks tool documentation
silvin-lubecki 0be7092
fix(tasks): add handler-level mutex to prevent race conditions
silvin-lubecki 1b1c06e
fix(tasks): add circular dependency check in batch creation and save …
silvin-lubecki b2f3c6b
fix(tasks): fail fast on load error to prevent data loss
silvin-lubecki 2b66cc6
docs: add tasks tool guidance to golang_developer agent prompt
silvin-lubecki 33e5e79
refactor(tasks): simplify to always-shared singleton with file persis…
silvin-lubecki 3455cd2
docs: update tasks tool documentation for always-shared behavior
silvin-lubecki e4a2b57
refactor(tasks): replace singleton with dependency injection via regi…
silvin-lubecki 7a96bbb
fix(tasks): address PR review comments
silvin-lubecki e66f981
fix(fake): prevent panic in StreamCopy when client disconnects
silvin-lubecki 0c9bef0
docs(tasks): clarify task ID format in tool descriptions
silvin-lubecki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| version: "2" | ||
|
|
||
| agents: | ||
| root: | ||
| model: openai/gpt-5-mini | ||
| description: Coordinator that delegates to specialized agents | ||
| instruction: | | ||
| You coordinate work using a shared task list. | ||
| Use transfer_task to delegate work to sub-agents. | ||
| sub_agents: | ||
| - backend | ||
| - frontend | ||
| toolsets: | ||
| - type: tasks | ||
| shared: true | ||
| - type: transfer_task | ||
|
|
||
| backend: | ||
| model: openai/gpt-5-mini | ||
| description: Backend developer | ||
| instruction: | | ||
| You handle backend tasks. | ||
| You share a task list with other agents. | ||
| toolsets: | ||
| - type: tasks | ||
| shared: true | ||
|
|
||
| frontend: | ||
| model: openai/gpt-5-mini | ||
| description: Frontend developer | ||
| instruction: | | ||
| You handle frontend tasks. | ||
| You share a task list with other agents. | ||
| toolsets: | ||
| - type: tasks | ||
| shared: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| version: "2" | ||
|
|
||
| agents: | ||
| root: | ||
| model: openai/gpt-5-mini | ||
| description: Test agent for tasks with dependencies | ||
| instruction: | | ||
| You are a helpful assistant that uses tasks tools with dependencies. | ||
|
|
||
| When creating tasks: | ||
| - Use blocked_by to specify dependencies | ||
| - Use owner to assign tasks | ||
|
|
||
| Always use the tasks tools to track work. | ||
| toolsets: | ||
| - type: tasks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,8 @@ type ToolsetCreator func(ctx context.Context, toolset latest.Toolset, parentDir | |
|
|
||
| // ToolsetRegistry manages the registration of toolset creators by type | ||
| type ToolsetRegistry struct { | ||
| creators map[string]ToolsetCreator | ||
| creators map[string]ToolsetCreator | ||
| sharedTasksTool *builtin.TasksTool // Shared instance for all agents | ||
| } | ||
|
|
||
| // NewToolsetRegistry creates a new empty toolset registry | ||
|
|
@@ -48,6 +49,11 @@ func (r *ToolsetRegistry) Get(toolsetType string) (ToolsetCreator, bool) { | |
|
|
||
| // CreateTool creates a toolset using the registered creator for the given type | ||
| func (r *ToolsetRegistry) CreateTool(ctx context.Context, toolset latest.Toolset, parentDir string, runConfig *config.RuntimeConfig) (tools.ToolSet, error) { | ||
| // Special case for tasks - always returns shared instance | ||
| if toolset.Type == "tasks" { | ||
| return r.GetOrCreateTasksTool(runConfig), nil | ||
| } | ||
|
|
||
| creator, ok := r.Get(toolset.Type) | ||
| if !ok { | ||
| return nil, fmt.Errorf("unknown toolset type: %s", toolset.Type) | ||
|
|
@@ -59,6 +65,7 @@ func NewDefaultToolsetRegistry() *ToolsetRegistry { | |
| r := NewToolsetRegistry() | ||
| // Register all built-in toolset creators | ||
| r.Register("todo", createTodoTool) | ||
| // Note: "tasks" is handled specially in CreateTool - no registration needed | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove comment |
||
| r.Register("memory", createMemoryTool) | ||
| r.Register("think", createThinkTool) | ||
| r.Register("shell", createShellTool) | ||
|
|
@@ -80,6 +87,19 @@ func createTodoTool(_ context.Context, toolset latest.Toolset, _ string, _ *conf | |
| return builtin.NewTodoTool(), nil | ||
| } | ||
|
|
||
| // GetOrCreateTasksTool returns the shared TasksTool instance, creating it if needed | ||
| func (r *ToolsetRegistry) GetOrCreateTasksTool(runConfig *config.RuntimeConfig) *builtin.TasksTool { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we can sync.Once and also put the "tasks" toolset as a normal r.Register, no need to special case it |
||
| if r.sharedTasksTool == nil { | ||
| listID := runConfig.TaskListID | ||
| if listID == "" { | ||
| listID = builtin.DefaultTaskListID() | ||
| } | ||
| store := builtin.NewFileTaskStore(listID) | ||
| r.sharedTasksTool = builtin.NewTasksTool(store) | ||
| } | ||
| return r.sharedTasksTool | ||
| } | ||
|
|
||
| func createMemoryTool(_ context.Context, toolset latest.Toolset, parentDir string, runConfig *config.RuntimeConfig) (tools.ToolSet, error) { | ||
| var memoryPath string | ||
| if filepath.IsAbs(toolset.Path) { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Even if this fixes something we should open this in a new PR