-
+
@@ -145,6 +253,7 @@ export function StudioView({
onConnect={onConnect}
onNodeClick={(_, n) => setSelId(n.id)}
onPaneClick={() => setSelId(null)}
+ deleteKeyCode={["Backspace", "Delete"]}
fitView
>
@@ -165,7 +274,7 @@ export function StudioView({
{/* 右检查器 */}
-
+
);
diff --git a/sundynix-dispatcher/internal/eino/compile.go b/sundynix-dispatcher/internal/eino/compile.go
index 289f314..01ea957 100644
--- a/sundynix-dispatcher/internal/eino/compile.go
+++ b/sundynix-dispatcher/internal/eino/compile.go
@@ -69,7 +69,8 @@ func (o *Orchestrator) compileFlow(ctx context.Context, t *contract.Task, tr *ex
}
key := fmt.Sprintf("tool_%d", idx)
idx++
- if err := g.AddLambdaNode(key, compose.InvokableLambda(o.makeToolNode(t.ID, tool, args, tr))); err != nil {
+ uid, _ := t.Meta[contract.MetaUserID].(string)
+ if err := g.AddLambdaNode(key, compose.InvokableLambda(o.makeToolNode(t.ID, tool, args, tr, uid))); err != nil {
return nil, err
}
if err := g.AddEdge(prev, key); err != nil {
@@ -111,7 +112,8 @@ func (o *Orchestrator) compileFlow(ctx context.Context, t *contract.Task, tr *ex
}
// makeToolNode 返回一个真实调用 MCP 工具的图节点:把结果增补进黑板,失败降级不阻断。
-func (o *Orchestrator) makeToolNode(taskID, tool string, args map[string]any, tr *execTracer) func(context.Context, *RunCtx) (*RunCtx, error) {
+// uid 非空时把检索类工具的 kb 锁进 owner 作用域("uid/kb"),使编排检索命中本人知识库。
+func (o *Orchestrator) makeToolNode(taskID, tool string, args map[string]any, tr *execTracer, uid string) func(context.Context, *RunCtx) (*RunCtx, error) {
node := "tool:" + tool
return func(ctx context.Context, rc *RunCtx) (*RunCtx, error) {
if o.tools == nil {
@@ -126,6 +128,12 @@ func (o *Orchestrator) makeToolNode(taskID, tool string, args map[string]any, tr
if call["q"] == nil && call["query"] == nil {
call["q"] = rc.Query
}
+ // 检索类工具的 kb 按 owner 作用域,对齐知识库隔离(前端只发库名)。
+ if uid != "" {
+ if kbv, ok := call["kb"].(string); ok && kbv != "" && !strings.Contains(kbv, "/") {
+ call["kb"] = uid + "/" + kbv
+ }
+ }
end := tr.span(node, "tool", "调用工具 "+tool)
cctx, cancel := context.WithTimeout(ctx, toolCallTimeout)
defer cancel()