feat: add learning and meta-cognitive thinking verbs (#325)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Cameron
2025-12-19 15:44:10 -08:00
committed by GitHub
parent 407e655069
commit 7bb20f43b7
2 changed files with 17 additions and 8 deletions

View File

@@ -32,6 +32,15 @@ const THINKING_VERBS = [
"rendering",
"executing",
"initializing",
"absolutely right",
"thinking about thinking",
"metathinking",
"learning",
"adapting",
"evolving",
"remembering",
"absorbing",
"internalizing",
] as const;
// Get a random thinking verb (e.g., "thinking", "processing")

View File

@@ -5,31 +5,31 @@ describe("Thinking messages", () => {
test("returns formatted message with agent name", () => {
const message = getRandomThinkingMessage("Letta");
// Should be in format "Letta is <verb>ing"
expect(message).toMatch(/^Letta is \w+$/);
// Should be in format "Letta is <verb/phrase>"
expect(message).toMatch(/^Letta is .+$/);
expect(message.startsWith("Letta is ")).toBe(true);
});
test("returns capitalized verb without agent name", () => {
const message = getRandomThinkingMessage();
// Should be a capitalized verb (e.g., "Thinking", "Processing")
expect(message).toMatch(/^[A-Z][a-z]+$/);
// Should be a capitalized verb/phrase (e.g., "Thinking", "Processing", "Absolutely right")
expect(message).toMatch(/^[A-Z].+$/);
expect(message[0]).toMatch(/[A-Z]/);
});
test("handles null agent name", () => {
const message = getRandomThinkingMessage(null);
// Should fall back to capitalized verb
expect(message).toMatch(/^[A-Z][a-z]+$/);
// Should fall back to capitalized verb/phrase
expect(message).toMatch(/^[A-Z].+$/);
});
test("handles empty string agent name", () => {
const message = getRandomThinkingMessage("");
// Should fall back to capitalized verb (empty string is falsy)
expect(message).toMatch(/^[A-Z][a-z]+$/);
// Should fall back to capitalized verb/phrase (empty string is falsy)
expect(message).toMatch(/^[A-Z].+$/);
});
test("generates different messages on multiple calls", () => {