feat(maf-roundtable): add Phase-1 multi-agent roundtable infrastructure
Ship an independent, feature-flag-gated MAF roundtable skeleton with six isolated tables, atomic single-transaction run launch/cancel, owner-scoped read/write split, shared config enums, and HTTP/concurrency regression tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a0a75a9964
commit
e690475e6e
27 files changed
+5369
-101
No files matched your search
@@ -11,9 +11,9 @@ from pydantic import BaseModel, ConfigDict, Field
|
||||
from deerflow.config.acp_config import ACPAgentConfig, load_acp_config_from_dict
|
||||
from deerflow.config.agents_api_config import AgentsApiConfig, load_agents_api_config_from_dict
|
||||
from deerflow.config.browser_context_config import BrowserContextConfig
|
||||
from deerflow.config.checkpointer_config import CheckpointerConfig, load_checkpointer_config_from_dict
|
||||
from deerflow.config.concurrency_config import ConcurrencyConfig
|
||||
from deerflow.config.database_config import DatabaseConfig
|
||||
from deerflow.config.checkpointer_config import CheckpointerConfig, load_checkpointer_config_from_dict
|
||||
from deerflow.config.concurrency_config import ConcurrencyConfig
|
||||
from deerflow.config.database_config import DatabaseConfig
|
||||
from deerflow.config.extensions_config import ExtensionsConfig
|
||||
from deerflow.config.gateway_config import GatewayConfig
|
||||
from deerflow.config.guardrails_config import GuardrailsConfig, load_guardrails_config_from_dict
|
||||
@@ -21,6 +21,7 @@ from deerflow.config.knowledge_config import KnowledgeConfig
|
||||
from deerflow.config.knowledge_ingest_config import KnowledgeIngestConfig
|
||||
from deerflow.config.log_system_config import LogSystemConfig
|
||||
from deerflow.config.login_config import AuthLoginConfig
|
||||
from deerflow.config.maf_roundtable_config import MafRoundtableConfig
|
||||
from deerflow.config.memory_config import MemoryConfig, load_memory_config_from_dict
|
||||
from deerflow.config.model_config import ModelConfig
|
||||
from deerflow.config.run_events_config import RunEventsConfig
|
||||
@@ -138,13 +139,14 @@ class AppConfig(BaseModel):
|
||||
gateway: GatewayConfig = Field(default_factory=GatewayConfig, description="Gateway FastAPI listening port (used by intra-process loopback)")
|
||||
run_events: RunEventsConfig = Field(default_factory=RunEventsConfig, description="Run event storage configuration")
|
||||
checkpointer: CheckpointerConfig | None = Field(default=None, description="Checkpointer configuration")
|
||||
stream_bridge: StreamBridgeConfig | None = Field(default=None, description="Stream bridge configuration")
|
||||
concurrency: ConcurrencyConfig = Field(default_factory=ConcurrencyConfig, description="Optional cross-worker concurrency coordination")
|
||||
browser_context: BrowserContextConfig = Field(default_factory=BrowserContextConfig, description="Optional browser page capture integration")
|
||||
stream_bridge: StreamBridgeConfig | None = Field(default=None, description="Stream bridge configuration")
|
||||
concurrency: ConcurrencyConfig = Field(default_factory=ConcurrencyConfig, description="Optional cross-worker concurrency coordination")
|
||||
browser_context: BrowserContextConfig = Field(default_factory=BrowserContextConfig, description="Optional browser page capture integration")
|
||||
knowledge: KnowledgeConfig = Field(default_factory=KnowledgeConfig, description="Product knowledge base (obsidian-wiki compatible vault) configuration")
|
||||
knowledge_ingest: KnowledgeIngestConfig = Field(default_factory=KnowledgeIngestConfig, description="External knowledge-ingest endpoint configuration")
|
||||
task_deeplink: TaskDeeplinkConfig = Field(default_factory=TaskDeeplinkConfig, description="任务深链(rwfx)目的树闸门与跳转地址配置(前端经 /api/public/config/task-deeplink 读取)")
|
||||
y_log: YLogConfig = Field(default_factory=YLogConfig, description="操作日志上报配置(前端经 /api/public/config/y-log 读取)")
|
||||
maf_roundtable: MafRoundtableConfig = Field(default_factory=MafRoundtableConfig, description="Microsoft Agent Framework 多智能体会商实验功能开关(部署级,默认关闭;关闭时 SDK 延迟不加载,写接口返回 503)")
|
||||
|
||||
@classmethod
|
||||
def resolve_config_path(cls, config_path: str | None = None) -> Path:
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
"""Microsoft Agent Framework 多智能体会商实验功能开关配置。
|
||||
|
||||
本段为**部署级**特性开关:默认关闭。关闭时:
|
||||
|
||||
- Gateway 启动**不**加载 MAF SDK(SDK 延迟导入,仅在实际启用并触发会商 run
|
||||
时才在 ``app.maf_roundtable`` 内 import)。
|
||||
- ``/api/maf-roundtable/*`` 路由仍注册,但所有写接口与健康检查返回 ``503
|
||||
Service Disabled``;只读的会话列表/详情可继续工作以便管理员查看历史。
|
||||
- 前端入口由 ``GET /api/maf-roundtable/health`` 的 ``enabled`` 字段决定是否
|
||||
显示。
|
||||
|
||||
段内只有开关与运行参数,无密钥,可公开只读(仿 ``y_log_config`` 的写法)。
|
||||
|
||||
``MafMode`` / ``MafWritePolicy`` 是部署配置与 API schema 共用的单一来源枚举,
|
||||
避免两处各自维护一套合法值。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
# ── shared enums (config + API schemas) ───────────────────────────────────
|
||||
|
||||
MafMode = Literal["structured", "group_chat"]
|
||||
MafWritePolicy = Literal["auto", "confirm_high_risk", "confirm_all_writes"]
|
||||
MafParticipantRole = Literal["manager", "seat"]
|
||||
|
||||
|
||||
class MafRoundtableConfig(BaseModel):
|
||||
"""Microsoft Agent Framework 多智能体会商实验功能开关。
|
||||
|
||||
默认 ``enabled=False``:这是一个独立于现有 ``RoundtablePlanningPage`` 的
|
||||
实验性功能,不替换旧会商;首期仅管理员/白名单可见,关闭时完全不影响
|
||||
Gateway 启动与旧功能行为。
|
||||
"""
|
||||
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
description="是否启用 MAF 多智能体会商实验功能;关闭时 SDK 延迟不加载,写接口返回 503。",
|
||||
)
|
||||
# 默认编排模式(用户可在创建会商时覆盖)。
|
||||
default_mode: MafMode = Field(
|
||||
default="structured",
|
||||
description="默认编排模式:structured(固定流程)| group_chat(动态群聊)",
|
||||
)
|
||||
# 默认写入策略(auto / confirm_high_risk / confirm_all_writes)。
|
||||
default_write_policy: MafWritePolicy = Field(
|
||||
default="confirm_high_risk",
|
||||
description="默认外部写入策略:auto / confirm_high_risk / confirm_all_writes",
|
||||
)
|
||||
# 默认最大轮次(群聊硬上限)。
|
||||
default_max_rounds: int = Field(
|
||||
default=8,
|
||||
ge=1,
|
||||
le=64,
|
||||
description="默认最大轮次上限(群聊模式硬上限,避免弱模型无限讨论)",
|
||||
)
|
||||
# 管理员诊断是否可见所有用户的会商(true=管理员跨用户读,false=管理员也只能看自己的)。
|
||||
admin_diagnostic_access: bool = Field(
|
||||
default=True,
|
||||
description="管理员是否可跨用户读取所有 MAF 会商用于诊断(仅读,不含写)",
|
||||
)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"MafMode",
|
||||
"MafParticipantRole",
|
||||
"MafRoundtableConfig",
|
||||
"MafWritePolicy",
|
||||
]
|
||||
Reference in new issue
Block a user