refactor(core): move database schema ownership (#29068)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Dax
2026-05-30 21:08:38 -04:00
committed by GitHub
parent 6bcb9cb9bb
commit 7f571d36ea
390 changed files with 11127 additions and 9164 deletions

View File

@@ -7,7 +7,7 @@ import * as Socket from "effect/unstable/socket/Socket"
import { mkdir } from "node:fs/promises"
import path from "node:path"
import { registerAdapter } from "../../src/control-plane/adapters"
import { WorkspaceID } from "../../src/control-plane/schema"
import { WorkspaceV2 } from "@opencode-ai/core/workspace"
import type { WorkspaceAdapter } from "../../src/control-plane/types"
import { Workspace } from "../../src/control-plane/workspace"
import { InstanceRef, WorkspaceRef } from "../../src/effect/instance-ref"
@@ -236,7 +236,7 @@ describe("HttpApi instance context middleware", () => {
it.live("uses configured workspace id instead of routing to the requested workspace", () =>
Effect.gen(function* () {
const fixedWorkspaceID = WorkspaceID.ascending()
const fixedWorkspaceID = WorkspaceV2.ID.ascending()
yield* withFixedWorkspaceID(fixedWorkspaceID)
const dir = yield* tmpdirScoped({ git: true })
@@ -264,7 +264,7 @@ describe("HttpApi instance context middleware", () => {
it.live("falls through to local instead of MissingWorkspace when configured workspace id is set", () =>
Effect.gen(function* () {
const fixedWorkspaceID = WorkspaceID.ascending()
const fixedWorkspaceID = WorkspaceV2.ID.ascending()
yield* withFixedWorkspaceID(fixedWorkspaceID)
const dir = yield* tmpdirScoped({ git: true })
@@ -276,7 +276,7 @@ describe("HttpApi instance context middleware", () => {
// MissingWorkspace response. With the env set, planRequest must skip the
// MissingWorkspace branch and fall through to Local with the configured
// workspace id.
const unknownWorkspaceID = WorkspaceID.ascending()
const unknownWorkspaceID = WorkspaceV2.ID.ascending()
const response = yield* HttpClientRequest.get(`/probe?workspace=${unknownWorkspaceID}`).pipe(
HttpClientRequest.setHeader("x-opencode-directory", dir),
HttpClient.execute,
@@ -292,7 +292,7 @@ describe("HttpApi instance context middleware", () => {
it.live("keeps configured workspace id on control-plane routes without remote routing", () =>
Effect.gen(function* () {
const fixedWorkspaceID = WorkspaceID.ascending()
const fixedWorkspaceID = WorkspaceV2.ID.ascending()
yield* withFixedWorkspaceID(fixedWorkspaceID)
const dir = yield* tmpdirScoped({ git: true })