fix: resolve format/build failures

This commit is contained in:
Peter Steinberger
2026-01-19 11:32:15 +00:00
parent b826bd668c
commit 588dc43787
22 changed files with 82 additions and 106 deletions

View File

@@ -55,7 +55,9 @@ function resolveAgentIdByWorkspace(
): string[] {
const list = listAgentEntries(cfg);
const ids =
list.length > 0 ? list.map((entry) => normalizeAgentId(entry.id)) : [resolveDefaultAgentId(cfg)];
list.length > 0
? list.map((entry) => normalizeAgentId(entry.id))
: [resolveDefaultAgentId(cfg)];
const normalizedTarget = normalizeWorkspacePath(workspaceDir);
return ids.filter(
(id) => normalizeWorkspacePath(resolveAgentWorkspaceDir(cfg, id)) === normalizedTarget,
@@ -134,10 +136,7 @@ export async function agentsSetIdentityCommand(
}
const fileTheme =
identityFromFile?.theme ??
identityFromFile?.creature ??
identityFromFile?.vibe ??
undefined;
identityFromFile?.theme ?? identityFromFile?.creature ?? identityFromFile?.vibe ?? undefined;
const incomingIdentity: IdentityConfig = {
...(nameRaw || identityFromFile?.name ? { name: nameRaw ?? identityFromFile?.name } : {}),
...(emojiRaw || identityFromFile?.emoji ? { emoji: emojiRaw ?? identityFromFile?.emoji } : {}),

View File

@@ -79,11 +79,7 @@ export function parseIdentityMarkdown(content: string): AgentIdentity {
const cleaned = line.trim().replace(/^\s*-\s*/, "");
const colonIndex = cleaned.indexOf(":");
if (colonIndex === -1) continue;
const label = cleaned
.slice(0, colonIndex)
.replace(/[*_]/g, "")
.trim()
.toLowerCase();
const label = cleaned.slice(0, colonIndex).replace(/[*_]/g, "").trim().toLowerCase();
const value = cleaned
.slice(colonIndex + 1)
.replace(/^[*_]+|[*_]+$/g, "")

View File

@@ -93,7 +93,12 @@ describe("agents set-identity command", () => {
configMocks.readConfigFileSnapshot.mockResolvedValue({
...baseSnapshot,
config: {
agents: { list: [{ id: "main", workspace }, { id: "ops", workspace }] },
agents: {
list: [
{ id: "main", workspace },
{ id: "ops", workspace },
],
},
},
});