which then gets rendered as just new-page. Edit: if it’s an existing node, the square-bracketed link that gets auto-created uses the existing node id like this: [[id:22b620d9-0480-4e89-a799-5b41324ec51b][my-existing-node]].
Other times, it leaves it unmolested as roam:new-page without the square brackets.
What’s going on there?
Edit: I should say I have org-roam-completion-everywhere set to nil. Also it seems that simply typing roam:somepage already gives me a link, and when I follow the link I get navigated to that page and the conversion to a square brackets link happens then. But sometimes after a period of time, the link has turned into a square-bracketed link without me doing anything obvious to make that happen – I don’t know how to reproduce that.
org-roam-link-auto-replace is a customizing variable, so you can set it as you prefer; the default is t.
Also look at before-save-hook in a buffer visiting an Org-roam file. By default, you should see (org-roam-link-replace-all t) set. The same customizing variable org-roam-link-auto-replace is used here, too.
This is probably because you have some auto save feature turned on – e.g. auto-save-visited-mode, which auto-saves an unsaved buffer after a specific interval. It’s probably you have left a buffer unsaved, moved to some other one, timer kicks in to save the first buffer, and then before-save-hook kicks in to covert the roam: link to a bracket Org-ID one.
That’s most likely because the link target does not exist yet, thus no ID and no Org ID link to convert to.