feat(environment): introduce disable_omo_env configuration option
- Added a new configuration option `disable_omo_env` to control the injection of the `<omo-env>` block in agent prompts. - Updated relevant functions and tests to support this feature, ensuring that the environment context can be toggled on or off as needed. - Enhanced documentation to reflect the new option and its implications for API cost and cache hit rates.
This commit is contained in:
@@ -741,6 +741,59 @@ describe("ExperimentalConfigSchema feature flags", () => {
|
||||
}
|
||||
})
|
||||
|
||||
test("accepts disable_omo_env as true", () => {
|
||||
//#given
|
||||
const config = { disable_omo_env: true }
|
||||
|
||||
//#when
|
||||
const result = ExperimentalConfigSchema.safeParse(config)
|
||||
|
||||
//#then
|
||||
expect(result.success).toBe(true)
|
||||
if (result.success) {
|
||||
expect(result.data.disable_omo_env).toBe(true)
|
||||
}
|
||||
})
|
||||
|
||||
test("accepts disable_omo_env as false", () => {
|
||||
//#given
|
||||
const config = { disable_omo_env: false }
|
||||
|
||||
//#when
|
||||
const result = ExperimentalConfigSchema.safeParse(config)
|
||||
|
||||
//#then
|
||||
expect(result.success).toBe(true)
|
||||
if (result.success) {
|
||||
expect(result.data.disable_omo_env).toBe(false)
|
||||
}
|
||||
})
|
||||
|
||||
test("disable_omo_env is optional", () => {
|
||||
//#given
|
||||
const config = { safe_hook_creation: true }
|
||||
|
||||
//#when
|
||||
const result = ExperimentalConfigSchema.safeParse(config)
|
||||
|
||||
//#then
|
||||
expect(result.success).toBe(true)
|
||||
if (result.success) {
|
||||
expect(result.data.disable_omo_env).toBeUndefined()
|
||||
}
|
||||
})
|
||||
|
||||
test("rejects non-boolean disable_omo_env", () => {
|
||||
//#given
|
||||
const config = { disable_omo_env: "true" }
|
||||
|
||||
//#when
|
||||
const result = ExperimentalConfigSchema.safeParse(config)
|
||||
|
||||
//#then
|
||||
expect(result.success).toBe(false)
|
||||
})
|
||||
|
||||
test("rejects non-boolean hashline_edit", () => {
|
||||
//#given
|
||||
const config = { hashline_edit: "true" }
|
||||
|
||||
Reference in New Issue
Block a user