refactor(flags): move auto share to runtime flags (#27611)

This commit is contained in:
Shoubhit Dash
2026-05-15 03:58:26 +05:30
committed by GitHub
parent d34a0194ec
commit cb4f5cdea9
6 changed files with 21 additions and 5 deletions
@@ -9,6 +9,14 @@ const fromConfig = (input: Record<string, unknown>) =>
const readFlags = RuntimeFlags.Service.useSync((flags) => flags)
describe("RuntimeFlags", () => {
it.effect("defaultLayer defaults autoShare to false", () =>
Effect.gen(function* () {
const flags = yield* readFlags.pipe(Effect.provide(fromConfig({})))
expect(flags.autoShare).toBe(false)
}),
)
it.effect("defaultLayer parses plugin flags from the active ConfigProvider", () =>
Effect.gen(function* () {
const flags = yield* readFlags.pipe(
@@ -16,6 +24,7 @@ describe("RuntimeFlags", () => {
fromConfig({
OPENCODE_PURE: "true",
OPENCODE_DISABLE_DEFAULT_PLUGINS: "true",
OPENCODE_AUTO_SHARE: "true",
OPENCODE_DISABLE_EMBEDDED_WEB_UI: "true",
OPENCODE_EXPERIMENTAL: "true",
OPENCODE_ENABLE_EXA: "true",
@@ -28,6 +37,7 @@ describe("RuntimeFlags", () => {
)
expect(flags.pure).toBe(true)
expect(flags.autoShare).toBe(true)
expect(flags.disableDefaultPlugins).toBe(true)
expect(flags.disableEmbeddedWebUi).toBe(true)
expect(flags.enableExa).toBe(true)
@@ -68,6 +78,7 @@ describe("RuntimeFlags", () => {
)
expect(flags.pure).toBe(false)
expect(flags.autoShare).toBe(false)
expect(flags.disableDefaultPlugins).toBe(true)
expect(flags.disableEmbeddedWebUi).toBe(false)
expect(flags.disableClaudeCodeSkills).toBe(false)