Skip to content

fix(tools): add todo_list display block to TodoListTool for ACP plan notifications#1013

Open
itxaiohanglover wants to merge 2 commits into
MoonshotAI:mainfrom
itxaiohanglover:fix/todo-list-display-block
Open

fix(tools): add todo_list display block to TodoListTool for ACP plan notifications#1013
itxaiohanglover wants to merge 2 commits into
MoonshotAI:mainfrom
itxaiohanglover:fix/todo-list-display-block

Conversation

@itxaiohanglover

Copy link
Copy Markdown

Fixes #955

Problem

TodoListTool.resolveExecution returns description, approvalRule, and execute but does not return a display field. The ACP adapter has wiring to translate a todo_list display block into an ACP session/update of type plan, but since the display block is never produced, ACP clients never receive live todo/plan updates.

What changed

Added a display field to the return value of resolveExecution:

  • When todos are written (args.todos is defined): returns { kind: 'todo_list', items: [...] }
  • When querying (no args.todos): returns undefined (no display needed for read-only operations)

This triggers the existing ACP adapter wiring in packages/acp-adapter/src/session.ts (lines 1039-1056) which calls planFromDisplayBlock when it sees display.kind === 'todo_list'.

Validation

  • The display schema matches packages/protocol/src/display.ts line 49: { kind: 'todo_list', items: [{title, status}] }
  • Read-only calls (no args.todos) don't produce a display — no behavior change
  • Write calls now produce a display that the ACP adapter can consume

TodoListTool.resolveExecution does not return a display field,
so the ACP adapter never receives todo/plan updates. The wiring
exists in acp-adapter/session.ts and events-map.ts but is never
triggered because the display block is missing.

Fix: return a todo_list display block when todos are written.

Fixes MoonshotAI#955

@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: 3618c2529c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +109 to +110
display: args.todos !== undefined
? { kind: 'todo_list', items: args.todos.map(t => ({ title: t.title, status: t.status })) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear ACP plan when TodoList is emptied

When the model clears an existing list with todos: [], this new display still reaches the ACP path, but packages/acp-adapter/src/events-map.ts::todoListToSessionUpdate currently returns null for an empty items array. That means an ACP client that already received a non-empty plan update will never be told to clear it, so the UI keeps showing stale tasks even though TodoListTool has cleared the store.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch — fixed. When todos is empty, we now return an empty plan update (entries: []) instead of null, so ACP clients clear stale tasks.

todoListToSessionUpdate returned null for empty items, so ACP
clients never received a plan-clear notification. Return an empty
plan update instead so stale tasks are cleared.

Addresses Codex P2 review feedback.
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f072ca1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

ACP todo plan notifications are never sent because TodoListTool omits display block

1 participant