TodoTools
public class TodoTools
io/agentscope/core/tool/builtin/TodoTools.java:49–261Todo 工具,封装可被智能体调用的能力。位于 io.agentscope.core.tool.builtin 包。核心成员包括 todoWrite。
Built-in task-list tool that lets the agent maintain a structured todo list for the current
session, mirroring opencode's todowrite.
The single todo_write tool uses full-list-replace semantics: the model passes
the entire updated list every call and the tool rebuilds
AgentState#getTasksContext() from it. This is intentionally simpler than a granular
create/update/delete surface — the model never has to reason about ids or partial diffs, and the
latest complete list is always the source of truth (and is re-surfaced every turn by
TaskReminderMiddleware).
The list is persisted automatically: AgentState.tasksContext is part of the agent
state that ReActAgent flushes to its AgentStateStore after every call.
This tool is independent from the harness TaskTool (task_output /
task_cancel / task_list), which manages background subagent runs — a
different layer that this tool neither reads nor writes.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
TodoItem | 类class | Todo 条目,让智能体以受控方式调用外部能力。 A single todo item as supplied by the model. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String todoWrite(List<TodoItem> todos, AgentState state) | 执行 `todoWrite` 方法。 Replaces the session task list with `todos`. |
方法详情Method Detail
todoWrite
public String todoWrite(List<TodoItem> todos, AgentState state)
执行 todoWrite 方法。
Replaces the session task list with todos.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
todos | List<TodoItem> | todos(类型 `List`)。The todos. |
state | AgentState | 状态对象(类型 `AgentState`)。The state. |
Stringio/agentscope/core/tool/builtin/TodoTools.java:92–173嵌套类详情Nested Class Detail
TodoItem
public static final class TodoItemTodo 条目,让智能体以受控方式调用外部能力。位于 io.agentscope.core.tool.builtin 包。核心成员包括 getContent、getStatus、getPriority、TodoItem。
A single todo item as supplied by the model.