mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-17 12:56:41 +02:00
refactor(flags): move auto share to runtime flags (#27611)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user