refactor(agents): consolidate chat runtime infra under chat/runtime

Move the lower-level runtime/infra modules out of multi_agent_chat/shared/
(they were never used by subagents, so they failed the shared-by-all-siblings
rule) and unify them with the already-relocated checkpointer:

  agents/runtime/                      -> agents/chat/runtime/
  mac/shared/errors.py                 -> chat/runtime/errors.py
  mac/shared/llm_config.py             -> chat/runtime/llm_config.py
  mac/shared/prompt_caching.py         -> chat/runtime/prompt_caching.py
  mac/shared/mention_resolver.py       -> chat/runtime/mention_resolver.py
  mac/shared/path_resolver.py          -> chat/runtime/path_resolver.py

These sit below the agent packages: the boundary + agent factory + shared
middleware depend on them, and they import no agent code (acyclic).
This commit is contained in:
CREDO23 2026-06-05 13:19:24 +02:00
parent 7d866a2279
commit f2a61bc0ef
52 changed files with 97 additions and 87 deletions

View file

@ -204,7 +204,7 @@ async def validate_llm_config(
if litellm_params:
litellm_kwargs.update(litellm_params)
from app.agents.chat.multi_agent_chat.shared.llm_config import (
from app.agents.chat.runtime.llm_config import (
SanitizedChatLiteLLM,
)
@ -381,7 +381,7 @@ async def get_search_space_llm_instance(
if disable_streaming:
litellm_kwargs["disable_streaming"] = True
from app.agents.chat.multi_agent_chat.shared.llm_config import (
from app.agents.chat.runtime.llm_config import (
SanitizedChatLiteLLM,
)
@ -462,7 +462,7 @@ async def get_search_space_llm_instance(
if disable_streaming:
litellm_kwargs["disable_streaming"] = True
from app.agents.chat.multi_agent_chat.shared.llm_config import (
from app.agents.chat.runtime.llm_config import (
SanitizedChatLiteLLM,
)
@ -586,7 +586,7 @@ async def get_vision_llm(
if global_cfg.get("litellm_params"):
litellm_kwargs.update(global_cfg["litellm_params"])
from app.agents.chat.multi_agent_chat.shared.llm_config import (
from app.agents.chat.runtime.llm_config import (
SanitizedChatLiteLLM,
)
@ -642,7 +642,7 @@ async def get_vision_llm(
if vision_cfg.litellm_params:
litellm_kwargs.update(vision_cfg.litellm_params)
from app.agents.chat.multi_agent_chat.shared.llm_config import (
from app.agents.chat.runtime.llm_config import (
SanitizedChatLiteLLM,
)
@ -689,7 +689,7 @@ def get_planner_llm() -> ChatLiteLLM | None:
Callers MUST fall back to their chat LLM when this returns ``None`` so
deployments without a planner config keep working unchanged.
"""
from app.agents.chat.multi_agent_chat.shared.llm_config import (
from app.agents.chat.runtime.llm_config import (
create_chat_litellm_from_config,
)

View file

@ -53,7 +53,7 @@ logger = logging.getLogger(__name__)
#
# Owned here because ``app.services.provider_capabilities`` is the
# only edge that's safe to call from ``app.config``'s YAML loader at
# class-body init time. ``app.agents.chat.multi_agent_chat.shared.llm_config`` re-exports
# class-body init time. ``app.agents.chat.runtime.llm_config`` re-exports
# this constant under the historical ``PROVIDER_MAP`` name; placing the
# map there directly would re-introduce the
# ``app.config -> ... -> deliverables/tools/generate_image ->

View file

@ -38,7 +38,7 @@ from typing import Any, Literal
from sqlalchemy import delete, select
from sqlalchemy.ext.asyncio import AsyncSession
from app.agents.chat.multi_agent_chat.shared.path_resolver import (
from app.agents.chat.runtime.path_resolver import (
DOCUMENTS_ROOT,
safe_filename,
safe_folder_segment,