refactor(flags): route sync workspaces through runtime flags (#27336)

This commit is contained in:
Shoubhit Dash
2026-05-13 20:18:06 +05:30
committed by GitHub
parent 5b5376a3fa
commit e28ef7b57c
2 changed files with 16 additions and 16 deletions
+8 -10
View File
@@ -1,4 +1,4 @@
import { describe, expect, beforeEach, afterEach, afterAll } from "bun:test"
import { describe, expect, beforeEach, afterAll } from "bun:test"
import { provideTmpdirInstance } from "../fixture/fixture"
import { Effect, Layer, Schema } from "effect"
import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
@@ -7,21 +7,19 @@ import { SyncEvent } from "../../src/sync"
import { Database, eq } from "@/storage/db"
import { EventSequenceTable, EventTable } from "../../src/sync/event.sql"
import { MessageID } from "../../src/session/schema"
import { Flag } from "@opencode-ai/core/flag/flag"
import { initProjectors } from "../../src/server/projectors"
import { testEffect } from "../lib/effect"
import { RuntimeFlags } from "@/effect/runtime-flags"
const original = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES
const it = testEffect(Layer.mergeAll(SyncEvent.defaultLayer, CrossSpawnSpawner.defaultLayer))
const it = testEffect(
Layer.mergeAll(
SyncEvent.layer.pipe(Layer.provide(RuntimeFlags.layer({ experimentalWorkspaces: true }))),
CrossSpawnSpawner.defaultLayer,
),
)
beforeEach(() => {
Database.close()
Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = true
})
afterEach(() => {
Flag.OPENCODE_EXPERIMENTAL_WORKSPACES = original
})
describe("SyncEvent", () => {