Skip to content

Commit 0b395cd

Browse files
committed
fix(httpapi): keep backend feature flagged
1 parent 35239bd commit 0b395cd

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

packages/opencode/src/server/backend.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@ export type Backend = "effect-httpapi" | "hono"
55

66
export type Selection = {
77
backend: Backend
8-
reason: "env" | "channel" | "stable" | "explicit"
8+
reason: "env" | "stable" | "explicit"
99
}
1010

1111
export type Attributes = ReturnType<typeof attributes>
1212

13-
const channelDefaultsToHttpApi = () =>
14-
InstallationChannel === "local" ||
15-
InstallationChannel === "dev" ||
16-
InstallationChannel === "beta" ||
17-
InstallationVersion.includes("-dev") ||
18-
InstallationVersion.includes("-beta")
19-
2013
export function select(): Selection {
2114
if (Flag.OPENCODE_EXPERIMENTAL_HTTPAPI) return { backend: "effect-httpapi", reason: "env" }
22-
if (channelDefaultsToHttpApi()) return { backend: "effect-httpapi", reason: "channel" }
2315
return { backend: "hono", reason: "stable" }
2416
}
2517

packages/opencode/test/server/httpapi-bridge.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,12 @@ afterEach(async () => {
146146
})
147147

148148
describe("HttpApi server", () => {
149-
test("defaults local/dev builds to the Effect HttpApi backend", () => {
149+
test("keeps Effect HttpApi behind the feature flag", () => {
150150
Flag.OPENCODE_EXPERIMENTAL_HTTPAPI = false
151-
expect(Server.backend().backend).toBe("effect-httpapi")
151+
expect(Server.backend()).toEqual({ backend: "hono", reason: "stable" })
152+
153+
Flag.OPENCODE_EXPERIMENTAL_HTTPAPI = true
154+
expect(Server.backend()).toEqual({ backend: "effect-httpapi", reason: "env" })
152155
})
153156

154157
test("covers every generated OpenAPI route with Effect HttpApi contracts", async () => {

0 commit comments

Comments
 (0)