Feature 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
Feature hasn't been suggested before.
Describe the enhancement you want to request
Background
Currently, OpenCode provides a GET endpoint to retrieve session todos:
GET /api/session/:sessionID/todoclient.session.todo({ id: "xxx" })However, there is NO endpoint to update the todo list. The underlying
Todo.update()method already exists inpackages/opencode/src/session/todo.tsand handles full list replacement (including delete).Proposed Change
Add a PUT endpoint to update the session todo list:
PUT /api/session/:sessionID/todoTodo.update({ sessionID, todos })Why
Implementation Notes
packages/opencode/src/server/routes/session.ts./script/generate.tsto regenerate SDKTodo.update()method already handles full replacement, so no separate DELETE endpoint is needed