OCR managed setup v2: direct Ollama installer download, OLLAMA_ORIGINS automation, LM Studio detect-and-guide (desktop) #28
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#26 OCR managed setup v1: "Set up local reading for me" (detect Ollama, pull model over HTTP with progress, fill settings, test)
daniel/obsidian-remarkable-round-trip
Reference
daniel/obsidian-remarkable-round-trip#28
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #8
Follow-up to v1 (#26, implemented by !27). v1 adds "Set up local reading for me": it detects Ollama over HTTP, pulls the model over
/api/pullwith progress, fills the settings and runs Test connection. When Ollama is missing it only links to ollama.com/download, and it only explainsOLLAMA_ORIGINSwhen Test connection returns the 403 hint.On #8, @daniel said: "calling ollama is acceptable, but direct download would be preferred, model download at runtime is also fine". This issue covers the part of that which v1 left out: taking the user from "no Ollama" to "working" with less manual effort.
Known
Platform.isDesktopApp.manifest.jsonisisDesktopOnly: false, so nothing may load Node modules on mobile.scripts/check-bundle.mjsfails the build on a bundledrequire("stream"|"fs"|"path"|"child_process"). Any Node use must go through the lazywindow.requirepattern that v1 introduces insrc/main.ts(the desktop NDJSON adapter). The guard list must not be weakened silently. Ifchild_processis truly needed, say so explicitly in the MR and get @daniel's sign-off.shell.openPath/shell.openExternal(viawindow.require("electron");electronis already external inesbuild.config.mjs) can launch a downloaded installer withoutchild_process.OLLAMA_ORIGINS=app://obsidian.mdhint is produced bymapStatus()insrc/transport/ocr.ts. The per-OS manual steps are indocs/ocr-endpoint-setup.mdstep 2.To decide and research (answer these, then split into MR hand-offs)
shell.openPath? The candidates are:Ollama.dmg(or the zip) from ollama.com/download;OllamaSetup.exe;install.shscript, which needs sudo, so it is probably guide-only, showing the copyablecurl -fsSL https://ollama.com/install.sh | sh.OLLAMA_ORIGINS.obsidianHttpusesrequestUrl; does that sendOrigin: app://obsidian.mdto Ollama, or does the 403 only hitfetch? If it is not needed, simplify the docs instead.launchctl setenv/setx/ a systemd drop-in, which needs root). The latter requireschild_process; see the guard note above. Recommend (a) unless (b) is clearly better.http://localhost:1234/v1/models. If it is up, offer to point the endpoint at it and show which vision model to load. There is no automated pull.Scope boundary
Does not change v1's pull/progress flow except to reuse it. Does not touch #4 or #5.
claude referenced this issue2026-10-20 19:02:19 +02:00
claude referenced this issue2026-10-20 19:02:19 +02:00
✅ Agent run completed
10s · 4 turns · $2.65 · session saved — new comments resume this run
claude referenced this issue2026-10-20 19:57:30 +02:00
claude referenced this issue2026-10-20 19:57:30 +02:00
claude referenced this issue2026-10-20 20:06:44 +02:00
claude referenced this issue2026-10-20 20:06:45 +02:00
What I found
OLLAMA_ORIGINSis not needed, verified by testing.requestUrlis an IPC call to main-processelectron.net.request(read from 1.14.4'sobsidian.asar). Electron 43net.requestsends noOriginheader on GET or POST.app://*by default since v0.1.42 (June 2024,1a29e9a8). A real Ollama 0.40.4 with noOLLAMA_ORIGINSanswers 200 forOrigin: app://obsidian.mdand 403 forhttps://evil.example(the control).child_processisn't needed.child_process:Ollama.dmg(214 MB) andOllamaSetup.exe(1.58 GB) are on GitHub releases. Each asset has a published SHA-256 (digestin the releases API, plussha256sum.txt)..exeis EV-signed by "Ollama Inc." (DigiCert). The macOS build is codesigned and notarised.window.requireNode, verify the checksum, thenshell.openPath, wait for Ollama, and continue into v1's flow. Linux gets only a copyablecurl -fsSL https://ollama.com/install.sh | sh, since the script needs sudo. Any failure falls back to v1's link.GET /api/v1/models(0.4+) reportscapabilities.visionandloaded_instances. On older versions,/api/v0/models(type: "vlm") and then/v1/modelswork as fallbacks. So when Ollama isn't running, setup can offer LM Studio's downloaded vision models. It downloads none.Created
OLLAMA_ORIGINSnot needed, 403 hint reworded (Part of #28)Follow-ups
src/ollamasetup.ts, so whichever merges second will need a small merge.openPathpath in !33 can't run in CI and needs a manual try on macOS and Windows.POST /api/v1/models/downloadto pull a vision model automatically. It's deliberately out of scope here.claude referenced this issue2026-10-20 20:11:49 +02:00
claude referenced this issue2026-10-20 20:11:49 +02:00
claude referenced this issue2026-10-20 20:12:43 +02:00
claude referenced this issue2026-10-20 20:22:55 +02:00
claude referenced this issue2026-10-21 06:38:39 +02:00
claude referenced this issue2026-10-21 06:38:51 +02:00