refactor(agents): introduce chat/ category; dissolve top-level agents/shared

Recursive shared-folder rule: a shared/ must be shared by ALL siblings at its
level. The kernel (context, compaction, retry_after, web_search) was shared by
only 2 of the agents -- anonymous_chat + multi_agent_chat -- never by podcaster
or video_presentation. Those 2 are the "chat" category, so their shared code
belongs in that category's shared/, not the top-level one.

  app/agents/anonymous_chat/   -> app/agents/chat/anonymous_chat/
  app/agents/multi_agent_chat/ -> app/agents/chat/multi_agent_chat/
  app/agents/shared/           -> app/agents/chat/shared/   (anon<->mac kernel)

Top-level app/agents/shared/ is gone: nothing was shared across all three
categories (chat / podcaster / video_presentation).

~289 import sites rewritten (app.agents.{anonymous_chat,multi_agent_chat,shared}
-> app.agents.chat.*); all moves are git renames (history preserved).
app/agents/ now: chat/, podcaster/, video_presentation/, runtime/.
This commit is contained in:
CREDO23 2026-06-05 12:54:02 +02:00
parent d59bb2b5aa
commit 24b62a63b4
570 changed files with 712 additions and 613 deletions

View file

@ -204,7 +204,9 @@ async def validate_llm_config(
if litellm_params:
litellm_kwargs.update(litellm_params)
from app.agents.multi_agent_chat.shared.llm_config import SanitizedChatLiteLLM
from app.agents.chat.multi_agent_chat.shared.llm_config import (
SanitizedChatLiteLLM,
)
llm = SanitizedChatLiteLLM(**litellm_kwargs)
@ -379,7 +381,7 @@ async def get_search_space_llm_instance(
if disable_streaming:
litellm_kwargs["disable_streaming"] = True
from app.agents.multi_agent_chat.shared.llm_config import (
from app.agents.chat.multi_agent_chat.shared.llm_config import (
SanitizedChatLiteLLM,
)
@ -460,7 +462,9 @@ async def get_search_space_llm_instance(
if disable_streaming:
litellm_kwargs["disable_streaming"] = True
from app.agents.multi_agent_chat.shared.llm_config import SanitizedChatLiteLLM
from app.agents.chat.multi_agent_chat.shared.llm_config import (
SanitizedChatLiteLLM,
)
return SanitizedChatLiteLLM(**litellm_kwargs)
@ -582,7 +586,7 @@ async def get_vision_llm(
if global_cfg.get("litellm_params"):
litellm_kwargs.update(global_cfg["litellm_params"])
from app.agents.multi_agent_chat.shared.llm_config import (
from app.agents.chat.multi_agent_chat.shared.llm_config import (
SanitizedChatLiteLLM,
)
@ -638,7 +642,9 @@ async def get_vision_llm(
if vision_cfg.litellm_params:
litellm_kwargs.update(vision_cfg.litellm_params)
from app.agents.multi_agent_chat.shared.llm_config import SanitizedChatLiteLLM
from app.agents.chat.multi_agent_chat.shared.llm_config import (
SanitizedChatLiteLLM,
)
return SanitizedChatLiteLLM(**litellm_kwargs)
@ -683,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.multi_agent_chat.shared.llm_config import (
from app.agents.chat.multi_agent_chat.shared.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.multi_agent_chat.shared.llm_config`` re-exports
# class-body init time. ``app.agents.chat.multi_agent_chat.shared.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.multi_agent_chat.shared.path_resolver import (
from app.agents.chat.multi_agent_chat.shared.path_resolver import (
DOCUMENTS_ROOT,
safe_filename,
safe_folder_segment,

View file

@ -16,10 +16,10 @@ from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm.attributes import flag_modified
from app.agents.multi_agent_chat.constants import (
from app.agents.chat.multi_agent_chat.constants import (
CONNECTOR_TYPE_TO_CONNECTOR_AGENT_MAPS,
)
from app.agents.multi_agent_chat.shared.permissions import Rule, Ruleset
from app.agents.chat.multi_agent_chat.shared.permissions import Rule, Ruleset
from app.db import SearchSourceConnector, async_session_maker
logger = logging.getLogger(__name__)