Merge pull request #2585 from acamq/fix/custom-agent-summaries-completeness

fix(agents): include config agents and migrated plugin agents in customAgentSummaries
This commit is contained in:
acamq
2026-03-15 17:48:50 -06:00
committed by GitHub
+19 -16
View File
@@ -87,16 +87,28 @@ export async function applyAgentConfig(params: {
const projectAgents = includeClaudeAgents ? loadProjectAgents(params.ctx.directory) : {};
const rawPluginAgents = params.pluginComponents.agents;
const pluginAgents = Object.fromEntries(
Object.entries(rawPluginAgents).map(([key, value]) => [
key,
value ? migrateAgentConfig(value as Record<string, unknown>) : value,
]),
);
const configAgent = params.config.agent as AgentConfigRecord | undefined;
const customAgentSummaries = [
...Object.entries(configAgent ?? {}),
...Object.entries(userAgents),
...Object.entries(projectAgents),
...Object.entries(rawPluginAgents).filter(([, config]) => config !== undefined),
].map(([name, config]) => ({
name,
description: typeof (config as Record<string, unknown>)?.description === "string"
? (config as Record<string, unknown>).description as string
: "",
}));
...Object.entries(pluginAgents).filter(([, config]) => config !== undefined),
]
.filter(([, config]) => config != null)
.map(([name, config]) => ({
name,
description: typeof (config as Record<string, unknown>)?.description === "string"
? ((config as Record<string, unknown>).description as string)
: "",
}));
const builtinAgents = await createBuiltinAgents(
migratedDisabledAgents,
@@ -114,13 +126,6 @@ export async function applyAgentConfig(params: {
disableOmoEnv,
);
const pluginAgents = Object.fromEntries(
Object.entries(rawPluginAgents).map(([key, value]) => [
key,
value ? migrateAgentConfig(value as Record<string, unknown>) : value,
]),
);
const disabledAgentNames = new Set(
(migratedDisabledAgents ?? []).map(a => a.toLowerCase())
);
@@ -138,8 +143,6 @@ export async function applyAgentConfig(params: {
const shouldDemotePlan = plannerEnabled && replacePlan;
const configuredDefaultAgent = getConfiguredDefaultAgent(params.config);
const configAgent = params.config.agent as AgentConfigRecord | undefined;
if (isSisyphusEnabled && builtinAgents.sisyphus) {
if (configuredDefaultAgent) {
(params.config as { default_agent?: string }).default_agent =