use old prompt

This commit is contained in:
duanfuxiang
2025-07-01 23:40:34 +08:00
parent b69f1e3865
commit 89bc10d16d
17 changed files with 195 additions and 331 deletions

View File

@@ -422,6 +422,14 @@ const Chat = forwardRef<ChatRef, ChatProps>((props, ref) => {
if (toolArgs.type === 'write_to_file') {
let newFile = false
if (!opFile) {
// 确保目录结构存在
const dir = path.dirname(toolArgs.filepath)
if (dir && dir !== '.' && dir !== '/') {
const dirExists = await app.vault.adapter.exists(dir)
if (!dirExists) {
await app.vault.adapter.mkdir(dir)
}
}
opFile = await app.vault.create(toolArgs.filepath, '')
newFile = true
}