mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-17 18:35:19 +02:00
multi_agent_chat: pack_subagent owns per-subagent PermissionMiddleware via Ruleset
This commit is contained in:
parent
67142e68b1
commit
d45dfbfbd6
4 changed files with 38 additions and 27 deletions
|
|
@ -12,7 +12,6 @@ from deepagents.middleware.subagents import (
|
|||
SubAgentMiddleware,
|
||||
)
|
||||
from langchain.agents import create_agent
|
||||
from langchain.agents.middleware import HumanInTheLoopMiddleware
|
||||
from langchain.chat_models import init_chat_model
|
||||
from langgraph.types import Checkpointer
|
||||
|
||||
|
|
@ -81,10 +80,6 @@ class SurfSenseCheckpointedSubAgentMiddleware(SubAgentMiddleware):
|
|||
|
||||
middleware: list[Any] = list(spec.get("middleware", []))
|
||||
|
||||
interrupt_on = spec.get("interrupt_on")
|
||||
if interrupt_on:
|
||||
middleware.append(HumanInTheLoopMiddleware(interrupt_on=interrupt_on))
|
||||
|
||||
specs.append(
|
||||
{
|
||||
"name": spec["name"],
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ matching OpenCode's ``permission/index.ts`` evaluation order):
|
|||
needs to *deny* what the user has explicitly forbidden; the default
|
||||
``ask`` fallback would otherwise double-prompt every safe read-only
|
||||
call.
|
||||
2. ``extra_rulesets`` — caller-supplied rulesets. The KB subagent contributes
|
||||
its destructive-FS ``ask`` rules here; connectors will follow once
|
||||
they migrate off ``interrupt_on``.
|
||||
2. ``extra_rulesets`` — caller-supplied rulesets. Each subagent
|
||||
contributes its own (KB: destructive-FS ``ask`` rules; connectors:
|
||||
per-tool ``allow``/``ask``).
|
||||
|
||||
Connector deny synthesis from ``new_chat._synthesize_connector_deny_rules``
|
||||
is intentionally NOT replicated: the multi-agent orchestrator already
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue