Fix obsidian shell-out to use obsidian-cli instead of obsidian - #1474
Open
ramansrivastava wants to merge 1 commit into
Open
Fix obsidian shell-out to use obsidian-cli instead of obsidian#1474ramansrivastava wants to merge 1 commit into
ramansrivastava wants to merge 1 commit into
Conversation
The obsidian real desktop app binary is also named `obsidian` on systems where it's installed, so _obsidian_create()/_obsidian_search() were launching the GUI app instead of obsidian-cli, waiting out the 10s timeout, then force-killing it. Repeated SIGKILLs can also leave a stale Electron SingletonLock behind. Fixes akashgit#1460 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017LiyU9TiqgNaGVu3gWaqE4
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1474 +/- ##
==========================================
+ Coverage 82.79% 82.81% +0.01%
==========================================
Files 225 225
Lines 24994 24994
Branches 4021 4021
==========================================
+ Hits 20694 20698 +4
+ Misses 3342 3341 -1
+ Partials 958 955 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_obsidian_create()and_obsidian_search()infactory/obsidian/notes.pyinvoked a binary namedobsidian, but the actualobsidian-clibinary is namedobsidian-cli. On systems with the real Obsidian desktop app installed (also namedobsidian), this launched the GUI app instead, waited out the 10s subprocess timeout, then force-killed it — causing visible window flicker and potential staleSingletonLockfiles.obsidian-cli. If it's not installed,subprocess.runraisesFileNotFoundError, which is already caught and falls back to the existing direct file-write path.tests/test_obsidian.py::test_write_experiment_tries_cli_first, which had hardcoded the incorrect"obsidian"binary name in its mock/assertion.Fixes #1460
Test plan
pytest tests/test_obsidian.py -v— 25 passedruff check factory/obsidian/notes.py tests/test_obsidian.py— cleanmypy factory/obsidian/notes.py— clean🤖 Generated with Claude Code
https://claude.ai/code/session_017LiyU9TiqgNaGVu3gWaqE4