feat(config): add plugin_load_timeout_ms and safe_hook_creation experimental flags

This commit is contained in:
YeonGyu-Kim
2026-02-07 13:32:51 +09:00
parent f9742ddfca
commit 1ae7d7d67e
2 changed files with 61 additions and 0 deletions
+57
View File
@@ -5,6 +5,7 @@ import {
BrowserAutomationProviderSchema,
BuiltinCategoryNameSchema,
CategoryConfigSchema,
ExperimentalConfigSchema,
OhMyOpenCodeConfigSchema,
} from "./schema"
@@ -606,3 +607,59 @@ describe("OhMyOpenCodeConfigSchema - browser_automation_engine", () => {
expect(result.data?.browser_automation_engine).toBeUndefined()
})
})
describe("ExperimentalConfigSchema feature flags", () => {
test("accepts plugin_load_timeout_ms as number", () => {
//#given
const config = { plugin_load_timeout_ms: 5000 }
//#when
const result = ExperimentalConfigSchema.safeParse(config)
//#then
expect(result.success).toBe(true)
if (result.success) {
expect(result.data.plugin_load_timeout_ms).toBe(5000)
}
})
test("rejects plugin_load_timeout_ms below 1000", () => {
//#given
const config = { plugin_load_timeout_ms: 500 }
//#when
const result = ExperimentalConfigSchema.safeParse(config)
//#then
expect(result.success).toBe(false)
})
test("accepts safe_hook_creation as boolean", () => {
//#given
const config = { safe_hook_creation: false }
//#when
const result = ExperimentalConfigSchema.safeParse(config)
//#then
expect(result.success).toBe(true)
if (result.success) {
expect(result.data.safe_hook_creation).toBe(false)
}
})
test("both fields are optional", () => {
//#given
const config = {}
//#when
const result = ExperimentalConfigSchema.safeParse(config)
//#then
expect(result.success).toBe(true)
if (result.success) {
expect(result.data.plugin_load_timeout_ms).toBeUndefined()
expect(result.data.safe_hook_creation).toBeUndefined()
}
})
})