fix(plugin-handlers): remove ZWSP prefixes from API-facing agent paths
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
/// <reference types="bun-types" />
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, spyOn, test } from "bun:test";
|
||||
import * as builtinCommands from "../features/builtin-commands";
|
||||
import * as commandLoader from "../features/claude-code-command-loader";
|
||||
@@ -7,7 +9,6 @@ import type { PluginComponents } from "./plugin-components-loader";
|
||||
import { applyCommandConfig } from "./command-config-handler";
|
||||
import {
|
||||
getAgentDisplayName,
|
||||
getAgentListDisplayName,
|
||||
} from "../shared/agent-display-names";
|
||||
|
||||
function createPluginComponents(): PluginComponents {
|
||||
@@ -23,7 +24,13 @@ function createPluginComponents(): PluginComponents {
|
||||
}
|
||||
|
||||
function createPluginConfig(): OhMyOpenCodeConfig {
|
||||
return {};
|
||||
return {
|
||||
git_master: {
|
||||
commit_footer: true,
|
||||
include_co_authored_by: true,
|
||||
git_env_prefix: "GIT_MASTER=1",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
describe("applyCommandConfig", () => {
|
||||
@@ -100,7 +107,7 @@ describe("applyCommandConfig", () => {
|
||||
expect(commandConfig["agents-global-skill"]?.description).toContain("Agents global skill");
|
||||
});
|
||||
|
||||
test("normalizes Atlas command agents to the exported list key used by opencode command routing", async () => {
|
||||
test("normalizes Atlas command agents to the clean display name used by opencode command routing", async () => {
|
||||
// given
|
||||
loadBuiltinCommandsSpy.mockReturnValue({
|
||||
"start-work": {
|
||||
@@ -122,10 +129,10 @@ describe("applyCommandConfig", () => {
|
||||
|
||||
// then
|
||||
const commandConfig = config.command as Record<string, { agent?: string }>;
|
||||
expect(commandConfig["start-work"]?.agent).toBe(getAgentListDisplayName("atlas"));
|
||||
expect(commandConfig["start-work"]?.agent).toBe(getAgentDisplayName("atlas"));
|
||||
});
|
||||
|
||||
test("normalizes legacy display-name command agents to the exported list key", async () => {
|
||||
test("normalizes legacy display-name command agents to the clean display name", async () => {
|
||||
// given
|
||||
loadBuiltinCommandsSpy.mockReturnValue({
|
||||
"start-work": {
|
||||
@@ -147,6 +154,6 @@ describe("applyCommandConfig", () => {
|
||||
|
||||
// then
|
||||
const commandConfig = config.command as Record<string, { agent?: string }>;
|
||||
expect(commandConfig["start-work"]?.agent).toBe(getAgentListDisplayName("atlas"));
|
||||
expect(commandConfig["start-work"]?.agent).toBe(getAgentDisplayName("atlas"));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user