From 52ca5c4aa246009b629a18d8af8faa7acde16d78 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 27 Dec 2025 00:36:04 +0000 Subject: [PATCH] fix: drop identity emoji response prefix --- CHANGELOG.md | 2 +- src/config/config.test.ts | 32 +++++++++++++++++++++++++++++--- src/config/config.ts | 5 ----- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 934cb4cbd..404e25c2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,7 +40,7 @@ - System prompt now tags allowlisted owner numbers as the user identity to avoid mistaken “friend” assumptions. - LM Studio/Ollama replies now require tags; streaming ignores content until begins. - LM Studio responses API: tools payloads no longer include `strict: null`, and LM Studio no longer gets forced `/` tags. -- Empty `messages.responsePrefix` now disables the identity emoji prefix. +- Identity emoji no longer auto-prefixes replies (set `messages.responsePrefix` explicitly if desired). - `process log` pagination is now line-based (omit `offset` to grab the last N lines). - macOS WebChat: assistant bubbles now update correctly when toggling light/dark mode. - macOS: avoid spawning a duplicate gateway process when an external listener already exists. diff --git a/src/config/config.test.ts b/src/config/config.test.ts index f5b6fd2fe..c6669848a 100644 --- a/src/config/config.test.ts +++ b/src/config/config.test.ts @@ -27,7 +27,7 @@ describe("config identity defaults", () => { process.env.HOME = previousHome; }); - it("derives responsePrefix and mentionPatterns when identity is set", async () => { + it("derives mentionPatterns when identity is set", async () => { await withTempHome(async (home) => { const configDir = path.join(home, ".clawdis"); await fs.mkdir(configDir, { recursive: true }); @@ -49,7 +49,7 @@ describe("config identity defaults", () => { const { loadConfig } = await import("./config.js"); const cfg = loadConfig(); - expect(cfg.messages?.responsePrefix).toBe("🦥"); + expect(cfg.messages?.responsePrefix).toBeUndefined(); expect(cfg.routing?.groupChat?.mentionPatterns).toEqual([ "\\b@?Samantha\\b", ]); @@ -139,7 +139,7 @@ describe("config identity defaults", () => { const { loadConfig } = await import("./config.js"); const cfg = loadConfig(); - expect(cfg.messages?.responsePrefix).toBe("🦥"); + expect(cfg.messages?.responsePrefix).toBeUndefined(); expect(cfg.routing?.groupChat?.mentionPatterns).toEqual([ "\\b@?Samantha\\b", ]); @@ -147,4 +147,30 @@ describe("config identity defaults", () => { expect(cfg.session).toBeUndefined(); }); }); + + it("does not derive responsePrefix from identity emoji", async () => { + await withTempHome(async (home) => { + const configDir = path.join(home, ".clawdis"); + await fs.mkdir(configDir, { recursive: true }); + await fs.writeFile( + path.join(configDir, "clawdis.json"), + JSON.stringify( + { + identity: { name: "Clawd", theme: "space lobster", emoji: "🦞" }, + messages: {}, + routing: {}, + }, + null, + 2, + ), + "utf-8", + ); + + vi.resetModules(); + const { loadConfig } = await import("./config.js"); + const cfg = loadConfig(); + + expect(cfg.messages?.responsePrefix).toBeUndefined(); + }); + }); }); diff --git a/src/config/config.ts b/src/config/config.ts index 5e4363af9..8ccae1ae0 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -878,11 +878,6 @@ function applyIdentityDefaults(cfg: ClawdisConfig): ClawdisConfig { let mutated = false; const next: ClawdisConfig = { ...cfg }; - if (emoji && messages.responsePrefix === undefined) { - next.messages = { ...(next.messages ?? messages), responsePrefix: emoji }; - mutated = true; - } - if (name && !groupChat.mentionPatterns) { const parts = name.split(/\s+/).filter(Boolean).map(escapeRegExp); const re = parts.length ? parts.join("\\s+") : escapeRegExp(name);