docs(agents): refresh comments that referenced the deleted single-agent stack (bucket B6)

After deleting app/agents/new_chat/, several shared-kernel comments still cited
new_chat paths/cycles. Update the two lazy-import comments in middleware to state
the real reason (tools.registry <-> shared.middleware cycle), and repoint dangling
``new_chat/tools/hitl.py`` / ``chat_deepagent`` doc references to their shared
locations. Comment-only; suite unaffected.
This commit is contained in:
CREDO23 2026-06-04 13:47:10 +02:00
parent 305a8fe7e6
commit 8faa03889d
6 changed files with 16 additions and 16 deletions

View file

@ -1,10 +1,10 @@
"""Shared poll-until-terminal helper for Celery-backed deliverables. """Shared poll-until-terminal helper for Celery-backed deliverables.
Lives in ``app.agents.shared`` (neutral package, no dependencies on either Lives in ``app.agents.shared`` (neutral kernel package, no dependency on
``new_chat`` or ``multi_agent_chat``) so both the flat single-agent tools ``multi_agent_chat``) so both the shared tools under ``app/agents/shared/tools/``
under ``app/agents/new_chat/tools/`` and the multi-agent subagent tools and the multi-agent subagent tools under
under ``app/agents/multi_agent_chat/subagents/builtins/deliverables/tools/`` ``app/agents/multi_agent_chat/subagents/builtins/deliverables/tools/`` can import
can import it without creating a circular dependency. it without creating a circular dependency.
Background Background
---------- ----------

View file

@ -39,9 +39,9 @@ if TYPE_CHECKING: # pragma: no cover - type-only
from langchain.agents.middleware.types import ToolCallRequest from langchain.agents.middleware.types import ToolCallRequest
from langgraph.types import Command from langgraph.types import Command
# Type-only import: keeping it lazy avoids a module-load cycle through the # Type-only import: ToolDefinition is only referenced in annotations, and a
# frozen single-agent package (new_chat.__init__ -> chat_deepagent -> # runtime import would close a module-load cycle (tools.registry imports
# middleware shim). Resolves to app.agents.shared.tools once tools migrate. # shared.middleware.dedup_tool_calls).
from app.agents.shared.tools.registry import ToolDefinition from app.agents.shared.tools.registry import ToolDefinition

View file

@ -16,7 +16,7 @@ This ships **OFF by default** until the frontend explicitly handles
``context.permission == "doom_loop"`` interrupts. ``context.permission == "doom_loop"`` interrupts.
Wire format: uses SurfSense's existing ``interrupt()`` payload shape Wire format: uses SurfSense's existing ``interrupt()`` payload shape
(see ``app/agents/new_chat/tools/hitl.py``): (see ``app/agents/shared/tools/hitl.py``):
{ {
"type": "permission_ask", "type": "permission_ask",

View file

@ -8,7 +8,7 @@ per-thread overrides, and no auto-deny synthesis.
This middleware ports OpenCode's ``packages/opencode/src/permission/index.ts`` This middleware ports OpenCode's ``packages/opencode/src/permission/index.ts``
ruleset model on top of SurfSense's existing ``interrupt({type, action, ruleset model on top of SurfSense's existing ``interrupt({type, action,
context})`` payload shape (see ``app/agents/new_chat/tools/hitl.py``) so context})`` payload shape (see ``app/agents/shared/tools/hitl.py``) so
the frontend keeps working unchanged. the frontend keeps working unchanged.
Operation: Operation:
@ -85,7 +85,7 @@ def _default_pattern_resolver(name: str) -> PatternResolver:
# Translation from the LangChain HITL envelope (what ``stream_resume_chat`` # Translation from the LangChain HITL envelope (what ``stream_resume_chat``
# sends) to SurfSense's legacy ``decision_type`` shape. ``edit`` keeps the # sends) to SurfSense's legacy ``decision_type`` shape. ``edit`` keeps the
# original tool args — tools needing argument edits should use # original tool args — tools needing argument edits should use
# ``request_approval`` from ``app/agents/new_chat/tools/hitl.py``. # ``request_approval`` from ``app/agents/shared/tools/hitl.py``.
_LC_TYPE_TO_PERMISSION_DECISION: dict[str, str] = { _LC_TYPE_TO_PERMISSION_DECISION: dict[str, str] = {
"approve": "once", "approve": "once",
"reject": "reject", "reject": "reject",

View file

@ -118,9 +118,9 @@ class ToolCallNameRepairMiddleware(
return call return call
# Stage 2 — invalid fallback # Stage 2 — invalid fallback
# Local import avoids a module-load cycle through the frozen single-agent # Local import avoids a module-load cycle: tools.registry imports
# package (new_chat.__init__ -> chat_deepagent -> middleware shim). # shared.middleware (dedup_tool_calls), so importing tools at module
# Resolves to app.agents.shared.tools once tools migrate. # scope here would close the loop.
from app.agents.shared.tools.invalid_tool import INVALID_TOOL_NAME from app.agents.shared.tools.invalid_tool import INVALID_TOOL_NAME
if INVALID_TOOL_NAME in registered: if INVALID_TOOL_NAME in registered:

View file

@ -44,8 +44,8 @@ logger = logging.getLogger(__name__)
# change is "no interrupt fires". # change is "no interrupt fires".
# #
# To re-enable prompting, the future per-search-space rules table # To re-enable prompting, the future per-search-space rules table
# (``agent_permission_rules``) takes precedence — see the ``# (future)`` # (``agent_permission_rules``) takes precedence in the permission ruleset
# layer-3 comment in :mod:`app.agents.new_chat.chat_deepagent`. # layering assembled by the agent factory.
DEFAULT_AUTO_APPROVED_TOOLS: frozenset[str] = frozenset( DEFAULT_AUTO_APPROVED_TOOLS: frozenset[str] = frozenset(
{ {
"create_gmail_draft", "create_gmail_draft",