Skip to content

Commit 487e1bd

Browse files
committed
refactor(protocol): remove workspace API
1 parent 1eeaaab commit 487e1bd

76 files changed

Lines changed: 1279 additions & 27842 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎V2_HTTP_API_AUDIT.md‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# V2 HTTP API audit checklist
22

33
**Source:** `packages/protocol/openapi.json`
4-
**Current endpoint count:** 142
4+
**Current endpoint count:** 140
55
**Last regenerated:** 2026-09-13
66

77
## How to use this checklist
@@ -28,7 +28,7 @@ Review endpoints in document order. For each endpoint, select one disposition an
2828

2929
## Progress
3030

31-
- [ ] Group 1: Foundation and placement (6)
31+
- [ ] Group 1: Foundation and placement (4)
3232
- [ ] Group 2: Configuration and capability catalogs (17)
3333
- [ ] Group 3: Credentials, integrations, MCP, and web search (22)
3434
- [ ] Group 4: Session lifecycle (12)
@@ -53,18 +53,21 @@ Review endpoints in document order. For each endpoint, select one disposition an
5353
- **Replacement:** `GET /api/location`, using `project` from the response.
5454
- **Notes:** The endpoint duplicated `Location.Info.project`; production callers were migrated.
5555

56+
### [x] `POST /api/workspace` and `DELETE /api/workspace/{workspaceID}`
57+
58+
- **Decision:** Remove
59+
- **Notes:** Provider-backed workspaces are not part of the V2 HTTP contract and can be introduced later. Core and the embedded SDK retain internal workspace support.
60+
5661
## Group 1: Foundation and placement
5762

58-
**Endpoints:** 6
63+
**Endpoints:** 4
5964

6065
| Done | Method | Path | Operation ID | Decision | Notes |
6166
|---|---|---|---|---|---|
6267
| [x] 001–002 | `GET` | `/api/status` | `server.status` | Keep | Replaces the former health and server endpoints. |
63-
| [ ] 003 | `GET` | `/api/location` | `location.get` | | |
68+
| [x] 003 | `GET` | `/api/location` | `location.get` | Keep | Workspace selectors and response fields removed until workspace support ships. |
6469
| [ ] 004 | `GET` | `/api/project` | `project.list` | | |
6570
| [ ] 005 | `PATCH` | `/api/project/{projectID}` | `project.update` | | |
66-
| [ ] 006 | `POST` | `/api/workspace` | `workspace.create` | Proposed remove | Awaiting feedback in `#core`. |
67-
| [ ] 007 | `DELETE` | `/api/workspace/{workspaceID}` | `workspace.destroy` | Proposed remove | Awaiting feedback in `#core`. |
6871

6972
## Group 2: Configuration and capability catalogs
7073

‎packages/app/e2e/utils/mock-server.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -652,11 +652,6 @@ export function currentSession(session: { id: string } & Record<string, unknown>
652652
: typeof session.directory === "string"
653653
? session.directory
654654
: fallbackDirectory,
655-
...(typeof session.workspaceID === "string"
656-
? { workspaceID: session.workspaceID }
657-
: "workspaceID" in location && typeof location.workspaceID === "string"
658-
? { workspaceID: location.workspaceID }
659-
: {}),
660655
},
661656
subpath: session.subpath ?? session.path,
662657
revert: session.revert,

