Each user can rename the AI assistant and edit their own system prompt in Settings.
28 lines
901 B
TypeScript
28 lines
901 B
TypeScript
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");
|
|
});
|
|
});
|