Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion loopx/chat_session_open.py → loopx/chat/session_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pathlib import Path
from typing import Any

from .chat_manager import open_manager_session
from ..chat_manager import open_manager_session

# The executor a Goal-scoped session runs on when the caller makes no explicit
# pick. The steward channel does not use this: it resolves its own default.
Expand Down
6 changes: 3 additions & 3 deletions loopx/chat_ssh_source_api.py → loopx/chat/ssh_source_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from collections.abc import Callable
from typing import Any

from .control_plane.goals.ssh_lifecycle_transport import (
from ..control_plane.goals.ssh_lifecycle_transport import (
apply_ssh_goal_lifecycle,
)
from .control_plane.status.ssh_tunnel import ensure_ssh_source
from .status_server import is_loopback_host
from ..control_plane.status.ssh_tunnel import ensure_ssh_source
from ..status_server import is_loopback_host


SSH_SOURCE_ENSURE_PATH = "/api/ssh-source/ensure"
Expand Down
4 changes: 2 additions & 2 deletions loopx/chat_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
MANAGER_AGENT_GOAL_ID, MANAGER_AGENT_OBJECTIVE, is_manager_channel,
manager_capabilities_projection, manager_workspace,
)
from .chat_session_open import open_chat_session
from .chat_ssh_source_api import SshSourceRequestMixin
from .chat.session_open import open_chat_session
from .chat.ssh_source_api import SshSourceRequestMixin
from .chat_store import ChatSessionStore, TERMINAL_TURN_STATES
from .capabilities.native_chat.model_settings import normalize_agent_reasoning_effort, normalize_agent_model_id
from .extensions.lark.private_conversation_api import PrivateConversationRequestMixin, PRIVATE_CONVERSATIONS_PATH
Expand Down
2 changes: 1 addition & 1 deletion tests/architecture/top_level_module_budget.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schema": "loopx_top_level_module_budget_v0",
"baseline_commit": "a4483aaece5bc74ec3f969fd067229487022401b",
"max_top_level_modules": 136,
"max_top_level_modules": 134,
"allowlist": ["__init__.py", "entrypoint.py", "cli.py"]
}
6 changes: 6 additions & 0 deletions tests/test_chat_internal_module_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from loopx.chat.goal_configuration_api import GoalConfigurationRequestMixin
from loopx.chat.machine_configuration_api import MachineConfigurationRequestMixin
from loopx.chat.monitor_actions import ChatMonitorActionMixin
from loopx.chat.session_open import open_chat_session
from loopx.chat.ssh_source_api import SshSourceRequestMixin
from loopx.chat.todo_actions import ChatTodoActionMixin
from loopx.chat.todo_detail import TodoDetailRequestMixin
from loopx.chat.usage_statistics_api import UsageStatisticsRequestMixin
Expand All @@ -31,6 +33,8 @@ def test_chat_internal_helpers_load_below_the_public_chat_namespace() -> None:
== "loopx.chat.machine_configuration_api"
)
assert ChatMonitorActionMixin.__module__ == "loopx.chat.monitor_actions"
assert open_chat_session.__module__ == "loopx.chat.session_open"
assert SshSourceRequestMixin.__module__ == "loopx.chat.ssh_source_api"
assert ChatTodoActionMixin.__module__ == "loopx.chat.todo_actions"
assert TodoDetailRequestMixin.__module__ == "loopx.chat.todo_detail"
assert UsageStatisticsRequestMixin.__module__ == "loopx.chat.usage_statistics_api"
Expand All @@ -44,6 +48,8 @@ def test_chat_internal_helpers_have_no_top_level_compatibility_shims() -> None:
"loopx.chat_goal_configuration_api",
"loopx.chat_machine_configuration_api",
"loopx.chat_monitor_actions",
"loopx.chat_session_open",
"loopx.chat_ssh_source_api",
"loopx.chat_todo_actions",
"loopx.chat_todo_detail",
"loopx.chat_usage_statistics_api",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_native_steward_turn_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def managed_fixture(steward, tmp_path, monkeypatch, provider="file", *, validato
def test_registered_agents_have_distinct_durable_sessions_without_adopting_legacy_history(steward, tmp_path, monkeypatch, provider):
service, first, actor, _, _, capture = managed_fixture(steward, tmp_path, monkeypatch, provider)
store, runtime, *_ = steward
from loopx.chat_session_open import open_chat_session
from loopx.chat.session_open import open_chat_session
from loopx.agent_registry import load_goal_from_registry
cli(runtime, "configure-goal", "--goal-id", actor["goal_id"], "--registered-agent", actor["agent_id"],
"--registered-agent", "peer", "--execute")
Expand Down
8 changes: 4 additions & 4 deletions tests/test_ssh_tunnel_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import pytest

from loopx.chat_ssh_source_api import SshSourceRequestMixin
from loopx.chat.ssh_source_api import SshSourceRequestMixin
from loopx.control_plane.goals.ssh_lifecycle_transport import (
apply_ssh_goal_lifecycle,
)
Expand Down Expand Up @@ -135,7 +135,7 @@ def test_ssh_source_request_mixin_delegates_validated_loopback_request() -> None
receipt = {"ok": True, "status_url": "http://127.0.0.1:8877/status.json"}

with mock.patch(
"loopx.chat_ssh_source_api.ensure_ssh_source", return_value=receipt
"loopx.chat.ssh_source_api.ensure_ssh_source", return_value=receipt
) as ensure:
handler._ssh_source_ensure()

Expand All @@ -149,7 +149,7 @@ def test_ssh_source_request_mixin_delegates_validated_loopback_request() -> None
def test_ssh_source_request_mixin_rejects_non_loopback_server() -> None:
handler = _SshSourceHandler(host="0.0.0.0")

with mock.patch("loopx.chat_ssh_source_api.ensure_ssh_source") as ensure:
with mock.patch("loopx.chat.ssh_source_api.ensure_ssh_source") as ensure:
handler._ssh_source_ensure()

ensure.assert_not_called()
Expand Down Expand Up @@ -337,7 +337,7 @@ def test_ssh_goal_lifecycle_handler_returns_verified_remote_receipt() -> None:
"projection_verified": True,
}
with mock.patch(
"loopx.chat_ssh_source_api.apply_ssh_goal_lifecycle",
"loopx.chat.ssh_source_api.apply_ssh_goal_lifecycle",
return_value=receipt,
) as apply:
handler._ssh_goal_lifecycle()
Expand Down
Loading