mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 04:40:45 +08:00
完善 MCP/会话上下文治理并补齐搜索与诊断能力。
补充历史压缩与会话诊断链路,强化 tool pairing 与空响应兜底观测;完善 Admin MCP 导入/绑定与相关前端展示;新增 web_search_fast/web_fetch_clean 及多项测试与文档更新,并同步技能安装与角色绑定策略改进。 Made-with: Cursor
This commit is contained in:
parent
df91434936
commit
ae44cbcad5
43 changed files with 3549 additions and 57 deletions
22
tests/test_session_delete_cascade.py
Normal file
22
tests/test_session_delete_cascade.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
def test_delete_session_cascades_chat_message_and_tool_log(tmp_path) -> None: # noqa: ANN001
|
||||
db = tmp_path / "ops.sqlite"
|
||||
store = SqliteStore(str(db))
|
||||
sess = store.create_session("t")
|
||||
store.add_message(session_id=sess.id, role="user", content="hi", event_type="user_text")
|
||||
store.add_tool_log(session_id=sess.id, tool_name="x", args={"a": 1}, result={"ok": True})
|
||||
|
||||
store.delete_session(sess.id)
|
||||
|
||||
with store._connect() as conn: # noqa: SLF001
|
||||
c1 = conn.execute("select count(1) from chat_message where session_id=?", (sess.id,)).fetchone()[0]
|
||||
c2 = conn.execute("select count(1) from tool_log where session_id=?", (sess.id,)).fetchone()[0]
|
||||
c3 = conn.execute("select count(1) from chat_session where id=?", (sess.id,)).fetchone()[0]
|
||||
assert int(c3) == 0
|
||||
assert int(c1) == 0
|
||||
assert int(c2) == 0
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue