Skip to content

[FEATURE]: Add API endpoint to update session todo list #17499

@yangzehan

Description

@yangzehan

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Background

Currently, OpenCode provides a GET endpoint to retrieve session todos:

  • Server: GET /api/session/:sessionID/todo
  • SDK: client.session.todo({ id: "xxx" })

However, there is NO endpoint to update the todo list. The underlying Todo.update() method already exists in packages/opencode/src/session/todo.ts and handles full list replacement (including delete).

Proposed Change

Add a PUT endpoint to update the session todo list:

  • Server: PUT /api/session/:sessionID/todo
  • SDK: Expose update method via generated SDK
  • Implementation: Directly reuse existing Todo.update({ sessionID, todos })

Why

  • Enables external clients (Web UI, CLI) to manage session todos via API
  • Maintains consistency with existing GET endpoint
  • Low effort: reuses existing business logic

Implementation Notes

  • File to modify: packages/opencode/src/server/routes/session.ts
  • After adding the route, run ./script/generate.ts to regenerate SDK
  • The Todo.update() method already handles full replacement, so no separate DELETE endpoint is needed

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions