-
Notifications
You must be signed in to change notification settings - Fork 1
fix(doctor): stop printing the embed install hint twice (v8.1.1) #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -778,12 +778,17 @@ def _diagnose_search_index(config: SetupConfig) -> list[CheckResult]: | |
| # green tick for "your recall is materially worse than it could be" is | ||
| # the same failure mode as an index that silently stopped updating: the | ||
| # honest signal existed and did not read as a problem. | ||
| # `reason` from embed.status() already carries the install command for | ||
| # the common cause (model2vec missing), so appending it unconditionally | ||
| # printed it twice — verified on a real Windows install. | ||
| reason = str(semantic["reason"]) | ||
| cost = "worth ~20pp of recall@1 on a real vault" | ||
| hint = "" if "omind[embed]" in reason else "; pip install 'omind[embed]'" | ||
| results.append( | ||
| CheckResult( | ||
| "search_semantic", | ||
| "warn", | ||
| f"semantic search: off (keyword path) — {semantic['reason']}; " | ||
| "install the extra for ~20pp better recall: pip install 'omind[embed]'", | ||
| f"semantic search: off (keyword path) — {reason}{hint} ({cost})", | ||
|
Comment on lines
+784
to
+791
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Lead with the recall impact required by the PR objective. The warning places 🤖 Prompt for AI Agents |
||
| ) | ||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -300,4 +300,8 @@ def test_doctor_warns_when_semantic_search_is_off( | |
| config = SetupConfig(vault=tmp_path, folder="OMI") | ||
| checks = {c.key: c for c in cli._diagnose_search_index(config)} | ||
| assert checks["search_semantic"].level == "warn" | ||
| assert "omind[embed]" in checks["search_semantic"].message | ||
| message = checks["search_semantic"].message | ||
| assert "omind[embed]" in message | ||
| # The reason already carries the install command; saying it twice is what a | ||
| # real Windows install actually printed. | ||
| assert message.count("omind[embed]") == 1 | ||
|
Comment on lines
+303
to
+307
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Exercise the de-duplication branch. The mocked 🤖 Prompt for AI Agents |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add a blank line after the
### Fixedheading.markdownlint-cli2reports MD022 because the heading is not followed by a blank line.Proposed fix
### Fixed + - `omind doctor` printed the `pip install 'omind[embed]'` hint **twice** in the📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)
[warning] 10-10: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🤖 Prompt for AI Agents
Source: Linters/SAST tools