|
| 1 | +# V1 API Migration Checklist |
| 2 | + |
| 3 | +The app is currently hybrid. In this document, V1 refers to the legacy unprefixed server APIs used by `@opencode-ai/sdk/v2`, despite the SDK package name. |
| 4 | + |
| 5 | +## Events |
| 6 | + |
| 7 | +- [x] Replace `GET /global/event` with `GET /api/event`. |
| 8 | + - `src/context/server-sdk.tsx` |
| 9 | +- [x] Reduce current granular session and message events into the existing app projections. |
| 10 | + - `src/context/server-session-v2-reducer.ts` |
| 11 | + - `src/context/server-session.ts` |
| 12 | +- [ ] Remove transitional session event dependencies: `session.created`, `session.updated`, `session.diff`, `session.status`, `session.idle`, and `session.error`. |
| 13 | + - `src/context/global-sync/event-reducer.ts` |
| 14 | + - `src/context/server-session.ts` |
| 15 | + - `src/context/notification.tsx` |
| 16 | + - `src/pages/session/usage-exceeded-dialogs.tsx` |
| 17 | +- [ ] Remove legacy message event compatibility: `message.updated`, `message.removed`, `message.part.updated`, `message.part.removed`, and `message.part.delta`. |
| 18 | + - `src/context/global-sync/event-reducer.ts` |
| 19 | + - `src/context/server-session.ts` |
| 20 | +- [x] Adapt current permission and question events to the existing request model. |
| 21 | + - `src/context/global-sync/event-reducer.ts` |
| 22 | + - `src/context/permission.tsx` |
| 23 | +- [x] Consume current file watcher events. |
| 24 | + - `src/context/file.tsx` |
| 25 | +- [x] Consume current VCS events. |
| 26 | + - `src/context/global-sync/event-reducer.ts` |
| 27 | + - `src/pages/session.tsx` |
| 28 | +- [x] Consume current `pty.exited` events. |
| 29 | + - `src/context/terminal.tsx` |
| 30 | +- [ ] Migrate LSP and reference events. |
| 31 | + - `src/context/global-sync/event-reducer.ts` |
| 32 | + |
| 33 | +## Sessions |
| 34 | + |
| 35 | +- [x] Replace `GET /session/status` with one server-scoped `GET /api/session/active` snapshot plus V2 execution events. |
| 36 | + - `src/context/server-sync.tsx` |
| 37 | +- [x] Migrate session listing from `GET /session`. |
| 38 | + - `src/context/server-sync.tsx` |
| 39 | + - `src/context/directory-sync.ts` |
| 40 | + - `src/pages/layout.tsx` |
| 41 | +- [x] Migrate the remaining direct session read from `GET /session/:sessionID`. |
| 42 | + - `src/components/titlebar.tsx` |
| 43 | +- [x] Migrate session updates from `PATCH /session/:sessionID`. |
| 44 | + - `src/context/directory-sync.ts` |
| 45 | + - `src/context/layout.tsx` |
| 46 | + - `src/pages/home.tsx` |
| 47 | + - `src/pages/layout.tsx` |
| 48 | + - `src/pages/session/timeline/message-timeline.tsx` |
| 49 | + - `src/components/titlebar-tab-nav.tsx` |
| 50 | + - Renames use `POST /api/session/:sessionID/rename`; archival uses `POST /api/session/:sessionID/archive`. |
| 51 | +- [x] Migrate session deletion from `DELETE /session/:sessionID`. |
| 52 | + - `src/pages/session/timeline/message-timeline.tsx` |
| 53 | +- [x] Remove session diff loading from `GET /session/:sessionID/diff`. |
| 54 | + - Historical Session diffs remain unavailable until the current API defines their snapshot semantics. |
| 55 | +- [x] Migrate abort from `POST /session/:sessionID/abort`. |
| 56 | + - `src/components/prompt-input/submit.ts` |
| 57 | + - `src/pages/session/use-session-commands.tsx` |
| 58 | + - `src/pages/session.tsx` |
| 59 | +- [x] Migrate revert and unrevert from `POST /session/:sessionID/revert` and `POST /session/:sessionID/unrevert`. |
| 60 | + - `src/pages/session/use-session-commands.tsx` |
| 61 | + - `src/pages/session.tsx` |
| 62 | +- [x] Replace `POST /session/:sessionID/summarize` with the current compact API. |
| 63 | + - `src/pages/session/use-session-commands.tsx` |
| 64 | +- [x] Migrate slash commands from `POST /session/:sessionID/command`. |
| 65 | + - `src/components/prompt-input/submit.ts` |
| 66 | +- [x] Migrate shell execution from `POST /session/:sessionID/shell`. |
| 67 | + - `src/components/prompt-input/submit.ts` |
| 68 | +- [x] Migrate session fork from `POST /session/:sessionID/fork`. |
| 69 | + - `src/components/dialog-fork.tsx` |
| 70 | +- [ ] Migrate sharing from `POST /session/:sessionID/share` and `DELETE /session/:sessionID/share`. |
| 71 | + - `src/pages/session/use-session-commands.tsx` |
| 72 | + - `src/pages/session/timeline/message-timeline.tsx` |
| 73 | + - Blocked: the current API has no sharing contract or implementation. |
| 74 | + |
| 75 | +## Session Compatibility Fallbacks |
| 76 | + |
| 77 | +These calls are retained as fallback adapters. The current production path supplies the current session and message APIs. |
| 78 | + |
| 79 | +- [ ] Remove fallback `GET /session/:sessionID` after compatibility support is unnecessary. |
| 80 | + - `src/context/server-session.ts` |
| 81 | +- [ ] Remove fallback `GET /session/:sessionID/message` after compatibility support is unnecessary. |
| 82 | + - `src/context/server-session.ts` |
| 83 | +- [ ] Remove fallback `GET /session/:sessionID/message/:messageID` after compatibility support is unnecessary. |
| 84 | + - `src/context/server-session.ts` |
| 85 | + |
| 86 | +## Filesystem |
| 87 | + |
| 88 | +- [ ] Migrate file listing from `GET /file`. |
| 89 | + - `src/context/file.tsx` |
| 90 | +- [ ] Migrate file reads from `GET /file/content`. |
| 91 | + - `src/context/file.tsx` |
| 92 | + - `src/pages/session/review-tab.tsx` |
| 93 | + - `src/pages/session/v2/review-panel-v2.tsx` |
| 94 | +- [x] Migrate path discovery from `GET /path` to `GET /api/path`. |
| 95 | + - `src/context/global-sync/bootstrap.ts` |
| 96 | + - `src/components/dialog-select-directory.tsx` |
| 97 | + - `src/components/dialog-select-directory-v2.tsx` |
| 98 | + |
| 99 | +## Projects And Worktrees |
| 100 | + |
| 101 | +- [x] Migrate project listing from `GET /project` to `GET /api/project`. |
| 102 | + - `src/context/global-sync/bootstrap.ts` |
| 103 | +- [x] Migrate the current project lookup from `GET /project/current` to `GET /api/project/current`. |
| 104 | + - `src/context/global-sync/bootstrap.ts` |
| 105 | +- [ ] Migrate Git initialization from `POST /project/git/init`. |
| 106 | + - `src/pages/session.tsx` |
| 107 | +- [x] Migrate project updates from `PATCH /project/:projectID` to `PATCH /api/project/:projectID`. |
| 108 | + - `src/context/layout.tsx` |
| 109 | + - `src/components/edit-project.ts` |
| 110 | + - `src/pages/layout.tsx` |
| 111 | +- [ ] Migrate experimental worktree listing, creation, removal, and reset from `/experimental/worktree`. |
| 112 | + - `src/pages/layout.tsx` |
| 113 | + - `src/components/prompt-input/submit.ts` |
| 114 | + - Listing now uses `GET /api/project/:projectID/directories`; create, removal, and reset remain. |
| 115 | +- [ ] Migrate instance disposal from `POST /instance/dispose`. |
| 116 | + - `src/pages/layout.tsx` |
| 117 | + |
| 118 | +## VCS |
| 119 | + |
| 120 | +- [x] Migrate repository information from `GET /vcs` to `GET /api/vcs`. |
| 121 | + - `src/context/global-sync/bootstrap.ts` |
| 122 | +- [x] Migrate diffs from `GET /vcs/diff` to `GET /api/vcs/diff`. |
| 123 | + - `src/pages/session.tsx` |
| 124 | +- [x] Migrate status from `GET /vcs/status` to `GET /api/vcs/status`. |
| 125 | + - `src/pages/layout.tsx` |
| 126 | + |
| 127 | +## Configuration And Authentication |
| 128 | + |
| 129 | +- [ ] Migrate global configuration reads from `GET /global/config`. |
| 130 | + - `src/context/global-sync/bootstrap.ts` |
| 131 | +- [ ] Migrate directory configuration reads from `GET /config`. |
| 132 | + - `src/context/global-sync/bootstrap.ts` |
| 133 | +- [ ] Migrate global configuration updates from `PATCH /global/config`. |
| 134 | + - `src/context/server-sync.tsx` |
| 135 | +- [x] Migrate provider authentication method discovery from `GET /provider/auth` to `GET /api/integration/:integrationID`. |
| 136 | + - `src/components/dialog-connect-provider.tsx` |
| 137 | +- [x] Migrate built-in provider OAuth authorization and callbacks to `/api/integration/:integrationID/connect/oauth/*`. |
| 138 | + - `src/components/dialog-connect-provider.tsx` |
| 139 | +- [ ] Migrate remaining credentials from `PUT /auth/:providerID` and `DELETE /auth/:providerID`. |
| 140 | + - Built-in provider key connections now use `POST /api/integration/:integrationID/connect/key`. |
| 141 | + - `src/components/dialog-connect-provider.tsx` |
| 142 | + - `src/components/dialog-custom-provider.tsx` |
| 143 | + - `src/components/settings-providers.tsx` |
| 144 | + - `src/components/settings-v2/providers.tsx` |
| 145 | +- [ ] Migrate global disposal from `POST /global/dispose`. |
| 146 | + - `src/components/dialog-connect-provider.tsx` |
| 147 | + - `src/components/settings-providers.tsx` |
| 148 | + - `src/components/settings-v2/providers.tsx` |
| 149 | + |
| 150 | +## Permissions And Questions |
| 151 | + |
| 152 | +- [x] Migrate permission listing from `GET /permission` to `GET /api/permission/request`. |
| 153 | + - `src/context/global-sync/bootstrap.ts` |
| 154 | + - `src/context/permission.tsx` |
| 155 | +- [x] Migrate permission responses from `/session/:sessionID/permissions/:permissionID`. |
| 156 | + - `src/context/permission.tsx` |
| 157 | + - `src/pages/session/composer/session-composer-state.ts` |
| 158 | +- [x] Migrate question listing from `GET /question` to `GET /api/question/request`. |
| 159 | + - `src/context/global-sync/bootstrap.ts` |
| 160 | +- [x] Migrate question replies and rejections from `/question/:requestID/*` to `/api/session/:sessionID/question/:requestID/*`. |
| 161 | + - `src/pages/session/composer/session-question-dock.tsx` |
| 162 | + |
| 163 | +## Commands, MCP, LSP, And References |
| 164 | + |
| 165 | +- [x] Migrate command listing from `GET /command` to `GET /api/command`. |
| 166 | + - `src/context/global-sync/bootstrap.ts` |
| 167 | + - `src/context/server-sync.tsx` |
| 168 | +- [x] Migrate MCP listing, connection, and disconnection from `/mcp` to `/api/mcp`. |
| 169 | + - `src/context/server-sync.tsx` |
| 170 | +- [ ] Replace legacy MCP authentication with the Integration OAuth workflow. |
| 171 | + - `src/context/server-sync.tsx` |
| 172 | +- [x] Migrate experimental resource listing from `GET /experimental/resource` to `GET /api/mcp/resource`. |
| 173 | + - `src/context/server-sync.tsx` |
| 174 | +- [ ] Migrate LSP status from `GET /lsp`. |
| 175 | + - `src/context/server-sync.tsx` |
| 176 | +- [x] Move `GET /api/reference` off the legacy generated SDK transport. |
| 177 | + - `src/context/global-sync/bootstrap.ts` |
| 178 | + |
| 179 | +## Search |
| 180 | + |
| 181 | +- [x] Migrate global session search from `GET /experimental/session` to `GET /api/session`. |
| 182 | + - `src/components/command-palette.ts` |
| 183 | + - `src/components/dialog-command-palette-v2.tsx` |
| 184 | + |
| 185 | +## PTY And Terminal |
| 186 | + |
| 187 | +- [x] Migrate PTY creation, reads, updates, and deletion from `/pty` to `/api/pty`. |
| 188 | + - `src/context/terminal.tsx` |
| 189 | + - `src/components/terminal.tsx` |
| 190 | +- [x] Migrate shell listing from `GET /pty/shells` to `GET /api/pty/shells`. |
| 191 | + - `src/components/settings-general.tsx` |
| 192 | + - `src/components/settings-v2/general.tsx` |
| 193 | +- [x] Migrate connection tokens from `POST /pty/:ptyID/connect-token` to `POST /api/pty/:ptyID/connect-token`. |
| 194 | + - `src/components/terminal.tsx` |
| 195 | +- [x] Migrate the direct WebSocket connection from `/pty/:ptyID/connect` to `/api/pty/:ptyID/connect`. |
| 196 | + - `src/components/terminal.tsx` |
| 197 | + |
| 198 | +## Legacy Types And Adapters |
| 199 | + |
| 200 | +These are not V1 network requests, but they keep the UI coupled to V1 data contracts. |
| 201 | + |
| 202 | +- [ ] Replace the current-session-to-legacy-session adapter. |
| 203 | + - `src/utils/session.ts` |
| 204 | +- [ ] Replace the current-message-to-legacy-message-and-part adapter. |
| 205 | + - `src/utils/session-message.ts` |
| 206 | +- [ ] Replace current agent, provider, and model adapters to legacy SDK structures. |
| 207 | + - `src/context/global-sync/utils.ts` |
| 208 | +- [ ] Replace legacy `Session`, `Message`, `Part`, `PermissionRequest`, `QuestionRequest`, `Project`, `FileNode`, `FileDiffInfo`, and `Event` types throughout app state and rendering. |
| 209 | +- [ ] Remove the `@opencode-ai/sdk` runtime dependency after all legacy calls and types are gone. |
| 210 | + - `package.json` |
| 211 | + |
| 212 | +## Test Infrastructure |
| 213 | + |
| 214 | +- [ ] Replace V1 endpoint mocks with current API mocks. |
| 215 | + - `e2e/utils/mock-server.ts` |
| 216 | +- [x] Replace `/global/event` and `/event` interception with current event transport handling. |
| 217 | + - `e2e/utils/sse-transport.ts` |
| 218 | +- [ ] Replace `SessionV1` and legacy SDK fixtures in timeline performance tests. |
| 219 | + - `e2e/performance/timeline-stability/fixture.ts` |
| 220 | +- [ ] Remove remaining legacy SDK type fixtures from unit and browser tests. |
0 commit comments