Skip to content

feat: add the todo_write and todo_read chat tools - #34

Merged
ibetitsmike merged 5 commits into
mainfrom
mike/todo-transcripts-2-todo-tools
Nov 9, 2026
Merged

ibetitsmike merged 5 commits into
mainfrom
mike/todo-transcripts-2-todo-tools

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #10. Stacked on #32 (merged).

Adds the chat todo tools behind the new experiment fork-chat-todos (PRD 6.6, R6.4). With the experiment off, the tool list and the list_agents output are exactly upstream's.

  • todo_write replaces the chat's whole list (at most 50 items; ids unique, at most 64 bytes; content at most 500 bytes; status pending, in_progress, done or cancelled) and returns the stored list and its version. todo_read returns the list and its version, 0 when the chat has none. Invalid input comes back as a tool error, so the model can retry.
  • Each write publishes ChatTodosEvent{chat_id, version} on chat_todos:<chat id>. The payload carries only the version because NOTIFY caps at 8000 bytes; the UI PR of this stack subscribes and re-reads.
  • list_agents (R6.4): each listed child carries its todos, read as the parent chat's owner (dbauthz.As), never as chatd. Upstream subagent.go gets one hook line that passes its result through forkListAgents in fork_list_agents.go. Workstreams W1 and W2 extend that same function with their fields instead of editing list_agents.
  • codersdk.ChatTodo and its status constants, with typesGenerated.ts regenerated.
  • ARCHITECTURE.md: one TODO for the owner to document the tools; no prose.

Plan mode and explore subagents do not get the todo tools: their allowlists (builtinPlanToolAllowed, exploreToolAllowed) are left unchanged.

Validation: the whole coderd/x/chatd package passes against Postgres 17, including the new tool tests (write, read, validation errors, version bumps, the pubsub event, list_agents with and without the experiment). codersdk experiment tests pass.

Behind the fork-chat-todos experiment, appendForkTools adds todo_write
and todo_read, every write publishes a ChatTodosEvent, and list_agents
shows each child's todo list, read as the owner of the parent chat.
todo_read takes no arguments, so TestBuiltinToolSchemasDescribeTheirInputs
must list it with the other input-less builtin tools. Also drop the unused
codersdk.ChatTodoList type until an endpoint returns it.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T08:10:24.664674Z 27ecac7 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 041d50f010

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/ARCHITECTURE.md Resolved
Comment thread coderd/x/chatd/fork_chat_todos.go Resolved
Comment thread coderd/x/chatd/fork_tools.go Resolved
With fork-chat-todos on, Coder Agents has a durable todo list, so the adapter points skills at todo_write instead of the reply.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike.

Addressed Codex round 1 in c07a81e (pstack adapter doc). The ARCHITECTURE.md TODO and the plan-mode/Explore allowlist findings are dropped with reasons in their threads.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: c07a81ef8c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

todo_write enforces four bounds that no test reached: the item count,
the empty id, and the id and content length limits. A removed bound
would store an oversized list without an error, so add one case per
bound to the rejected-write table. Each case fails when its check is
deleted from validateChatTodos, and a rejected write still leaves the
stored list unchanged.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike.

Added test-only coverage for the todo_write bounds (empty id, id and content length, item count) from the test audit.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 27ecac7ef1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit d06f8af into main Nov 9, 2026
15 of 16 checks passed
@ibetitsmike
ibetitsmike deleted the mike/todo-transcripts-2-todo-tools branch November 9, 2026 08:34
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merged as d06f8af after checking the exact head 27ecac7: fork-ci green, Codex clean on 27ecac7, 0 unresolved threads, and UAT passed on 680bdf9, which differs from the head only in tests and docs. Deployed after #32 (d7d3cf3) was healthy. Open owner item for @ibetitsmike: the TODO(fork-chat-todos) notes in coderd/x/chatd/ARCHITECTURE.md. Follow-up on #10: todo tools in plan mode and Explore children.

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.

1 participant