mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 00:43:18 +08:00
fix(chat): compress-history on PostgreSQL dict rows
- Normalize select id,content rows from dict_row vs sqlite Row in history_tool_result_compact. - Expand memory_wiki_search ToolSpec to match wiki_search parameters; add schema regression test. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0dc0c4663f
commit
acfb2cf73b
4 changed files with 56 additions and 4 deletions
|
|
@ -3,7 +3,18 @@ from __future__ import annotations
|
|||
import json
|
||||
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
from runtime.chat.history_tool_result_compact import compact_tool_results_in_session_history
|
||||
from runtime.chat.history_tool_result_compact import (
|
||||
_chat_message_id_content,
|
||||
compact_tool_results_in_session_history,
|
||||
)
|
||||
|
||||
|
||||
def test_chat_message_id_content_dict_row() -> None:
|
||||
assert _chat_message_id_content({"id": 42, "content": "hello"}) == (42, "hello")
|
||||
|
||||
|
||||
def test_chat_message_id_content_tuple_like() -> None:
|
||||
assert _chat_message_id_content((9, "z")) == (9, "z")
|
||||
|
||||
|
||||
def test_compact_tool_results_in_session_history_rewrites_large_tool_message(tmp_path) -> None: # noqa: ANN001
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue