refactor(schema): use lowercase agent config keys
This commit is contained in:
parent
4e4288807d
commit
cc4deed8ee
@ -375,7 +375,7 @@ describe("Sisyphus-Junior agent override", () => {
|
|||||||
// #given
|
// #given
|
||||||
const config = {
|
const config = {
|
||||||
agents: {
|
agents: {
|
||||||
"Sisyphus-Junior": {
|
"sisyphus-junior": {
|
||||||
model: "openai/gpt-5.2",
|
model: "openai/gpt-5.2",
|
||||||
temperature: 0.2,
|
temperature: 0.2,
|
||||||
},
|
},
|
||||||
@ -388,18 +388,18 @@ describe("Sisyphus-Junior agent override", () => {
|
|||||||
// #then
|
// #then
|
||||||
expect(result.success).toBe(true)
|
expect(result.success).toBe(true)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
expect(result.data.agents?.["Sisyphus-Junior"]).toBeDefined()
|
expect(result.data.agents?.["sisyphus-junior"]).toBeDefined()
|
||||||
expect(result.data.agents?.["Sisyphus-Junior"]?.model).toBe("openai/gpt-5.2")
|
expect(result.data.agents?.["sisyphus-junior"]?.model).toBe("openai/gpt-5.2")
|
||||||
expect(result.data.agents?.["Sisyphus-Junior"]?.temperature).toBe(0.2)
|
expect(result.data.agents?.["sisyphus-junior"]?.temperature).toBe(0.2)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
test("schema accepts Sisyphus-Junior with prompt_append", () => {
|
test("schema accepts sisyphus-junior with prompt_append", () => {
|
||||||
// #given
|
// #given
|
||||||
const config = {
|
const config = {
|
||||||
agents: {
|
agents: {
|
||||||
"Sisyphus-Junior": {
|
"sisyphus-junior": {
|
||||||
prompt_append: "Additional instructions for Sisyphus-Junior",
|
prompt_append: "Additional instructions for sisyphus-junior",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -410,17 +410,17 @@ describe("Sisyphus-Junior agent override", () => {
|
|||||||
// #then
|
// #then
|
||||||
expect(result.success).toBe(true)
|
expect(result.success).toBe(true)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
expect(result.data.agents?.["Sisyphus-Junior"]?.prompt_append).toBe(
|
expect(result.data.agents?.["sisyphus-junior"]?.prompt_append).toBe(
|
||||||
"Additional instructions for Sisyphus-Junior"
|
"Additional instructions for sisyphus-junior"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
test("schema accepts Sisyphus-Junior with tools override", () => {
|
test("schema accepts sisyphus-junior with tools override", () => {
|
||||||
// #given
|
// #given
|
||||||
const config = {
|
const config = {
|
||||||
agents: {
|
agents: {
|
||||||
"Sisyphus-Junior": {
|
"sisyphus-junior": {
|
||||||
tools: {
|
tools: {
|
||||||
read: true,
|
read: true,
|
||||||
write: false,
|
write: false,
|
||||||
@ -435,10 +435,62 @@ describe("Sisyphus-Junior agent override", () => {
|
|||||||
// #then
|
// #then
|
||||||
expect(result.success).toBe(true)
|
expect(result.success).toBe(true)
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
expect(result.data.agents?.["Sisyphus-Junior"]?.tools).toEqual({
|
expect(result.data.agents?.["sisyphus-junior"]?.tools).toEqual({
|
||||||
read: true,
|
read: true,
|
||||||
write: false,
|
write: false,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("schema accepts lowercase agent names (sisyphus, atlas, prometheus)", () => {
|
||||||
|
// #given
|
||||||
|
const config = {
|
||||||
|
agents: {
|
||||||
|
sisyphus: {
|
||||||
|
temperature: 0.1,
|
||||||
|
},
|
||||||
|
atlas: {
|
||||||
|
temperature: 0.2,
|
||||||
|
},
|
||||||
|
prometheus: {
|
||||||
|
temperature: 0.3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// #when
|
||||||
|
const result = OhMyOpenCodeConfigSchema.safeParse(config)
|
||||||
|
|
||||||
|
// #then
|
||||||
|
expect(result.success).toBe(true)
|
||||||
|
if (result.success) {
|
||||||
|
expect(result.data.agents?.sisyphus?.temperature).toBe(0.1)
|
||||||
|
expect(result.data.agents?.atlas?.temperature).toBe(0.2)
|
||||||
|
expect(result.data.agents?.prometheus?.temperature).toBe(0.3)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
test("schema accepts lowercase metis and momus agent names", () => {
|
||||||
|
// #given
|
||||||
|
const config = {
|
||||||
|
agents: {
|
||||||
|
metis: {
|
||||||
|
category: "ultrabrain",
|
||||||
|
},
|
||||||
|
momus: {
|
||||||
|
category: "quick",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// #when
|
||||||
|
const result = OhMyOpenCodeConfigSchema.safeParse(config)
|
||||||
|
|
||||||
|
// #then
|
||||||
|
expect(result.success).toBe(true)
|
||||||
|
if (result.success) {
|
||||||
|
expect(result.data.agents?.metis?.category).toBe("ultrabrain")
|
||||||
|
expect(result.data.agents?.momus?.category).toBe("quick")
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -17,14 +17,14 @@ const AgentPermissionSchema = z.object({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const BuiltinAgentNameSchema = z.enum([
|
export const BuiltinAgentNameSchema = z.enum([
|
||||||
"Sisyphus",
|
"sisyphus",
|
||||||
"oracle",
|
"oracle",
|
||||||
"librarian",
|
"librarian",
|
||||||
"explore",
|
"explore",
|
||||||
"multimodal-looker",
|
"multimodal-looker",
|
||||||
"Metis (Plan Consultant)",
|
"metis",
|
||||||
"Momus (Plan Reviewer)",
|
"momus",
|
||||||
"Atlas",
|
"atlas",
|
||||||
])
|
])
|
||||||
|
|
||||||
export const BuiltinSkillNameSchema = z.enum([
|
export const BuiltinSkillNameSchema = z.enum([
|
||||||
@ -36,17 +36,17 @@ export const BuiltinSkillNameSchema = z.enum([
|
|||||||
export const OverridableAgentNameSchema = z.enum([
|
export const OverridableAgentNameSchema = z.enum([
|
||||||
"build",
|
"build",
|
||||||
"plan",
|
"plan",
|
||||||
"Sisyphus",
|
"sisyphus",
|
||||||
"Sisyphus-Junior",
|
"sisyphus-junior",
|
||||||
"OpenCode-Builder",
|
"OpenCode-Builder",
|
||||||
"Prometheus (Planner)",
|
"prometheus",
|
||||||
"Metis (Plan Consultant)",
|
"metis",
|
||||||
"Momus (Plan Reviewer)",
|
"momus",
|
||||||
"oracle",
|
"oracle",
|
||||||
"librarian",
|
"librarian",
|
||||||
"explore",
|
"explore",
|
||||||
"multimodal-looker",
|
"multimodal-looker",
|
||||||
"Atlas",
|
"atlas",
|
||||||
])
|
])
|
||||||
|
|
||||||
export const AgentNameSchema = BuiltinAgentNameSchema
|
export const AgentNameSchema = BuiltinAgentNameSchema
|
||||||
@ -117,17 +117,17 @@ export const AgentOverrideConfigSchema = z.object({
|
|||||||
export const AgentOverridesSchema = z.object({
|
export const AgentOverridesSchema = z.object({
|
||||||
build: AgentOverrideConfigSchema.optional(),
|
build: AgentOverrideConfigSchema.optional(),
|
||||||
plan: AgentOverrideConfigSchema.optional(),
|
plan: AgentOverrideConfigSchema.optional(),
|
||||||
Sisyphus: AgentOverrideConfigSchema.optional(),
|
sisyphus: AgentOverrideConfigSchema.optional(),
|
||||||
"Sisyphus-Junior": AgentOverrideConfigSchema.optional(),
|
"sisyphus-junior": AgentOverrideConfigSchema.optional(),
|
||||||
"OpenCode-Builder": AgentOverrideConfigSchema.optional(),
|
"OpenCode-Builder": AgentOverrideConfigSchema.optional(),
|
||||||
"Prometheus (Planner)": AgentOverrideConfigSchema.optional(),
|
prometheus: AgentOverrideConfigSchema.optional(),
|
||||||
"Metis (Plan Consultant)": AgentOverrideConfigSchema.optional(),
|
metis: AgentOverrideConfigSchema.optional(),
|
||||||
"Momus (Plan Reviewer)": AgentOverrideConfigSchema.optional(),
|
momus: AgentOverrideConfigSchema.optional(),
|
||||||
oracle: AgentOverrideConfigSchema.optional(),
|
oracle: AgentOverrideConfigSchema.optional(),
|
||||||
librarian: AgentOverrideConfigSchema.optional(),
|
librarian: AgentOverrideConfigSchema.optional(),
|
||||||
explore: AgentOverrideConfigSchema.optional(),
|
explore: AgentOverrideConfigSchema.optional(),
|
||||||
"multimodal-looker": AgentOverrideConfigSchema.optional(),
|
"multimodal-looker": AgentOverrideConfigSchema.optional(),
|
||||||
Atlas: AgentOverrideConfigSchema.optional(),
|
atlas: AgentOverrideConfigSchema.optional(),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const ClaudeCodeConfigSchema = z.object({
|
export const ClaudeCodeConfigSchema = z.object({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user