feat(gateway): inject stable human-readable message timestamps

Consolidates these related Amy fork patches:
- 429830f39 feat(gateway): inject message timestamps into user messages for LLM context
- 3c3d6fac0 fix: handle both ISO string and epoch float timestamps in history replay
- 2874f7725 feat: human-friendly timestamp format with weekday and timezone name
- 3735f4c8b fix: render gateway message timestamps once
This commit is contained in:
Wolfram Ravenwolf
2026-06-16 15:49:59 -07:00
committed by Teknium
parent b7f0c9cd52
commit bd7fc8fdcd
13 changed files with 448 additions and 28 deletions
+6 -1
View File
@@ -211,7 +211,10 @@ class TestListAndCleanup:
db = manager._get_db()
messages = db.get_messages_as_conversation(state.session_id)
assert messages == [{"role": "user", "content": "original"}]
assert len(messages) == 1
assert messages[0]["role"] == "user"
assert messages[0]["content"] == "original"
assert isinstance(messages[0].get("timestamp"), (int, float))
def test_cleanup_clears_all(self, manager):
s1 = manager.create_session()
@@ -501,6 +504,8 @@ class TestPersistence:
restored = manager.get_session(state.session_id)
assert restored is not None
msg = restored.history[0]
assert isinstance(msg.pop("timestamp", None), (int, float))
assert restored.history == [{
"role": "assistant",
"content": "hello",