From 0b08164cc2efef1549e479e4a31f5b93b0ecb49f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 18:27:35 -0800 Subject: [PATCH] fix: update system prompt metadata label to "System prompt last recompiled" (#9477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: update system prompt metadata label from "Memory blocks were last modified" to "System prompt last recompiled" When git-based memory is enabled, there are no memory blocks, so the label "Memory blocks were last modified" is inaccurate. Changed to "System prompt last recompiled" which accurately reflects the timestamp meaning. Fixes #9476 🐾 Generated with [Letta Code](https://letta.com) Co-authored-by: letta-code <248085862+letta-code@users.noreply.github.com> Co-authored-by: Letta --- letta/prompts/prompt_generator.py | 6 +++--- tests/test_prompt_caching.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/letta/prompts/prompt_generator.py b/letta/prompts/prompt_generator.py index 90c4a665..ab8e7208 100644 --- a/letta/prompts/prompt_generator.py +++ b/letta/prompts/prompt_generator.py @@ -32,7 +32,7 @@ class PromptGenerator: is available through its tools. Args: - memory_edit_timestamp: When memory blocks were last modified + memory_edit_timestamp: When the system prompt was last recompiled timezone: The timezone to use for formatting timestamps (e.g., 'America/Los_Angeles') previous_message_count: Number of messages in recall memory (conversation history) archival_memory_size: Number of items in archival memory (long-term storage) @@ -44,7 +44,7 @@ class PromptGenerator: Example Output: - The current time is: 2024-01-15 10:30 AM PST - - Memory blocks were last modified: 2024-01-15 09:00 AM PST + - System prompt last recompiled: 2024-01-15 09:00 AM PST - 42 previous messages between you and the user are stored in recall memory (use tools to access them) - 156 total memories you created are stored in archival memory (use tools to access them) - Available archival memory tags: project_x, meeting_notes, research, ideas @@ -57,7 +57,7 @@ class PromptGenerator: metadata_lines = [ "", f"- The current system date is: {get_local_time_fast(timezone)}", - f"- Memory blocks were last modified: {timestamp_str}", + f"- System prompt last recompiled: {timestamp_str}", f"- {previous_message_count} previous messages between you and the user are stored in recall memory (use tools to access them)", ] diff --git a/tests/test_prompt_caching.py b/tests/test_prompt_caching.py index 9f5ac8ab..01b3fc95 100644 --- a/tests/test_prompt_caching.py +++ b/tests/test_prompt_caching.py @@ -682,7 +682,7 @@ async def test_anthropic_system_prompt_stability(async_client: AsyncLetta): logger.info(diff_output[:2000]) # Truncate if too long logger.info("=" * 80) - if "Memory blocks were last modified" in diff_output: + if "System prompt last recompiled" in diff_output: logger.error("⚠️ TIMESTAMP IS CHANGING IN ACTUAL REQUESTS!") logger.error(" → This is the root cause of cache misses") @@ -1054,7 +1054,7 @@ async def test_gemini_request_prefix_stability(async_client: AsyncLetta): lineterm="", ) diff_output = "\n".join(diff) - if "Memory blocks were last modified" in diff_output or "timestamp" in diff_output.lower(): + if "System prompt last recompiled" in diff_output or "timestamp" in diff_output.lower(): logger.error("⚠️ TIMESTAMP IN SYSTEM INSTRUCTION IS CHANGING!") logger.error(" → This breaks Gemini implicit caching (prefix must match)") else: