Prometheus: keep planner primary-only
This commit is contained in:
@@ -108,7 +108,7 @@ describe("remapAgentKeysToDisplayNames", () => {
|
|||||||
const agents = {
|
const agents = {
|
||||||
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
|
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
|
||||||
hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" },
|
hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" },
|
||||||
prometheus: { name: "prometheus", prompt: "test", mode: "all" },
|
prometheus: { name: "prometheus", prompt: "test", mode: "primary" },
|
||||||
atlas: { name: "atlas", prompt: "test", mode: "primary" },
|
atlas: { name: "atlas", prompt: "test", mode: "primary" },
|
||||||
oracle: { name: "oracle", prompt: "test", mode: "subagent" },
|
oracle: { name: "oracle", prompt: "test", mode: "subagent" },
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ describe("remapAgentKeysToDisplayNames", () => {
|
|||||||
expect(result[getAgentListDisplayName("prometheus")]).toEqual({
|
expect(result[getAgentListDisplayName("prometheus")]).toEqual({
|
||||||
name: getAgentRuntimeName("prometheus"),
|
name: getAgentRuntimeName("prometheus"),
|
||||||
prompt: "test",
|
prompt: "test",
|
||||||
mode: "all",
|
mode: "primary",
|
||||||
})
|
})
|
||||||
expect(result[getAgentListDisplayName("atlas")]).toEqual({
|
expect(result[getAgentListDisplayName("atlas")]).toEqual({
|
||||||
name: getAgentRuntimeName("atlas"),
|
name: getAgentRuntimeName("atlas"),
|
||||||
@@ -151,7 +151,7 @@ describe("remapAgentKeysToDisplayNames", () => {
|
|||||||
const agents = {
|
const agents = {
|
||||||
sisyphus: { prompt: "test", mode: "primary" },
|
sisyphus: { prompt: "test", mode: "primary" },
|
||||||
hephaestus: { prompt: "test", mode: "primary" },
|
hephaestus: { prompt: "test", mode: "primary" },
|
||||||
prometheus: { prompt: "test", mode: "all" },
|
prometheus: { prompt: "test", mode: "primary" },
|
||||||
atlas: { prompt: "test", mode: "primary" },
|
atlas: { prompt: "test", mode: "primary" },
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ describe("remapAgentKeysToDisplayNames", () => {
|
|||||||
expect(result[getAgentListDisplayName("prometheus")]).toEqual({
|
expect(result[getAgentListDisplayName("prometheus")]).toEqual({
|
||||||
name: getAgentRuntimeName("prometheus"),
|
name: getAgentRuntimeName("prometheus"),
|
||||||
prompt: "test",
|
prompt: "test",
|
||||||
mode: "all",
|
mode: "primary",
|
||||||
})
|
})
|
||||||
expect(result[getAgentListDisplayName("atlas")]).toEqual({
|
expect(result[getAgentListDisplayName("atlas")]).toEqual({
|
||||||
name: getAgentRuntimeName("atlas"),
|
name: getAgentRuntimeName("atlas"),
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ describe("agent-priority-order", () => {
|
|||||||
const agents: Record<string, unknown> = {
|
const agents: Record<string, unknown> = {
|
||||||
[sisyphus]: { name: "sisyphus", mode: "primary" },
|
[sisyphus]: { name: "sisyphus", mode: "primary" },
|
||||||
[hephaestus]: { name: "hephaestus", mode: "primary" },
|
[hephaestus]: { name: "hephaestus", mode: "primary" },
|
||||||
[prometheus]: { name: "prometheus", mode: "all" },
|
[prometheus]: { name: "prometheus", mode: "primary" },
|
||||||
[atlas]: { name: "atlas", mode: "primary" },
|
[atlas]: { name: "atlas", mode: "primary" },
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ describe("agent-priority-order", () => {
|
|||||||
// then
|
// then
|
||||||
expect(result[sisyphus]).toEqual({ name: "sisyphus", mode: "primary", order: 1 })
|
expect(result[sisyphus]).toEqual({ name: "sisyphus", mode: "primary", order: 1 })
|
||||||
expect(result[hephaestus]).toEqual({ name: "hephaestus", mode: "primary", order: 2 })
|
expect(result[hephaestus]).toEqual({ name: "hephaestus", mode: "primary", order: 2 })
|
||||||
expect(result[prometheus]).toEqual({ name: "prometheus", mode: "all", order: 3 })
|
expect(result[prometheus]).toEqual({ name: "prometheus", mode: "primary", order: 3 })
|
||||||
expect(result[atlas]).toEqual({ name: "atlas", mode: "primary", order: 4 })
|
expect(result[atlas]).toEqual({ name: "atlas", mode: "primary", order: 4 })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -447,7 +447,7 @@ describe("Plan agent demote behavior", () => {
|
|||||||
expect(agents.plan.prompt).toBe("original plan prompt")
|
expect(agents.plan.prompt).toBe("original plan prompt")
|
||||||
})
|
})
|
||||||
|
|
||||||
test("prometheus should have mode 'all' to be callable via task", async () => {
|
test("prometheus should have mode 'primary' like the other core agents", async () => {
|
||||||
// given
|
// given
|
||||||
const pluginConfig = createPluginConfig({
|
const pluginConfig = createPluginConfig({
|
||||||
sisyphus_agent: {
|
sisyphus_agent: {
|
||||||
@@ -474,7 +474,7 @@ describe("Plan agent demote behavior", () => {
|
|||||||
const agents = config.agent as Record<string, { mode?: string }>
|
const agents = config.agent as Record<string, { mode?: string }>
|
||||||
const prometheusKey = getAgentListDisplayName("prometheus")
|
const prometheusKey = getAgentListDisplayName("prometheus")
|
||||||
expect(agents[prometheusKey]).toBeDefined()
|
expect(agents[prometheusKey]).toBeDefined()
|
||||||
expect(agents[prometheusKey].mode).toBe("all")
|
expect(agents[prometheusKey].mode).toBe("primary")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1007,7 +1007,7 @@ describe("Plan agent model inheritance from prometheus", () => {
|
|||||||
spyOn(prometheusAgentConfigBuilder, "buildPrometheusAgentConfig").mockResolvedValue({
|
spyOn(prometheusAgentConfigBuilder, "buildPrometheusAgentConfig").mockResolvedValue({
|
||||||
model: "anthropic/claude-opus-4-6",
|
model: "anthropic/claude-opus-4-6",
|
||||||
variant: "max",
|
variant: "max",
|
||||||
mode: "all",
|
mode: "primary",
|
||||||
prompt: "prometheus prompt",
|
prompt: "prometheus prompt",
|
||||||
})
|
})
|
||||||
const pluginConfig = createPluginConfig({
|
const pluginConfig = createPluginConfig({
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ describe("buildPlanDemoteConfig", () => {
|
|||||||
name: "prometheus",
|
name: "prometheus",
|
||||||
model: "anthropic/claude-opus-4-6",
|
model: "anthropic/claude-opus-4-6",
|
||||||
variant: "max",
|
variant: "max",
|
||||||
mode: "all",
|
mode: "primary",
|
||||||
prompt: "You are Prometheus...",
|
prompt: "You are Prometheus...",
|
||||||
permission: { edit: "allow" },
|
permission: { edit: "allow" },
|
||||||
description: "Plan agent (Prometheus)",
|
description: "Plan agent (Prometheus)",
|
||||||
|
|||||||
@@ -267,4 +267,19 @@ describe("buildPrometheusAgentConfig", () => {
|
|||||||
expect(result.model).toBe("anthropic/claude-opus-4-6");
|
expect(result.model).toBe("anthropic/claude-opus-4-6");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("returns Prometheus as a primary agent", async () => {
|
||||||
|
// given
|
||||||
|
|
||||||
|
// when
|
||||||
|
const result = await buildPrometheusAgentConfig({
|
||||||
|
configAgentPlan: undefined,
|
||||||
|
pluginPrometheusOverride: undefined,
|
||||||
|
userCategories: undefined,
|
||||||
|
currentModel: undefined,
|
||||||
|
});
|
||||||
|
|
||||||
|
// then
|
||||||
|
expect(result.mode).toBe("primary");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export async function buildPrometheusAgentConfig(params: {
|
|||||||
const base: Record<string, unknown> = {
|
const base: Record<string, unknown> = {
|
||||||
...(resolvedModel ? { model: resolvedModel } : {}),
|
...(resolvedModel ? { model: resolvedModel } : {}),
|
||||||
...(variantToUse ? { variant: variantToUse } : {}),
|
...(variantToUse ? { variant: variantToUse } : {}),
|
||||||
mode: "all",
|
mode: "primary",
|
||||||
prompt: getPrometheusPrompt(resolvedModel, params.disabledTools),
|
prompt: getPrometheusPrompt(resolvedModel, params.disabledTools),
|
||||||
permission: PROMETHEUS_PERMISSION,
|
permission: PROMETHEUS_PERMISSION,
|
||||||
description: `${(params.configAgentPlan?.description as string) ?? "Plan agent"} (Prometheus - OhMyOpenCode)`,
|
description: `${(params.configAgentPlan?.description as string) ?? "Plan agent"} (Prometheus - OhMyOpenCode)`,
|
||||||
|
|||||||
@@ -3657,11 +3657,11 @@ describe("sisyphus-task", () => {
|
|||||||
expect(result).toContain("plan-family")
|
expect(result).toContain("plan-family")
|
||||||
})
|
})
|
||||||
|
|
||||||
test("plan cannot delegate to prometheus (cross-blocking)", async () => {
|
test("plan cannot delegate to prometheus even when it is exposed as a primary agent", async () => {
|
||||||
//#given
|
//#given
|
||||||
const { createDelegateTask } = require("./tools")
|
const { createDelegateTask } = require("./tools")
|
||||||
const mockClient = {
|
const mockClient = {
|
||||||
app: { agents: async () => ({ data: [{ name: "prometheus", mode: "subagent" }] }) },
|
app: { agents: async () => ({ data: [{ name: "prometheus", mode: "primary" }] }) },
|
||||||
config: { get: async () => ({ data: { model: SYSTEM_DEFAULT_MODEL } }) },
|
config: { get: async () => ({ data: { model: SYSTEM_DEFAULT_MODEL } }) },
|
||||||
session: { get: async () => ({ data: { directory: "/project" } }), create: async () => ({ data: { id: "s" } }), prompt: async () => ({ data: {} }), promptAsync: async () => ({ data: {} }), messages: async () => ({ data: [] }), status: async () => ({ data: {} }) },
|
session: { get: async () => ({ data: { directory: "/project" } }), create: async () => ({ data: { id: "s" } }), prompt: async () => ({ data: {} }), promptAsync: async () => ({ data: {} }), messages: async () => ({ data: [] }), status: async () => ({ data: {} }) },
|
||||||
}
|
}
|
||||||
@@ -4154,19 +4154,17 @@ describe("sisyphus-task", () => {
|
|||||||
expect(promptBody.tools.task).toBe(true)
|
expect(promptBody.tools.task).toBe(true)
|
||||||
}, { timeout: 20000 })
|
}, { timeout: 20000 })
|
||||||
|
|
||||||
test("prometheus subagent should have task permission as part of the plan family", async () => {
|
test("prometheus primary agent should not be callable via task", async () => {
|
||||||
//#given
|
//#given
|
||||||
const { createDelegateTask } = require("./tools")
|
const { createDelegateTask } = require("./tools")
|
||||||
let promptBody: any
|
|
||||||
const promptMock = async (input: any) => { promptBody = input.body; return { data: {} } }
|
|
||||||
const mockClient = {
|
const mockClient = {
|
||||||
app: { agents: async () => ({ data: [{ name: "prometheus", mode: "subagent" }] }) },
|
app: { agents: async () => ({ data: [{ name: "prometheus", mode: "primary" }] }) },
|
||||||
config: { get: async () => ({ data: { model: SYSTEM_DEFAULT_MODEL } }) },
|
config: { get: async () => ({ data: { model: SYSTEM_DEFAULT_MODEL } }) },
|
||||||
session: {
|
session: {
|
||||||
get: async () => ({ data: { directory: "/project" } }),
|
get: async () => ({ data: { directory: "/project" } }),
|
||||||
create: async () => ({ data: { id: "ses_prometheus_task" } }),
|
create: async () => ({ data: { id: "ses_prometheus_task" } }),
|
||||||
prompt: promptMock,
|
prompt: async () => ({ data: {} }),
|
||||||
promptAsync: promptMock,
|
promptAsync: async () => ({ data: {} }),
|
||||||
messages: async () => ({ data: [{ info: { role: "assistant" }, parts: [{ type: "text", text: "Plan created" }] }] }),
|
messages: async () => ({ data: [{ info: { role: "assistant" }, parts: [{ type: "text", text: "Plan created" }] }] }),
|
||||||
status: async () => ({ data: { "ses_prometheus_task": { type: "idle" } } }),
|
status: async () => ({ data: { "ses_prometheus_task": { type: "idle" } } }),
|
||||||
},
|
},
|
||||||
@@ -4174,13 +4172,13 @@ describe("sisyphus-task", () => {
|
|||||||
const tool = createDelegateTask({ manager: { launch: async () => ({}) }, client: mockClient })
|
const tool = createDelegateTask({ manager: { launch: async () => ({}) }, client: mockClient })
|
||||||
|
|
||||||
//#when
|
//#when
|
||||||
await tool.execute(
|
const result = await tool.execute(
|
||||||
{ description: "Test prometheus task permission", prompt: "Create a plan", subagent_type: "prometheus", run_in_background: false, load_skills: [] },
|
{ description: "Test prometheus task permission", prompt: "Create a plan", subagent_type: "prometheus", run_in_background: false, load_skills: [] },
|
||||||
{ sessionID: "p", messageID: "m", agent: "sisyphus", abort: new AbortController().signal }
|
{ sessionID: "p", messageID: "m", agent: "sisyphus", abort: new AbortController().signal }
|
||||||
)
|
)
|
||||||
|
|
||||||
//#then - prometheus shares task permission with the plan family
|
//#then
|
||||||
expect(promptBody.tools.task).toBe(true)
|
expect(result).toContain('Unknown agent: "prometheus"')
|
||||||
}, { timeout: 20000 })
|
}, { timeout: 20000 })
|
||||||
|
|
||||||
test("non-plan subagent should NOT have task permission", async () => {
|
test("non-plan subagent should NOT have task permission", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user