fix(agents): keep prometheus and atlas in canonical core order

This commit is contained in:
YeonGyu-Kim
2026-04-06 17:49:17 +09:00
parent 0c1202e480
commit 88280d0e4d
3 changed files with 152 additions and 15 deletions
+21 -15
View File
@@ -172,6 +172,24 @@ export async function applyAgentConfig(params: {
agentConfig["hephaestus"] = builtinAgents.hephaestus;
}
if (plannerEnabled) {
const prometheusOverride = params.pluginConfig.agents?.["prometheus"] as
| (Record<string, unknown> & { prompt_append?: string })
| undefined;
agentConfig["prometheus"] = await buildPrometheusAgentConfig({
configAgentPlan: configAgent?.plan,
pluginPrometheusOverride: prometheusOverride,
userCategories: params.pluginConfig.categories,
currentModel,
disabledTools: params.pluginConfig.disabled_tools,
});
}
if (builtinAgents.atlas) {
agentConfig["atlas"] = builtinAgents.atlas;
}
agentConfig["sisyphus-junior"] = createSisyphusJuniorAgentWithOverrides(
params.pluginConfig.agents?.["sisyphus-junior"],
(builtinAgents.atlas as { model?: string } | undefined)?.model,
@@ -192,20 +210,6 @@ export async function applyAgentConfig(params: {
agentConfig["OpenCode-Builder"] = override ? { ...base, ...override } : base;
}
if (plannerEnabled) {
const prometheusOverride = params.pluginConfig.agents?.["prometheus"] as
| (Record<string, unknown> & { prompt_append?: string })
| undefined;
agentConfig["prometheus"] = await buildPrometheusAgentConfig({
configAgentPlan: configAgent?.plan,
pluginPrometheusOverride: prometheusOverride,
userCategories: params.pluginConfig.categories,
currentModel,
disabledTools: params.pluginConfig.disabled_tools,
});
}
const filteredConfigAgents = configAgent
? Object.fromEntries(
Object.entries(configAgent)
@@ -253,7 +257,9 @@ export async function applyAgentConfig(params: {
params.config.agent = {
...agentConfig,
...Object.fromEntries(
Object.entries(builtinAgents).filter(([key]) => key !== "sisyphus" && key !== "hephaestus"),
Object.entries(builtinAgents).filter(
([key]) => key !== "sisyphus" && key !== "hephaestus" && key !== "atlas",
),
),
...filterDisabledAgents(filteredUserAgents),
...filterDisabledAgents(filteredProjectAgents),