‎packages/app/src/session/requests/auto-approve.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function createPermissionAutoApprover(input: { sdk: ServerSDK; data: Data
6060
const listed = await Promise.all(
6161
inventory.locations.map((location) =>
6262
input.sdk.api.permission.request
63-
.list({ location: { directory: location.directory, workspace: location.workspaceID } })
63+
.list({ location: { directory: location.directory } })
6464
.then((pending) => {
6565
if (!state.disposed) pending.data.forEach((request) => approve(request))
6666
return true
@@ -103,7 +103,7 @@ export function createPermissionAutoApprover(input: { sdk: ServerSDK; data: Data
103103
]
104104
return {
105105
locations: [
106-
...new Map(locations.map((item) => [`${item.directory}\u0000${item.workspaceID ?? ""}`, item])).values(),
106+
...new Map(locations.map((item) => [item.directory, item])).values(),
107107
],
108108
complete: active !== undefined && synced.every(Boolean),
109109
}

‎packages/app/src/session/requests/model.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function createSessionRequestModel() {
4848
providers: async (sessionID) => {
4949
const session = data.session.get(sessionID) ?? (await serverSDK.api.session.get({ sessionID }))
5050
const result = await serverSDK.api.websearch.providers({
51-
location: { directory: session.location.directory, workspace: session.location.workspaceID },
51+
location: { directory: session.location.directory },
5252
})
5353
return result.data.map((provider) => ({ value: provider.id, label: provider.name }))
5454
},

‎packages/app/src/session/route.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function ResolvedTargetSessionRoute() {
136136
>
137137
<Show when={directory()} fallback={<PendingSessionState sessionID={params.id} />}>
138138
{(value) => (
139-
<LocationProvider directory={value} workspaceID={() => current()?.location.workspaceID}>
139+
<LocationProvider directory={value}>
140140
<SessionUIProvider directory={value()} server={server.key}>
141141
<TargetSessionPage />
142142
</SessionUIProvider>

‎packages/app/src/workspaces/selection/dialog.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function DirectoryPickerDialog(props: DirectoryPickerDialogProps) {
7777
const home = createMemo(() => sync.data.path.home || "")
7878
const location = createMemo(() => {
7979
const current = props.location ?? fallbackPath()
80-
return current ? { directory: current.directory, workspace: current.workspaceID } : undefined
80+
return current ? { directory: current.directory } : undefined
8181
})
8282
const start = createMemo(
8383
() =>

‎packages/cli/src/commands/handlers/session/export.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export default Runtime.handler(
3636
try: () =>
3737
client.session.list({
3838
directory: location.directory,
39-
workspace: location.workspaceID,
4039
parentID: null,
4140
order: "desc",
4241
limit: 50,

‎packages/cli/src/commands/handlers/session/import.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default Runtime.handler(
4444
headers: { ...Service.headers(server.endpoint), "content-type": "application/json" },
4545
body: JSON.stringify({
4646
...encoded,
47-
location: { directory: location.directory, workspaceID: location.workspaceID },
47+
location: { directory: location.directory },
4848
}),
4949
}),
5050
)

‎packages/cli/src/mini.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export async function runMini(input: MiniCommandInput) {
8181
const create = (
8282
client: OpenCodeClient,
8383
next: {
84-
location: { directory: string; workspaceID?: string }
84+
location: { directory: string }
8585
agent: string | undefined
8686
model: Model
8787
variant: string | undefined
@@ -90,7 +90,7 @@ export async function runMini(input: MiniCommandInput) {
9090
) =>
9191
resolveSessionTarget({
9292
client,
93-
location: { directory: next.location.directory, workspace: next.location.workspaceID },
93+
location: { directory: next.location.directory },
9494
agent: next.agent,
9595
environment,
9696
model: next.model

‎packages/cli/src/run/noninteractive.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ export async function runNonInteractivePrompt(input: Input) {
700700
? Promise.resolve(undefined)
701701
: input.client.form.request
702702
.list({
703-
location: { directory: input.location.directory, workspace: input.location.workspaceID },
703+
location: { directory: input.location.directory },
704704
})
705705
.catch(() => undefined),
706706
])
@@ -745,7 +745,7 @@ export async function runNonInteractivePrompt(input: Input) {
745745
}
746746

747747
function sameLocation(left: LocationRef | undefined, right: LocationRef) {
748-
return !!left && left.directory === right.directory && left.workspaceID === right.workspaceID
748+
return !!left && left.directory === right.directory
749749
}
750750

751751
function formRequestOptions(location: LocationRef | undefined): [] | [{ headers: Record<string, string> }] {
@@ -754,7 +754,6 @@ function formRequestOptions(location: LocationRef | undefined): [] | [{ headers:
754754
{
755755
headers: {
756756
"x-opencode-directory": encodeURIComponent(location.directory),
757-
...(location.workspaceID ? { "x-opencode-workspace": location.workspaceID } : {}),
758757
},
759758
},
760759
]

0 commit comments

Comments
 (0)