fix(start-work): keep native command agents on config keys
This commit is contained in:
@@ -97,7 +97,7 @@ describe("applyCommandConfig", () => {
|
||||
expect(commandConfig["agents-global-skill"]?.description).toContain("Agents global skill");
|
||||
});
|
||||
|
||||
test("remaps Atlas command agents to the list display name used by runtime agent lookup", async () => {
|
||||
test("normalizes Atlas command agents to the config key OpenCode expects for native routing", async () => {
|
||||
// given
|
||||
loadBuiltinCommandsSpy.mockReturnValue({
|
||||
"start-work": {
|
||||
@@ -119,6 +119,31 @@ describe("applyCommandConfig", () => {
|
||||
|
||||
// then
|
||||
const commandConfig = config.command as Record<string, { agent?: string }>;
|
||||
expect(commandConfig["start-work"]?.agent).toBe(getAgentDisplayName("atlas"));
|
||||
expect(commandConfig["start-work"]?.agent).toBe("atlas");
|
||||
});
|
||||
|
||||
test("normalizes legacy display-name command agents back to config keys", async () => {
|
||||
// given
|
||||
loadBuiltinCommandsSpy.mockReturnValue({
|
||||
"start-work": {
|
||||
name: "start-work",
|
||||
description: "(builtin) Start work",
|
||||
template: "template",
|
||||
agent: getAgentDisplayName("atlas"),
|
||||
},
|
||||
});
|
||||
const config: Record<string, unknown> = { command: {} };
|
||||
|
||||
// when
|
||||
await applyCommandConfig({
|
||||
config,
|
||||
pluginConfig: createPluginConfig(),
|
||||
ctx: { directory: "/tmp" },
|
||||
pluginComponents: createPluginComponents(),
|
||||
});
|
||||
|
||||
// then
|
||||
const commandConfig = config.command as Record<string, { agent?: string }>;
|
||||
expect(commandConfig["start-work"]?.agent).toBe("atlas");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user