Repository navigation
Expand file tree
/
Copy pathtest_working_memory.py
More file actions
43 lines (33 loc) · 1.75 KB
/
Copy pathtest_working_memory.py
File metadata and controls
43 lines (33 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""DETERMINISTIC EVAL — working-memory assembly is pure string logic.
Regression net for a live bug found on the dashboard: the agent had the date
but not the time, so it asked the user "what time is it?" before scheduling
something "in 30 minutes." The system prompt must carry a real clock.
"""
from __future__ import annotations
import re
from prometheus.config import load_settings
from prometheus.runtime.session import Session
def test_system_prompt_includes_current_time():
settings = load_settings()
settings.ensure_home()
system = Session(settings, memory=None).build_system("what should I do in 30 minutes?")
# a HH:MM clock must be present — not just a date — so the model never has
# to ask the user for the time (the live bug).
assert re.search(r"\b\d{2}:\d{2}\b", system), "system prompt is missing a HH:MM time"
assert "Right now it is" in system
def test_session_tags_history_with_its_session_id():
# sessions are just a session_id label; a fresh Session carries the default.
settings = load_settings()
assert Session(settings, memory=None).session_id == "default"
s = Session(settings, memory=None)
s.start_new("s-test")
assert s.session_id == "s-test" and s.history == []
def test_system_prompt_includes_own_model_identity():
"""Live bug on the dashboard (K3 launch day): asked "what's ur model", the
agent said it had no idea what it was running on. The system prompt must
name the model + provider so the agent can answer honestly."""
settings = load_settings()
settings.ensure_home()
settings.provider, settings.model = "kimi", "kimi-k3"
system = Session(settings, memory=None).build_system("what model are you?")
assert "kimi-k3" in system and "'kimi' provider" in system