feat: Add core todo tool for structured task tracking (project vs session vs session-store)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Read the core tool registration in internal/core/tools.go and the UI affordances in internal/ui/activity.go and internal/ui/messages.go. First resolve the proposed persistence scope, then inspect the existing session and core tool patterns. Done means implementing and registering the todo tool with validated structured tasks, persistence, and tests; the issue leaves the persistence design open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Feature Description
Add a core tool (todo or todowrite / todoread) that enables the model to create, update, and inspect a persistent, structured checklist during complex multi-step workflows.
This proposal compares three scoping / storage approaches (Project-scoped file, In-memory session, and Kit's native Session-Store) to ensure the task list survives turn-to-turn context compaction, subagent boundaries, or session switches.
Motivation / Use Case
- Combating Context Degradation & Attention Drift: During long-horizon or complex tasks involving multiple file reads, edits, and shell commands, context windows fill up quickly. LLMs often experience attention drift, forgetting early instructions or repeating work. An external checklist anchors the model's focus.
- Compaction-Resistant Working Memory: When context compaction triggers (
internal/compaction), in-context scratchpads can be truncated or summarized away. A todo tool ensures the agent retains an explicit, uncorrupted record of pending and completed tasks. - Resurrecting Built-in Todo Support Natively: Kit previously had an in-process MCP
todoserver (removed in3f2a399ewhen moving to direct core tools). Residual hooks still exist in Kit's TUI (internal/ui/activity.gorenders"Updating todos"andinternal/ui/messages.gofilterstodosarguments). Implementing this as a native core tool directly fulfills those UI affordances with zero MCP/RPC overhead. - Parity with Proven Patterns: Similar built-in checklist tools are core to Goose (
todo-mcp), Claude Code, and other top-performing coding agents to achieve robust instruction following.
Proposed Implementation & Scope Considerations
There are three primary ways to manage the persistence of this list. Feedback is welcomed on which approach fits Kit's philosophy better.
Approach A: Project-Scoped (Workspace File)
State is written to a hidden file in the workspace (e.g. .kit/todos.json).
- Pros: Survives everything. A task list initiated by an agent can be picked up later if the user restarts the terminal, uses the
ctx.NewSession()API for multi-phase handoffs, or delegates to a subagent. - Cons: Mutates the user's workspace filesystem. Requires users to add
.kit/to.gitignore. Requires file locking for concurrency across subagents.
Approach B: Session-Scoped (In-Memory)
State is kept in memory attached to the active session metadata (similar to how Goose implements todo-mcp).
- Pros: Zero filesystem clutter. No concurrency issues across multiple independent terminal sessions in the same repo.
- Cons: State is lost if the CLI is restarted. Subagents or extensions using
ctx.NewSession()would lose the context of the active checklist unless explicitly passed.
Approach C: Session-Store Backed (Kit's Native JSONL Tree via session.ExtensionDataEntry)
State is persisted to Kit's user-level session store (~/.kit/sessions/<cwd>/<session-id>.jsonl) using TreeManager.AppendExtensionData("todo", json) and GetExtensionData("todo").
- Pros:
- Zero repository clutter (no workspace files or
.gitignoreentries needed). - Survives CLI restarts and session resumption (
kit --resume/ session picker). - Survives compaction because
ExtensionDataEntrylives in the persistent tree outside pruned message windows. - Fork/Branching aware: if the user rewinds or branches the session tree, the todo list at that point in tree history can be accurately restored.
- Zero repository clutter (no workspace files or
- Cons:
- Scoped to that session (not automatically shared across brand new sessions unless inherited or forked).
- Requires passing the session's store/tree interface to the tool runner or
ToolConfig.
Shared Tool Definition (internal/core/todo.go)
Regardless of the backing storage, the unified todo core tool would look like:
- Inputs:
todos: Optional list of tasks to overwrite or update.- Each task containing:
id(string): Unique identifier.content(string): Short description.status(string enum:pending,in_progress,completed).priority(string enum:low,medium,high).
- Behavior:
-
If
todosis provided: validates the structure, saves the state, and returns the formatted checklist summary. -
If
todosis omitted or empty: retrieves existing items and returns the formatted checklist. -
Return string renders a human-readable list:
[X] Implement core tool in internal/core/todo.go [~] Add unit tests in internal/core/todo_test.go [ ] Wire into coreTools in internal/core/tools.go
-
Core Tool Registration & UI
- Register in
internal/core/tools.gomap under"todo". - Kit's activity bar (
internal/ui/activity.go) and message formatter (internal/ui/messages.go) already support"todo"/"todos".
Alternatives Considered
- Extension-Only: Ship as a Yaegi extension in
examples/extensions/todo.go. While flexible, task tracking is a fundamental agent capability that should be available by default without extra setup. - Single Markdown File (
.kit/TODO.md): Using raw Markdown instead of structured JSON. JSON provides strict schema validation and structured status transitions (pending->in_progress->completed) which models follow more reliably than unstructured markdown edits.
Checklist
- I've searched existing issues and this hasn't been requested yet
- This feature aligns with Kit's design philosophy (native core tools, zero serialization overhead)
- Ngôn ngữ chính
- Go
- Star
- 157
- Fork
- 33
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mark3labs/kit
-
feat: pin go version in go.modĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
mark3labs/kit#281 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 33/100
mark3labs/kit#280 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của mark3labs/kit
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 60/100
slavakurilyak/awesome-ai-agents#1100 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
hyperledger/SmartBFT#803 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
go_tool_binary: GOMAXPROCS=1 makes a cold builder build 3-4x slowerCó thể đã có người làm @TrapsterDK đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
bazel-contrib/rules_go#4816 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
mark3labs/mcp-go#1397 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
fix(tool/internal/setup): clearer errors when loading rule files from OTELC_RULESCó thể đã có người làm @NeoSamyak đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
open-telemetry/opentelemetry-go-compile-instrumentation#1946 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày