feat: per-user assistant name and system prompt customization
Each user can rename the AI assistant and edit their own system prompt in Settings.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
import {
|
||||
DEFAULT_ASSISTANT_NAME,
|
||||
resolveAssistantSystemPrompt,
|
||||
} from "../../src/lib/assistant-config";
|
||||
import { AGENT_SYSTEM_PROMPT } from "../../src/modules/agent/tools";
|
||||
|
||||
describe("resolveAssistantSystemPrompt", () => {
|
||||
it("returns the default prompt when custom is null", () => {
|
||||
assert.equal(resolveAssistantSystemPrompt(null), AGENT_SYSTEM_PROMPT);
|
||||
});
|
||||
|
||||
it("returns the default prompt when custom is blank", () => {
|
||||
assert.equal(resolveAssistantSystemPrompt(" "), AGENT_SYSTEM_PROMPT);
|
||||
});
|
||||
|
||||
it("returns trimmed custom prompt when set", () => {
|
||||
assert.equal(resolveAssistantSystemPrompt(" Be extra cheerful. "), "Be extra cheerful.");
|
||||
});
|
||||
});
|
||||
|
||||
describe("DEFAULT_ASSISTANT_NAME", () => {
|
||||
it("is Assistant", () => {
|
||||
assert.equal(DEFAULT_ASSISTANT_NAME, "Assistant");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user