Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: AI Agent https://github.com/siyuan-note/siyuan/issues/17797

Daniel1b3fce882ac1
diff --git a/kernel/mcp/tools/notebook.go b/kernel/mcp/tools/notebook.go
index e04f7ca141..48ed7a186b 100644
--- a/kernel/mcp/tools/notebook.go
+++ b/kernel/mcp/tools/notebook.go
@@ -133,11 +133,6 @@ func notebookOpen(args map[string]interface{}) (CallToolResult, error) {
return CallToolResult{Content: []ContentItem{{Type: "text", Text: "open notebook failed: " + err.Error()}}, IsError: true}, nil
}
- if model.IsUserGuide(id) {
- time.Sleep(7 * time.Second)
- sql.FlushQueue()
- }
-
if box := model.Conf.Box(id); nil != box {
evt := util.NewCmdResult("mount", 0, util.PushModeBroadcast)
evt.Data = map[string]any{
@@ -147,6 +142,9 @@ func notebookOpen(args map[string]interface{}) (CallToolResult, error) {
util.PushEvent(evt)
}
+ time.Sleep(1 * time.Second)
+ sql.FlushQueue()
+
return CallToolResult{Content: []ContentItem{{Type: "text", Text: "notebook opened: " + id}}}, nil
}
@@ -157,5 +155,9 @@ func notebookClose(args map[string]interface{}) (CallToolResult, error) {
}
model.Unmount(id)
+
+ time.Sleep(1 * time.Second)
+ sql.FlushQueue()
+
return CallToolResult{Content: []ContentItem{{Type: "text", Text: "notebook closed: " + id}}}, nil
}