执行后将显示检查点
为下游平台(如 localhost:4001)签发 Bearer Key。下游平台于请求头携带 Authorization: Bearer <key> 即可调用本系统,无需登录态。
在此启用 / 禁用各 LLM Provider。被禁用的 Provider 将无法被调用(等价于加入全局 disabled_providers 清单)。
resources.plugin_allowlist 的可视化编辑(外科手术式写入,注释与格式保留)。
「不限制」= 未声明键(fail-open,与 tool_allowlist 缺省语义一致);白名单模式下仅勾选插件可在该工作空间渲染。
| Agent | 场景 | 锁定 | 标签 | 工具/平台 | 版本 | 更新时间 | 状态 | 治理姿态 | 操作 |
|---|---|---|---|---|---|---|---|---|---|
| 加载中... | |||||||||
data/files/ 目录下。上传、选择文件可在右侧查看内容,对话会自动路由到最佳 Agent。
对任意 Agent 角色执行「能力评估 → 迭代闭环 → 前后对比」全流程(复用 agent_capability_analyst 与 capability_loop)
Agent 角色平台 · 综合工作台
术语体系(term_resolver / term_gate / L0 vocab 闸门)+ 能力体系(能力契约 / 参数来源 / 归属 / 流转)→ 协同决定工作空间与 Agent 执行。本页权威链路细节对齐 AGENT_EXECUTION_MAP.md(内核四层执行链路)与 CROSS_WS_EXECUTION.md(跨域四机制 + 术语能力三总线);下方 ④ ⑤ ⑥ ⑦ 为从源码文档回填的权威链路。
chain_manager._infer_executor 的 EF_EXECUTORS 归类口径一致:entry → term_resolver → term_gate → got_planner → ontology_guard → injection → execution → review → result。8081 / 引擎 8085(由 PORT=8085 指定,绝非 8080)。rule_engine.enhance_architecture)、网关校验(_gw_check_* → HTTP 422)、SSE 透传;同进程承载 Loop 准确率闭环(judge / 弃权 / 契约 / schema / 负反馈)。无 Web 框架,基于标准库 ThreadingHTTPServer,经 PLATFORMAI_BASE_URL 调 8085。handlers.agent_execute 按 architecture 分流:无架构→单 ReAct;state_graph→原生执行(state_graph_config_to_graph + GraphExecutor);否则按 arch_type 派发六种编排器。路由层停顿根因:architecture.type 缺失或 arch_type 不在六种内 → 直接终止,子 Agent 一个都不执行。check_tenant_scope(租户越权拦截)、auto_write_node_state(节点输出入共享 State)、evaluate_rules(确定性规则校验·不调 LLM)、validate_contract(LLM 语义契约·fail-open)、run_guarded_node(契约强约束+重试)、检查点封装(Fork / Success / Failure Point)。ReActAgent。Chain 节点五型:Sequential / Loop / Conditional / RequiresApproval(⏸人审存 checkpoint) / Verification(命令行校验 + 状态契约,默认 fail_fast 即 Gate 阻断)。LLMProvider(OpenAI 兼容) + PlatformAdapter(跨平台路由)。真执行体:工具调用经 execute_tool 按 tool_platform_map / 注册表回退执行;max_rounds 默认 10。execute() 统一委托 execute_via_graph,旧双路径回退已不可达(保留死代码待删)。AgentResult → SSE 拆为 thinking → tool_call_end(每子Agent) → done → [DONE];接入层逐条 yield 并记录到 chain 结构(8085 原生支持 SSE 流式,具备打字机效果)。TENANT_SCOPE_DENIED / 空链 / APPROVAL_REQUIRED(⏸人审) / VERIFICATION_FAILED(Gate) / 节点 agent_id 静默跳过 / 某步 Err 整链终止;ReActAgent → 缺 platform_registry / 适配器 / max_rounds 超限 / LLM 报错 / GIL 死锁 / 递归回连自身死锁;Supervisor → 无 Worker / 决策失败 / 未注册 Worker 空转 / 解析失败被兜底 FINISH(过早收尾)。虚假成功陷阱:节点 status=error 但会话显示 ✅——以 nodes[].output 是否含 "success": false 为准。agent-platform/server.py + server_handler_post_agent.py(block 11-19 网关) + server_gateway.py;引擎 platformai-rs/src/server/handlers.rs(分流 / SSE);编排 execution_layer.rs / graph_executor.rs / chain_agent.rs / supervisor_agent.rs / react_agent.rs(跨平台回退 execute_tool:452-);适配器 adapters/{ConfigDrivenAdapter,AdapterRegistry}。file_ops 隔离总线 + exdir 约束总线。A/B 解决「怎么编排、怎么隔干净」;C/D 解决「怎么吃自己经验、越跑越稳」。| 机制 | 职责 | 关键驱动 / 落点 |
|---|---|---|
| A总办编排 | 跨域任务路由 + 部门选择派发 | cross_ws_orchestrator.yaml 定义 8 真实部门 worker + target_workspace;Rust supervisor/src/main.rs |
| B工作空间隔离 | 部门 Agent 只能碰自己文件桶 | DelegatedAgent::execute 注入 workspace_name → file_ops 收敛到 data/files/<ws>/(读看本桶 / 写限本桶) |
| Cexdir 约束注入 | 派发前把沉淀经验派生「自约束指令」注入 prompt | resolve_directive(关键词 + 成熟度 top_k) → render_*_hints(got_planner) 注入总办 / 部门;directives.py + got_planner.py |
| Dexdir 派生闭环 | 经验→约束、约束可自修正、租户隔离、缓存 | emit_* 派生 + apply_directive_outcome 回写成熟度 + retired;capability_loop/{directives,experience,training_promote}.py |
load_directives(tenant · 分层 + 指纹缓存 15s) → resolve_directive(关键词命中 + 成熟度加权 + top_k) → render_supervisor_hints / render_department_hints(派发前注入 prompt)。约束存储于 data/improvement/exdir_*.jsonld(@type ExecutionDirective,全局池 ~192 条)。exdir(约束总线)、file_ops(隔离总线) 并列的第三条总线:能力抽象与组合总线,对应「能力精细化抽象 / 术语组合成新术语 / 跨空间聚合」。workspaces/<ws>/build/lang/vocab.yaml 定义术语(intent),maps_to 指向底层执行;term_resolver.py:750 resolve_terms 三层解析;scope.yaml.quick_actions 为 L0 语义闸门(agent_executor.py:230-267)。compositions[] 经 compose_check.py 静态校验(S1~S5 / C1~C4) → promote.py 反注册回 vocab.yaml 成新 intent(action: compose);运行时 agent_executor.py:131 _sdwesp_composition_resolve 解出确定性组合 plan 强制按序执行。aggregate_workspace_terms()(term_resolver.py:922) 遍历全平台 ws 收集术语(带 workspace 来源 + 跨域契约) → render_catalog_for_orchestrator → _inject_cross_ws_term_catalog 注入总办 prompt。运行实证(2026-08-31):真实返回 122 术语 / 6 ws,跨域聚合真实运行。exdir 约束总线 + file_ops 隔离总线,是 cross_ws 受控跨域编排的最终三总线收敛点。chain 架构;非 chain 会话前端自动隐藏按钮)。execute_agent_via_http 在 architecture.type=='chain' 时把发给 Rust 的原始请求写入 execution_requests 表(react / state_graph 无 Rust 检查点,不归档)。GET /api/sessions/<id>/resume-info → {available, reason}。POST /api/sessions/<id>/resume 原样转发归档请求给 8085;Rust 按 chain_{platform_id}_{pipeline_key} 算同 session_id,命中未完成检查点 → 从中断节点续跑;已完成则从头重跑。execution_chain。checkpoints.db 决定;request_headers 含 X-Session-Context 沿用原始上下文。这是一份面向 Agent 构建者 的本体价值体验页。它用 真实业务实例(山东水务集团、智慧园区 IoT)说明: 当平台把散落的业务知识组织成「有类型、有关系、可推理」的语义层后,LLM 就不再面对一堆扁平文本, 而是能直接「看见」租户、企业、用户、流程、种子之间的结构与约束。
按三步理解:① 看结构(业务知识图谱)→ ② 看能力(自然语言如何被推理成精确 API 调用)→ ③ 看注入(LLM 系统提示里实际收到了什么)。
/api/ontology/*,即 Agent 运行时真正调用的后端)。agent_executor 在 metadata.ontology_context=true 时,拼进 Agent system_prompt 的文本片段。
它让 LLM「看见」业务概念、关系与已知实例。切换租户可体会多租户隔离:每个租户只看到自己的那一片业务。agent-platform 进程当时加载的本体;若刚新增实例未重启服务,可能与下方本地文本略有差异。data/ontology/ 目录禁止通过 file_write 工具直接写入。CapabilityDelta 增量补丁,
此处渲染所有角色的「已获得能力」及其落地校验状态。来源:data/ontology/*_ontology_caploop_live.jsonld。
每行代表一项由经验泛化「新增」的能力,并标识它是否真落地到角色 YAML 工具声明、是否挂了 render 校验钩子、是否通过 OC2 词汇自证。commit / 拒绝→candidate/{id}/reject(新增端点) / 回滚→rollback。建议经 http://localhost:8081/static/evolution-console.html 同源打开。
CAPSULE_AUTO_COMMIT=0 人工审批闸门后方可落库生效,全部动作进审计轨迹。呼应 DESIGN.md §5.4 / §6。http://localhost:8081/static/ext-wizard.html 同源打开以免 CORS。
platforms/*.json → 校验(含描述漂移检测)→ 预览影响面 → 重启 8085 生效。呼应 REDESIGN_SPEC §4 P-1。workspaces/*/scope.yaml 的 roles / tool_allowlist / kb_subset / on_out_of_pool,越界可审计。呼应 REDESIGN_SPEC §4 X-1(声明 vs 实际 diff)。index.html 壳的 Agent 配置。framework 唯一合法 react;architecture 选 7 种之一;system_prompt 领域知识外置到 KB 以瘦身(超预算标红,呼应 REDESIGN_SPEC §4 A-1)。reads / writes 读写此共享状态。// 运行结果将显示在此
| 方法 / 路径 | 说明 | 鉴权 |
|---|---|---|
POST /api/graph/run | 运行图,返回执行报告 | 免登录(POST 放行) |
GET /api/graph/health | 健康检查,返回 {"status":"ok"} | 免登录 |
GET /health | 平台统一健康检查(graph-service 独立端口) | 免登录 |
| 字段 | 类型 | 说明 |
|---|---|---|
graph | object | 图定义;也兼容直接用 nodes / state_graph 顶替 |
initial_state | object | 节点共享的初始状态 |
approver | string | auto / reject / http,默认 auto |
approver_url | string | approver=http 时的回调地址 |
approver_timeout | number | 审批回调超时秒数,默认 30 |
fail_fast | bool | 节点失败时是否立即中断,默认 true |
llm | object | 真实 LLM 配置(内联 LLM 节点用),如 {"provider":"openai","model":"gpt-4o","api_key":"..."} |
| 字段 | 说明 |
|---|---|
id | 节点唯一 ID |
node_type | 上列类型之一,默认 Sequential |
tool | {"tool_name":"...","arguments":{...}},tool_name 为已注册工具(如 uppercase / echo / compute / rag_search / llm_summarize) |
reads / writes | 从/向共享状态读写的键 |
system_prompt / prompt_template | 内联 LLM 节点用,prompt_template 支持 {key} 取 state |
condition / max_iterations / approval_prompt / verify_command | 对应类型专用字段 |
{
"graph_name": "demo",
"order": ["x"],
"levels": {...},
"results": {
"x": {
"status": "done", // done | rejected | error | skipped
"output": "...", // 节点输出
"error": null,
"iterations": 1,
"started_at": "...",
"ended_at": "..."
}
},
"final_state": {...},
"elapsed": 0.12,
"aborted": false,
"abort_reason": null
}
PUT /api/orchestration/cases/{id}(落盘 examples/{id}.yaml,闭环到 state_graph 执行)。建议经 http://localhost:8081/static/orchestration-canvas.html 同源打开。
ExecutionGraph 交 core/graph_executor 执行。state_graph 是唯一支持条件分流与循环回边的架构(agent_exec.rs)。切换架构查看拓扑差异。term_resolver.resolve_terms 全链路(Layer C > B > A,与线上路由期同一入口,通常 30~150s)。/api/solve-trace 的 pipeline 字段权威输出,与源码逐行对齐;前端与文档均消费同一份,避免双源漂移。/api/sandbox/trace?workspace=,是真实多步执行时由 SandboxStore 记录的持久化证据链(落盘于 workspaces/<ws>/.sandbox_trace.jsonl):每一步实际提交的参数格式(如 data.touserid 被包成 {"newvalue":"5"} 而非裸值)、以及 Sandbox 结构(产物节点 / 父子 / 引用标记)。与「⑤ 真实执行回填」的区别:这里是历史落盘,无需再跑一遍即可查;切换上方工作空间后点「刷新」。sdwesp_design「列出 → 新增 → 查找 → 移交」四步复合需求的完整复盘,含源码位置与真实执行日志。| 环节 | 源码落点 | 要点 |
|---|---|---|
| HTTP 入口 | server_handler_post.py:57 → server_handler_post_ops.py:831 | 只有流式端点 /api/workspace/<ws>/chat/stream,无 /chat |
| 8 阶段编排 | workspace_chat_flow.py:2371 / :829 | :840 写 session_context["workspace_name"],后续一切作用域依据 |
| 协调者 | workspace_chat_flow.py:77 | 无顶层 coordinator → 取 roles 池首项 = sdwesp_design_orchestrator |
| 成员宇宙 | workspace_scope.py:1031 | 5 个成员 → 不触发路由层单成员退化 |
| 术语解析 | term_resolver.py:1504 / :302 / :334 | triggers 是字面子串包含(k in message,按长度降序最长匹配),非打分非语义 |
| 拆句 | workspace_chat_flow.py:1751 | 连接词(然后/接着/随后…)+ 写动词(新增/删除/修改…)开新步,零 LLM |
| DAG 派生 | capability_dag.py:95 | 解开 {mode: sequence, steps:[…]};顺序与接线由契约 edges/bindings 派生,scope 只声明节点集 |
| DAG 执行 | capability_dag.py:1148 | 槽位回查 → 候选×原文回填 → 逐层执行 → recheck 读后校验 |
| 回退 | group_manager.py:1959 / :2019 | 群主是 supervisor → selected 强制置空 → _run_single_agent → 8085 |
| 工具出口 | adapters/base.rs:1215 / :222 | config.id=="sdwesp" → send_via_curl(reqwest 对 SDWESP gunicorn 恒 401) |
| 步 | 术语 | 工具链 | 关键参数 |
|---|---|---|---|
| 1 | data.list | publish_get_list → reply_get_list | GET /publish?ptype → GET /reply?publishid&pageid=0 |
| 2 | data.create | publish_get_list → pflowlist_get_list → flow_put_start | flowname=新建;data={"说明":{"newvalue":"多层次"}} |
| 3 | data.get | publish_get_list → pflowlist_get_list → flow_put_start | flowname=查找;data={"filtercond":{"说明":"多步验证3"}} |
| 4 | data.transfer | publish_get_list → reply_get_list → reply_get_action → flow_put_start | action=myflow 取 flowid(移交≈1866);replyid + receivers=[圣达维 userid] |
[WS_MULTI] 多意图拆分为 4 步:['列出【我要说】」模版下的数据','新增一条记录,内容是 (说明=多层次)','查找 说明=多步验证3 的记录','移交给圣达维'] [WS_DAG] data.list 确定性执行完成(369ms,零 LLM)publish_get_list → reply_get_list ✅ [WS_DAG] data.create 确定性执行完成(367ms,零 LLM)→ pflowlist_get_list → flow_put_start ✅ [WS_DAG] data.get 确定性执行完成(391ms,零 LLM)→ pflowlist_get_list → flow_put_start ✅ [WS_DAG] data.transfer 在 tool 阶段失败(D_INTERNAL: HTTP 404 (/flow))→ 回退 Agent 路径 ❌ [group_manager] owner sdwesp_design_orchestrator 是 supervisor 架构 → 单成员退化 [INFO] 子Agent 'form_designer' 10 / 'flow_designer' 37 / 'org_designer' 20 / 'sdwesp_developer' 143 个工具 [DEBUG architecture] type=supervisor, sub_count=4 [LoopController] 连续失败 3 次,冷静 300s
flow_put_start(PUT /flow)是成功的,所以 404 的根因不在路由本身,而在 replyid / flowid / receivers 三者之一;平台另提供 sdwesp_flow_post_start(POST /flow)可作对照验证。data.transfer 在 wire 阶段失败(D_WIRE_NO_MATCH: 槽位值 ['我要说','移交'] 未在上游「name」字段命中任何行)——「流程名」槽位被误抽成多值。| 调用 | 实测结果 |
|---|---|
sdwesp_publish_get_list | 模板「我要说」→ publishid=334 |
sdwesp_publish_users(publishid=334) | 18 条候选,「圣达维」别名 → userid=5 |
sdwesp_user_get_list(通用表) | 只有「真实姓名」,查无圣达维 |
[USER_REF] 失败留痕
+ 解析结果回写 session_context._resolved_user_ids 供执行期复用。any(tr in message for tr in triggers)。想让某句话稳定命中术语,就把原话里的词写进 triggers。模板名 / replyid 跨步继承。流程名、字段值、接收人是"动作-值级"槽位,继承会污染后续步骤(实测:查找步继承新增步的"流程名=新建",误用新建流程发起查找)。GET /publish/users?publishid= 的「别名」字段,
通用 /user 表是「真实姓名」——两者不同源,只查通用表会漏掉圣达维这类姓名。
按 docs/术语生成标准规范.md 的 7 字段契约生成。确定性字段(allow_tools/group/id/【】占位)自动保证正确;intent/label/triggers 属启发式,需人工润色后落库。