Skip to content

Commit 4d90834

Browse files
Apply PR #25034: feat: default HTTP API backend to on for dev/beta channels
2 parents eccafd2 + 1e5cc6d commit 4d90834

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

packages/core/src/flag/flag.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Config } from "effect"
2+
import { InstallationChannel } from "../installation/version"
23

34
function truthy(key: string) {
45
const value = process.env[key]?.toLowerCase()
@@ -10,6 +11,10 @@ function falsy(key: string) {
1011
return value === "false" || value === "0"
1112
}
1213

14+
// Channels that default to the new effect-httpapi server backend. The legacy
15+
// hono backend remains the default for stable (`prod`/`latest`) installs.
16+
const HTTPAPI_DEFAULT_ON_CHANNELS = new Set(["dev", "beta", "local"])
17+
1318
function number(key: string) {
1419
const value = process.env[key]
1520
if (!value) return undefined
@@ -81,7 +86,14 @@ export const Flag = {
8186
OPENCODE_STRICT_CONFIG_DEPS: truthy("OPENCODE_STRICT_CONFIG_DEPS"),
8287

8388
OPENCODE_WORKSPACE_ID: process.env["OPENCODE_WORKSPACE_ID"],
84-
OPENCODE_EXPERIMENTAL_HTTPAPI: truthy("OPENCODE_EXPERIMENTAL_HTTPAPI"),
89+
// Defaults to true on dev/beta/local channels so internal users exercise the
90+
// new effect-httpapi server backend. Stable (`prod`/`latest`) installs stay
91+
// on the legacy hono backend until the rollout is complete. An explicit env
92+
// var ("true"/"1" or "false"/"0") always wins, providing an opt-in for
93+
// stable users and an escape hatch for dev/beta users.
94+
OPENCODE_EXPERIMENTAL_HTTPAPI:
95+
truthy("OPENCODE_EXPERIMENTAL_HTTPAPI") ||
96+
(!falsy("OPENCODE_EXPERIMENTAL_HTTPAPI") && HTTPAPI_DEFAULT_ON_CHANNELS.has(InstallationChannel)),
8597
OPENCODE_EXPERIMENTAL_WORKSPACES: OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_WORKSPACES"),
8698

8799
// Evaluated at access time (not module load) because tests, the CLI, and

0 commit comments

Comments
 (0)