fix: allow empty responsePrefix
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
- System prompt now tags allowlisted owner numbers as the user identity to avoid mistaken “friend” assumptions.
|
- System prompt now tags allowlisted owner numbers as the user identity to avoid mistaken “friend” assumptions.
|
||||||
- LM Studio/Ollama replies now require <final> tags; streaming ignores content until <final> begins.
|
- LM Studio/Ollama replies now require <final> tags; streaming ignores content until <final> begins.
|
||||||
- LM Studio responses API: tools payloads no longer include `strict: null`, and LM Studio no longer gets forced `<think>/<final>` tags.
|
- LM Studio responses API: tools payloads no longer include `strict: null`, and LM Studio no longer gets forced `<think>/<final>` 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).
|
- `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 WebChat: assistant bubbles now update correctly when toggling light/dark mode.
|
||||||
- macOS: avoid spawning a duplicate gateway process when an external listener already exists.
|
- macOS: avoid spawning a duplicate gateway process when an external listener already exists.
|
||||||
|
|||||||
@@ -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 () => {
|
it("does not synthesize agent/session when absent", async () => {
|
||||||
await withTempHome(async (home) => {
|
await withTempHome(async (home) => {
|
||||||
const configDir = path.join(home, ".clawdis");
|
const configDir = path.join(home, ".clawdis");
|
||||||
|
|||||||
@@ -878,7 +878,7 @@ function applyIdentityDefaults(cfg: ClawdisConfig): ClawdisConfig {
|
|||||||
let mutated = false;
|
let mutated = false;
|
||||||
const next: ClawdisConfig = { ...cfg };
|
const next: ClawdisConfig = { ...cfg };
|
||||||
|
|
||||||
if (emoji && !messages.responsePrefix) {
|
if (emoji && messages.responsePrefix === undefined) {
|
||||||
next.messages = { ...(next.messages ?? messages), responsePrefix: emoji };
|
next.messages = { ...(next.messages ?? messages), responsePrefix: emoji };
|
||||||
mutated = true;
|
mutated = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user