refactor: remove todo tool (#35989)
This commit is contained in:
parent
d4155f2906
commit
7feefb697f
250 changed files with 237 additions and 4755 deletions
|
|
@ -18,7 +18,7 @@ This does not mean removing SQLite or Drizzle everywhere in one step. The smalle
|
|||
|
||||
## Current Inventory
|
||||
|
||||
Production imports from `packages/opencode/src/storage/db.ts` are concentrated in 22 source files:
|
||||
Production imports from `packages/opencode/src/storage/db.ts` are concentrated in 21 source files:
|
||||
|
||||
- `packages/opencode/src/account/repo.ts`
|
||||
- `packages/opencode/src/cli/cmd/db.ts`
|
||||
|
|
@ -36,13 +36,12 @@ Production imports from `packages/opencode/src/storage/db.ts` are concentrated i
|
|||
- `packages/opencode/src/session/projectors.ts`
|
||||
- `packages/opencode/src/session/prompt.ts`
|
||||
- `packages/opencode/src/session/session.ts`
|
||||
- `packages/opencode/src/session/todo.ts`
|
||||
- `packages/opencode/src/share/share-next.ts`
|
||||
- `packages/opencode/src/storage/db.ts`
|
||||
- `packages/opencode/src/sync/index.ts`
|
||||
- `packages/opencode/src/worktree/index.ts`
|
||||
|
||||
There are 65 direct API/type references in those files. The references fall into the groups below.
|
||||
There are 63 direct API/type references in those files. The references fall into the groups below.
|
||||
|
||||
## Group 1: Database Runtime And Startup
|
||||
|
||||
|
|
@ -151,7 +150,6 @@ Files:
|
|||
- `packages/opencode/src/session/session.ts`
|
||||
- `packages/opencode/src/session/message-v2.ts`
|
||||
- `packages/opencode/src/session/prompt.ts`
|
||||
- `packages/opencode/src/session/todo.ts`
|
||||
- `packages/opencode/src/session/projectors.ts`
|
||||
|
||||
Current usage:
|
||||
|
|
@ -159,7 +157,6 @@ Current usage:
|
|||
- `session/session.ts` uses `Database.use` for session reads, list queries, children, part lookup, and global list helpers.
|
||||
- `session/message-v2.ts` uses `Database.use` to page messages, hydrate parts, fetch one message, and fetch parts.
|
||||
- `session/prompt.ts` imports `eq` from `@/storage/db` and reads current prompt-related session/message rows directly.
|
||||
- `session/todo.ts` uses `Database.transaction` for todo replacement and `Database.use` for list reads.
|
||||
- `session/projectors.ts` uses `TxOrDb` for session/message usage projection helpers.
|
||||
|
||||
Why this group should be split:
|
||||
|
|
@ -171,7 +168,6 @@ Why this group should be split:
|
|||
Target shape:
|
||||
|
||||
- Create or use a session/message read module with Effect-native methods for `get`, `list`, `page`, `parts`, and prompt assembly reads.
|
||||
- Move todo persistence either into a session todo repository or into the sync event projection path.
|
||||
- Convert `session/projectors.ts` only after Group 2 defines the replacement projector transaction type.
|
||||
|
||||
Suggested order:
|
||||
|
|
@ -179,7 +175,6 @@ Suggested order:
|
|||
- Migrate `session/message-v2.ts` reads first because the module already centralizes message pagination and hydration.
|
||||
- Migrate `session/session.ts` read helpers next.
|
||||
- Migrate `session/prompt.ts` after message/session reads exist, and import drizzle operators from `drizzle-orm` if any direct SQL remains temporarily.
|
||||
- Migrate `session/todo.ts` writes with the sync transaction work or move them behind a repository.
|
||||
|
||||
## Group 5: Legacy CLI And One-Off Admin Reads
|
||||
|
||||
|
|
|
|||
|
|
@ -926,13 +926,6 @@ sessionID -> { directory, workspaceID? }</code></pre>
|
|||
<td class="route"><code>POST /api/session/:sessionID/prompt</code></td>
|
||||
<td>Create a user message and queue the agent loop.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="operation"><code>session.todo</code></td>
|
||||
<td class="body"><code>{ sessionID: SessionID }</code></td>
|
||||
<td><span class="context-tag session">session</span></td>
|
||||
<td class="route"><code>GET /api/session/:sessionID/todo</code></td>
|
||||
<td>Return todos associated with the session.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="operation"><code>session.update</code></td>
|
||||
<td class="body">
|
||||
|
|
@ -1143,7 +1136,6 @@ type SyncStore = {
|
|||
|
||||
session: Record<SessionID, Session & { context: RuntimeContext }>
|
||||
session_diff: Record<SessionID, Snapshot.FileDiff[]>
|
||||
todo: Record<SessionID, Todo[]>
|
||||
permission: Record<SessionID, PermissionRequest[]>
|
||||
question: Record<SessionID, QuestionRequest[]>
|
||||
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ Change:
|
|||
- Add Location-scoped pending permission requests with `once`, `always`, and `reject` replies.
|
||||
- Attach optional originating tool message and call IDs.
|
||||
- Preserve authored ordered rules and saved approvals as separate inputs to evaluation.
|
||||
- Establish action and resource conventions for `read`, `glob`, `grep`, `edit`, `external_directory`, `bash`, `todowrite`, and `webfetch` approvals.
|
||||
- Establish action and resource conventions for `read`, `glob`, `grep`, `edit`, `external_directory`, `bash`, and `webfetch` approvals.
|
||||
|
||||
Reason:
|
||||
|
||||
|
|
@ -580,37 +580,15 @@ Compatibility:
|
|||
- These are additive experimental V2 contracts.
|
||||
- No database migration is required because pending questions are intentionally in-memory Location state.
|
||||
|
||||
## 2026-06-03: Core-Owned Todo Update Event
|
||||
|
||||
Affected schema:
|
||||
|
||||
- Core-owned `SessionTodo.Info`.
|
||||
- Global `todo.updated` event registration.
|
||||
|
||||
Change:
|
||||
|
||||
- Register the todo update event from Core session-todo ownership and expose the existing todo item shape to the Core V2 tool.
|
||||
|
||||
Reason:
|
||||
|
||||
- Embedded V2 `todowrite` execution needs Core-owned persistence and update publication without importing legacy application orchestration.
|
||||
|
||||
Compatibility:
|
||||
|
||||
- The todo table and public todo update event shape are preserved.
|
||||
- No database migration is required.
|
||||
|
||||
## 2026-06-03: Added Core V2 Tool Schemas
|
||||
|
||||
Affected schema:
|
||||
|
||||
- New `todowrite` tool parameters and success payload.
|
||||
- New `question` tool parameters and success payload.
|
||||
- New `webfetch` tool parameters and success payload.
|
||||
|
||||
Change:
|
||||
|
||||
- Add a todo replacement-list tool using `SessionTodo.Info` items.
|
||||
- Add a question tool using ordered `QuestionV2.Prompt` values and ordered answer arrays.
|
||||
- Add an HTTP(S) fetch tool with explicit `text`, `markdown`, and `html` formats, bounded timeout input, and optional managed output resource metadata.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue