mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-03 23:43:38 +00:00
10 KiB
10 KiB
V1 API Migration Checklist
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.
Events
- Replace
GET /global/eventwithGET /api/event.src/context/server-sdk.tsx
- Reduce current granular session and message events into the existing app projections.
src/context/server-session-v2-reducer.tssrc/context/server-session.ts
- Remove transitional session event dependencies:
session.created,session.updated,session.diff,session.status,session.idle, andsession.error.src/context/global-sync/event-reducer.tssrc/context/server-session.tssrc/context/notification.tsxsrc/pages/session/usage-exceeded-dialogs.tsx
- Remove legacy message event compatibility:
message.updated,message.removed,message.part.updated,message.part.removed, andmessage.part.delta.src/context/global-sync/event-reducer.tssrc/context/server-session.ts
- Adapt current permission and question events to the existing request model.
src/context/global-sync/event-reducer.tssrc/context/permission.tsx
- Consume current file watcher events.
src/context/file.tsx
- Consume current VCS events.
src/context/global-sync/event-reducer.tssrc/pages/session.tsx
- Consume current
pty.exitedevents.src/context/terminal.tsx
- Migrate LSP and reference events.
src/context/global-sync/event-reducer.ts
Sessions
- Replace
GET /session/statuswith one server-scopedGET /api/session/activesnapshot plus V2 execution events.src/context/server-sync.tsx
- Migrate session listing from
GET /session.src/context/server-sync.tsxsrc/context/directory-sync.tssrc/pages/layout.tsx
- Migrate the remaining direct session read from
GET /session/:sessionID.src/components/titlebar.tsx
- Migrate session updates from
PATCH /session/:sessionID.src/context/directory-sync.tssrc/context/layout.tsxsrc/pages/home.tsxsrc/pages/layout.tsxsrc/pages/session/timeline/message-timeline.tsxsrc/components/titlebar-tab-nav.tsx- Renames use
POST /api/session/:sessionID/rename; archival usesPOST /api/session/:sessionID/archive.
- Migrate session deletion from
DELETE /session/:sessionID.src/pages/session/timeline/message-timeline.tsx
- Remove session diff loading from
GET /session/:sessionID/diff.- Historical Session diffs remain unavailable until the current API defines their snapshot semantics.
- Migrate abort from
POST /session/:sessionID/abort.src/components/prompt-input/submit.tssrc/pages/session/use-session-commands.tsxsrc/pages/session.tsx
- Migrate revert and unrevert from
POST /session/:sessionID/revertandPOST /session/:sessionID/unrevert.src/pages/session/use-session-commands.tsxsrc/pages/session.tsx
- Replace
POST /session/:sessionID/summarizewith the current compact API.src/pages/session/use-session-commands.tsx
- Migrate slash commands from
POST /session/:sessionID/command.src/components/prompt-input/submit.ts
- Migrate shell execution from
POST /session/:sessionID/shell.src/components/prompt-input/submit.ts
- Migrate session fork from
POST /session/:sessionID/fork.src/components/dialog-fork.tsx
- Migrate sharing from
POST /session/:sessionID/shareandDELETE /session/:sessionID/share.src/pages/session/use-session-commands.tsxsrc/pages/session/timeline/message-timeline.tsx- Blocked: the current API has no sharing contract or implementation.
Session Compatibility Fallbacks
These calls are retained as fallback adapters. The current production path supplies the current session and message APIs.
- Remove fallback
GET /session/:sessionIDafter compatibility support is unnecessary.src/context/server-session.ts
- Remove fallback
GET /session/:sessionID/messageafter compatibility support is unnecessary.src/context/server-session.ts
- Remove fallback
GET /session/:sessionID/message/:messageIDafter compatibility support is unnecessary.src/context/server-session.ts
Filesystem
- Migrate file listing from
GET /file.src/context/file.tsx
- Migrate file reads from
GET /file/content.src/context/file.tsxsrc/pages/session/review-tab.tsxsrc/pages/session/v2/review-panel-v2.tsx
- Migrate path discovery from
GET /pathtoGET /api/path.src/context/global-sync/bootstrap.tssrc/components/dialog-select-directory.tsxsrc/components/dialog-select-directory-v2.tsx
Projects And Worktrees
- Migrate project listing from
GET /projecttoGET /api/project.src/context/global-sync/bootstrap.ts
- Migrate the current project lookup from
GET /project/currenttoGET /api/project/current.src/context/global-sync/bootstrap.ts
- Migrate Git initialization from
POST /project/git/init.src/pages/session.tsx
- Migrate project updates from
PATCH /project/:projectIDtoPATCH /api/project/:projectID.src/context/layout.tsxsrc/components/edit-project.tssrc/pages/layout.tsx
- Migrate experimental worktree listing, creation, removal, and reset from
/experimental/worktree.src/pages/layout.tsxsrc/components/prompt-input/submit.ts- Listing now uses
GET /api/project/:projectID/directories; create, removal, and reset remain.
- Migrate instance disposal from
POST /instance/dispose.src/pages/layout.tsx
VCS
- Migrate repository information from
GET /vcstoGET /api/vcs.src/context/global-sync/bootstrap.ts
- Migrate diffs from
GET /vcs/difftoGET /api/vcs/diff.src/pages/session.tsx
- Migrate status from
GET /vcs/statustoGET /api/vcs/status.src/pages/layout.tsx
Configuration And Authentication
- Migrate global configuration reads from
GET /global/config.src/context/global-sync/bootstrap.ts
- Migrate directory configuration reads from
GET /config.src/context/global-sync/bootstrap.ts
- Migrate global configuration updates from
PATCH /global/config.src/context/server-sync.tsx
- Migrate provider authentication method discovery from
GET /provider/authtoGET /api/integration/:integrationID.src/components/dialog-connect-provider.tsx
- Migrate built-in provider OAuth authorization and callbacks to
/api/integration/:integrationID/connect/oauth/*.src/components/dialog-connect-provider.tsx
- Migrate remaining credentials from
PUT /auth/:providerIDandDELETE /auth/:providerID.- Built-in provider key connections now use
POST /api/integration/:integrationID/connect/key. src/components/dialog-connect-provider.tsxsrc/components/dialog-custom-provider.tsxsrc/components/settings-providers.tsxsrc/components/settings-v2/providers.tsx
- Built-in provider key connections now use
- Migrate global disposal from
POST /global/dispose.src/components/dialog-connect-provider.tsxsrc/components/settings-providers.tsxsrc/components/settings-v2/providers.tsx
Permissions And Questions
- Migrate permission listing from
GET /permissiontoGET /api/permission/request.src/context/global-sync/bootstrap.tssrc/context/permission.tsx
- Migrate permission responses from
/session/:sessionID/permissions/:permissionID.src/context/permission.tsxsrc/pages/session/composer/session-composer-state.ts
- Migrate question listing from
GET /questiontoGET /api/question/request.src/context/global-sync/bootstrap.ts
- Migrate question replies and rejections from
/question/:requestID/*to/api/session/:sessionID/question/:requestID/*.src/pages/session/composer/session-question-dock.tsx
Commands, MCP, LSP, And References
- Migrate command listing from
GET /commandtoGET /api/command.src/context/global-sync/bootstrap.tssrc/context/server-sync.tsx
- Migrate MCP listing, connection, and disconnection from
/mcpto/api/mcp.src/context/server-sync.tsx
- Replace legacy MCP authentication with the Integration OAuth workflow.
src/context/server-sync.tsx
- Migrate experimental resource listing from
GET /experimental/resourcetoGET /api/mcp/resource.src/context/server-sync.tsx
- Migrate LSP status from
GET /lsp.src/context/server-sync.tsx
- Move
GET /api/referenceoff the legacy generated SDK transport.src/context/global-sync/bootstrap.ts
Search
- Migrate global session search from
GET /experimental/sessiontoGET /api/session.src/components/command-palette.tssrc/components/dialog-command-palette-v2.tsx
PTY And Terminal
- Migrate PTY creation, reads, updates, and deletion from
/ptyto/api/pty.src/context/terminal.tsxsrc/components/terminal.tsx
- Migrate shell listing from
GET /pty/shellstoGET /api/pty/shells.src/components/settings-general.tsxsrc/components/settings-v2/general.tsx
- Migrate connection tokens from
POST /pty/:ptyID/connect-tokentoPOST /api/pty/:ptyID/connect-token.src/components/terminal.tsx
- Migrate the direct WebSocket connection from
/pty/:ptyID/connectto/api/pty/:ptyID/connect.src/components/terminal.tsx
Legacy Types And Adapters
These are not V1 network requests, but they keep the UI coupled to V1 data contracts.
- Replace the current-session-to-legacy-session adapter.
src/utils/session.ts
- Replace the current-message-to-legacy-message-and-part adapter.
src/utils/session-message.ts
- Replace current agent, provider, and model adapters to legacy SDK structures.
src/context/global-sync/utils.ts
- Replace legacy
Session,Message,Part,PermissionRequest,QuestionRequest,Project,FileNode,FileDiffInfo, andEventtypes throughout app state and rendering. - Remove the
@opencode-ai/sdkruntime dependency after all legacy calls and types are gone.package.json
Test Infrastructure
- Replace V1 endpoint mocks with current API mocks.
e2e/utils/mock-server.ts
- Replace
/global/eventand/eventinterception with current event transport handling.e2e/utils/sse-transport.ts
- Replace
SessionV1and legacy SDK fixtures in timeline performance tests.e2e/performance/timeline-stability/fixture.ts
- Remove remaining legacy SDK type fixtures from unit and browser tests.