mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-05 19:02:38 +00:00
test(session): preserve reasoning_content in session history
This commit is contained in:
parent
519911456a
commit
11c84f21a6
@ -173,6 +173,27 @@ def test_empty_session_history():
|
||||
assert history == []
|
||||
|
||||
|
||||
def test_get_history_preserves_reasoning_content():
|
||||
session = Session(key="test:reasoning")
|
||||
session.messages.append({"role": "user", "content": "hi"})
|
||||
session.messages.append({
|
||||
"role": "assistant",
|
||||
"content": "done",
|
||||
"reasoning_content": "hidden chain of thought",
|
||||
})
|
||||
|
||||
history = session.get_history(max_messages=500)
|
||||
|
||||
assert history == [
|
||||
{"role": "user", "content": "hi"},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "done",
|
||||
"reasoning_content": "hidden chain of thought",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# --- Window cuts mid-group: assistant present but some tool results orphaned ---
|
||||
|
||||
def test_window_cuts_mid_tool_group():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user