Merge pull request #4020 from scw1109/fix/default-agent-sort-order

fix: respect default_agent in sort shim ordering
This commit is contained in:
YeonGyu-Kim
2026-05-18 13:48:58 +09:00
committed by GitHub
3 changed files with 81 additions and 1 deletions
@@ -8,6 +8,7 @@ import {
normalizeAgentForPromptKey,
} from "../shared/agent-display-names";
import { AGENT_NAME_MAP } from "../shared/migration";
import { setDefaultAgentForSort } from "../shared/agent-sort-shim";
import { registerAgentName } from "../features/claude-code-session-state";
import {
discoverConfigSourceSkills,
@@ -399,6 +400,12 @@ export async function applyAgentConfig(params: {
);
}
if (configuredDefaultAgent) {
setDefaultAgentForSort(
(params.config as { default_agent?: string }).default_agent ?? configuredDefaultAgent,
);
}
const agentResult = params.config.agent as Record<string, unknown>;
for (const name of Object.keys(agentResult)) {
registerAgentName(name);