refactor: isolate runtime contracts and enforce import boundaries (#6166)

* test: enforce Python import ownership boundaries

* test: protect client import boundaries and rehome shared UI contracts

* refactor: remove gateway and client dependency inversions

* fix: detect dynamic imports in conditional expressions

* refactor(tools): keep configuration contracts with their owners

* docs: keep design guidance focused on ownership and checks

* fix: preserve default threaded turn delivery
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-13 13:56:28 +08:00
1 parent cd2a863710
commit 328e933d36
162 files changed
+3449 -1888

No files matched your search

+2 -8
View File
@@ -19,7 +19,7 @@ from nanobot.bus.outbound_events import (
)
from nanobot.bus.queue import MessageBus
from nanobot.bus.runtime_events import RuntimeEventPublisher
from nanobot.channels.notification_routes import notification_metadata
from nanobot.channels.notification_routes import notification_metadata, system_reply_metadata
from nanobot.events import (
AgentEvent,
ContextCompactionEvent,
@@ -180,13 +180,7 @@ class TurnDeliveryFactory:
channel, chat_id = (
msg.chat_id.split(":", 1) if ":" in msg.chat_id else ("cli", msg.chat_id)
)
metadata: dict[str, Any] = {}
if (
channel == "slack"
and session_key.startswith("slack:")
and session_key.count(":") >= 2
):
metadata["slack"] = {"thread_ts": session_key.split(":", 2)[2]}
metadata = system_reply_metadata(channel, session_key)
if origin_message_id := msg.metadata.get("origin_message_id"):
metadata["origin_message_id"] = origin_message_id
return TurnRoute(channel=channel, chat_id=chat_id, metadata=metadata)