diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a1404b96..934cb4cbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +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. - `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 a94ff0c6d..f5b6fd2fe 100644 --- a/src/config/config.test.ts +++ b/src/config/config.test.ts @@ -91,6 +91,32 @@ describe("config identity defaults", () => { }); }); + it("respects empty responsePrefix to disable identity defaults", 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: "Samantha", theme: "helpful sloth", emoji: "🦥" }, + messages: { responsePrefix: "" }, + routing: {}, + }, + null, + 2, + ), + "utf-8", + ); + + vi.resetModules(); + const { loadConfig } = await import("./config.js"); + const cfg = loadConfig(); + + expect(cfg.messages?.responsePrefix).toBe(""); + }); + }); + it("does not synthesize agent/session when absent", async () => { await withTempHome(async (home) => { const configDir = path.join(home, ".clawdis"); diff --git a/src/config/config.ts b/src/config/config.ts index b2a79a0d5..5e4363af9 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -878,7 +878,7 @@ function applyIdentityDefaults(cfg: ClawdisConfig): ClawdisConfig { let mutated = false; const next: ClawdisConfig = { ...cfg }; - if (emoji && !messages.responsePrefix) { + if (emoji && messages.responsePrefix === undefined) { next.messages = { ...(next.messages ?? messages), responsePrefix: emoji }; mutated = true; }