logancyang / obsidian-copilot

THE Copilot in Obsidian
GNU Affero General Public License v3.0
2.63k stars 186 forks source link

Nested folder for 'Conversation Folder Name' and ' Prompts Folder Name' does not work #628

Open wxfan opened 1 week ago

wxfan commented 1 week ago

Describe how to reproduce For the 'Conversation Folder Name' and ' Prompts Folder Name' properites, I don't use the default value. Instead, I chang them to 'MyPlugins\Copilot\conversations' and "MyPlugins\Copilot\prompts" , as a result, it doesn't work as expected.

  1. The Conversation can be saved successfully at the first time, then it will show the error "Folder has been existed".
  2. For the prompts, i can add prompt, but cannot edit or apply prompt, there is no value in the dialog.

Expected behavior I hope i can change the Path of Conversation and prompts folder.

Screenshots Add screenshots to help explain your problem. Please turn on debug mode in Copilot settings, turn off other plugins to leave only Copilot dev messages as necessary.

Additional context Add any other context about the problem here.

logancyang commented 1 week ago

i tested random custom folder names and they are working for me. Do you have more info?

Also, please follow the instruction and share screenshot of dev console at the very least. A recording of how you reproduce the error is even better.

wxfan commented 1 week ago

@logancyang Thanks for your reply. I added some screenshot on my issue.

logancyang commented 1 week ago

I was able to reproduce this on windows but not on mac. Seems like Obsidian API has a bug for windows folder check.

In the meantime, could you try using a top level folder without nesting and see if it works correctly? I'll see what I should do about this.

If any mac user sees this error please report too.

wxfan commented 1 week ago

@logancyang yes,it works correctly for using top level folder.

upnix commented 1 week ago

Apologies if this is not the same bug, but I too ran into problems when trying to change the conversation folder (to /Copilot/conversations) The first chat I have will create the folder and save the conversation, but subsequent chats will give this error in the developer console: image

Additionally, I can't load the one saved Copilot conversation I do have. I get the alert "No chat history found" with no output in the dev console.

This is on Linux, using the Flatpak version of Obsidian 1.6.7. Copilot 2.6.5

logancyang commented 1 week ago

@upnix thanks for reporting. Interesting, the culprit seems to be the folder check for nested folders that uses Obsidian API

const folder = app.vault.getAbstractFileByPath(defaultSaveFolder);
  if (!folder) {
    await app.vault.createFolder(defaultSaveFolder);
  }

And it's only happening on OS other than Mac. This is my current observation. Will take a deeper look.