fix(zwsp): strip zero-width chars from agent headers in command-config-handler
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -5,7 +5,7 @@ import * as skillLoader from "../features/opencode-skill-loader";
|
|||||||
import type { OhMyOpenCodeConfig } from "../config";
|
import type { OhMyOpenCodeConfig } from "../config";
|
||||||
import type { PluginComponents } from "./plugin-components-loader";
|
import type { PluginComponents } from "./plugin-components-loader";
|
||||||
import { applyCommandConfig } from "./command-config-handler";
|
import { applyCommandConfig } from "./command-config-handler";
|
||||||
import { getAgentListDisplayName } from "../shared/agent-display-names";
|
import { getAgentDisplayName } from "../shared/agent-display-names";
|
||||||
|
|
||||||
function createPluginComponents(): PluginComponents {
|
function createPluginComponents(): PluginComponents {
|
||||||
return {
|
return {
|
||||||
@@ -119,6 +119,6 @@ describe("applyCommandConfig", () => {
|
|||||||
|
|
||||||
// then
|
// then
|
||||||
const commandConfig = config.command as Record<string, { agent?: string }>;
|
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"));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { OhMyOpenCodeConfig } from "../config";
|
import type { OhMyOpenCodeConfig } from "../config";
|
||||||
import { getAgentListDisplayName } from "../shared/agent-display-names";
|
import { getAgentDisplayName } from "../shared/agent-display-names";
|
||||||
import {
|
import {
|
||||||
loadUserCommands,
|
loadUserCommands,
|
||||||
loadProjectCommands,
|
loadProjectCommands,
|
||||||
@@ -96,7 +96,7 @@ export async function applyCommandConfig(params: {
|
|||||||
function remapCommandAgentFields(commands: Record<string, Record<string, unknown>>): void {
|
function remapCommandAgentFields(commands: Record<string, Record<string, unknown>>): void {
|
||||||
for (const cmd of Object.values(commands)) {
|
for (const cmd of Object.values(commands)) {
|
||||||
if (cmd?.agent && typeof cmd.agent === "string") {
|
if (cmd?.agent && typeof cmd.agent === "string") {
|
||||||
cmd.agent = getAgentListDisplayName(cmd.agent);
|
cmd.agent = getAgentDisplayName(cmd.agent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user