From 64158b4def8815a51f3660fd050afbe6204475da Mon Sep 17 00:00:00 2001 From: song Date: Tue, 27 Oct 2026 00:50:05 +0800 Subject: [PATCH 1/2] fix(chat): restore the top-level module budget Signed-off-by: song --- loopx/{ => capabilities/manager_context}/chat_history.py | 2 +- loopx/capabilities/manager_context/roundtrip.py | 2 +- tests/architecture/test_content_digest_single_owner.py | 2 +- tests/test_chat_store_input_validation.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename loopx/{ => capabilities/manager_context}/chat_history.py (97%) diff --git a/loopx/chat_history.py b/loopx/capabilities/manager_context/chat_history.py similarity index 97% rename from loopx/chat_history.py rename to loopx/capabilities/manager_context/chat_history.py index a755ba1fb5..3b54355130 100644 --- a/loopx/chat_history.py +++ b/loopx/capabilities/manager_context/chat_history.py @@ -6,7 +6,7 @@ import json from typing import Any -from .control_plane.content_digest import BARE_SHA256_PATTERN +from ...control_plane.content_digest import BARE_SHA256_PATTERN def page_chat_messages(session_id: str, messages: list[dict[str, Any]], *, diff --git a/loopx/capabilities/manager_context/roundtrip.py b/loopx/capabilities/manager_context/roundtrip.py index e3232fd7c3..dc201fb19f 100644 --- a/loopx/capabilities/manager_context/roundtrip.py +++ b/loopx/capabilities/manager_context/roundtrip.py @@ -288,7 +288,7 @@ def project_chat_session_snapshot(root, store, session_id, *, registry, snapshot = (store.session_snapshot(session_id, strict_messages=True) if message_limit is not None else store.session_snapshot(session_id)) - from ...chat_history import page_chat_messages + from .chat_history import page_chat_messages page = (page_chat_messages(session_id, snapshot["messages"], limit=message_limit, cursor=message_cursor) if message_limit is not None else None) context_messages = snapshot["messages"] diff --git a/tests/architecture/test_content_digest_single_owner.py b/tests/architecture/test_content_digest_single_owner.py index 0acf6a3efa..9ae7c28e32 100644 --- a/tests/architecture/test_content_digest_single_owner.py +++ b/tests/architecture/test_content_digest_single_owner.py @@ -177,7 +177,7 @@ "loopx.capabilities.periodic_report.machine_defaults", "loopx.capabilities.progress_review.receipt", "loopx.chat_action_normalization", - "loopx.chat_history", + "loopx.capabilities.manager_context.chat_history", "loopx.cli_commands.quota_capture", "loopx.configuration_transaction", "loopx.control_plane.agents.execution_facts", diff --git a/tests/test_chat_store_input_validation.py b/tests/test_chat_store_input_validation.py index 60480881f2..b3f9cc421e 100644 --- a/tests/test_chat_store_input_validation.py +++ b/tests/test_chat_store_input_validation.py @@ -7,7 +7,7 @@ import loopx.chat_store as chat_store from loopx.chat_store import CHAT_SESSION_SCHEMA_VERSION, ChatSessionStore -from loopx.chat_history import page_chat_messages +from loopx.capabilities.manager_context.chat_history import page_chat_messages def test_agent_model_value_keeps_provider_protocol_characters() -> None: From a9fc7aa2da502d290a9371bc2f560dac74d691f0 Mon Sep 17 00:00:00 2001 From: song Date: Tue, 27 Oct 2026 01:20:39 +0800 Subject: [PATCH 2/2] test(chat): keep pytest fixture injection explicit Signed-off-by: song --- tests/test_chat_conversation_bindings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_chat_conversation_bindings.py b/tests/test_chat_conversation_bindings.py index 610d0da04e..ad95c75ad0 100644 --- a/tests/test_chat_conversation_bindings.py +++ b/tests/test_chat_conversation_bindings.py @@ -17,7 +17,7 @@ def _history_page_brief(): "inputs": [], "acceptance": ["Return the original conclusion"], "return_requirement": "Return here"} -def test_history_page_keeps_one_original_collaboration_carrier(flow, monkeypatch): +def test_history_page_keeps_one_original_collaboration_carrier(flow, monkeypatch): # noqa: F811 from loopx.capabilities.manager_context.roundtrip import project_chat_session_snapshot root, registry, store, create = flow @@ -43,7 +43,7 @@ def observed(*args): assert reads == [(sid, tid)] -def test_return_delivery_readback_survives_a_separate_history_page(flow): +def test_return_delivery_readback_survives_a_separate_history_page(flow): # noqa: F811 from loopx.capabilities.manager_context import acknowledge from loopx.capabilities.manager_context.roundtrip import drain, report, project_chat_session_snapshot @@ -68,7 +68,7 @@ def test_return_delivery_readback_survives_a_separate_history_page(flow): assert sum(bool(row.get("collaboration")) for row in rows) == 1 -def test_original_history_pages_freeze_append_boundary_and_keep_full_rows(ordinary, monkeypatch): +def test_original_history_pages_freeze_append_boundary_and_keep_full_rows(ordinary, monkeypatch): # noqa: F811 from urllib.parse import urlencode from loopx.chat_server import ChatHTTPServer