Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: update system prompt metadata label to "System prompt last recompiled" (#9477)

github-actions[bot]0b08164cc2ef
diff --git a/letta/prompts/prompt_generator.py b/letta/prompts/prompt_generator.py
index 90c4a6655..ab8e72085 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:
<memory_metadata>
- 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 = [
"<memory_metadata>",
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 9f5ac8ab9..01b3fc95a 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: