Task-plan tracking and progress-message management#1248
Task-plan tracking and progress-message management#1248dimonb wants to merge 14 commits intosipeed:mainfrom
Conversation
…add chunking to SendMessageWithID
…ge to SendMessageWithID
…ontext` in task tool callbacks, and improve task tool and channel manager error handling.
- Check original key for '/' and '\' before sanitizing in session/manager.go and session/tasks.go, so traversal-like keys are rejected rather than silently normalized by SanitizeFilename (fixes TestSave_RejectsPathTraversal) - Add "tasktool" case to IsToolEnabled switch so tools.tasktool.enabled: false actually disables the tool instead of falling through to default: true
- Add WithToolSessionKey/ToolSessionKey context helpers to pkg/tools/base.go - Inject opts.SessionKey into ctx in runAgentLoop so tasktool uses the same agent-scoped session key as conversation history instead of the bare channel:chatID composite (fixes plan cross-agent/scope collision) - Call Save inside CreatePlan so plans persist after restart even on channels that never return a message ID (fixes data loss on non-Telegram) - Add tasktool section to config/config.example.json and docs/tools_configuration.md (P3 documentation gap)
- Add TaskTool entry to DefaultConfig() with enabled:true and the four icon defaults (🔘/🟡/🟢/🔴), matching the documented defaults - Replace dead default:"..." struct tags on TaskToolIconsConfig with the correct caarlos0/env v11 format env:"VAR,default=VALUE" so env overrides actually work; previously the bare default: tag was silently ignored
…IconsConfig caarlos0/env/v11 does not support a default= option inside the env tag — it caused LoadConfig to fail at startup with "tag option not supported". Defaults are already set correctly in DefaultConfig(), so the option is simply removed.
|
Hi @dimonb, thanks for this valuable PR! Task progress tracking is definitely a feature users need. However, I noticed there's a major Agent Loop refactor being planned: #1316 #1316 will introduce:
These mechanisms could implement tasktool's functionality more elegantly:
Suggestion: Would you consider waiting for #1316 to be completed before implementing tasktool? This would:
Alternatively, if this feature is urgently needed, it could be merged as a temporary solution and refactored together with #1316 later. Would love to hear your thoughts on this. |
|
@yinwm sounds reasonable |
|
@dimonb Hi! This PR has had no activity for over 2 weeks, so I'm closing it for now to keep things tidy. If it's still relevant, feel free to reopen it anytime and we'll pick it back up. |
📝 Description
This PR introduces task-plan tracking and progress-message management from scratch.
It adds a new
tasktoolwith persisted per-session task state, wires the feature into the agent loop, and adds the channel plumbing needed to post and later update a live execution plan. It also rounds out the feature with config support, Telegram chunk-aware message editing, regression tests, and English documentation.High-level changes:
session.TaskManagerfor persisted session-scoped task plans and task updatestasktoolactions forcreate_plan,update_task,list_plan, andresend_planSequentialToolso stateful tools liketasktoolcan preserve model order within one turntasktoolruntime behavior and add a short developer note for tool authors🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
N/A
📚 Technical Context (Skip for Docs)
🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots
go test ./pkg/agent ./pkg/tools ./pkg/channels/telegram ./pkg/sessionPassed locally.
☑️ Checklist