fix(cli): never print a blank doctor failure message - #1058
Merged
Conversation
str() of a message-less exception (e.g. httpx.ReadTimeout or a bare RuntimeError) is empty, so both doctor failure handlers could print a blank "Doctor failed:" line with no diagnostic. Fall back to repr(e) whenever str(e) is empty so the failure line always names the error. Adds CLI regression tests covering the message-preserving case and the message-less fallback in both the expected-error and generic handlers. Refs #1027 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
phernandez
force-pushed
the
fix/1027-doctor-empty-error
branch
from
July 15, 2026 04:36
3a326a4 to
283ad65
Compare
Member
Author
|
@codex review recheck |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
14 tasks
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
Remnant of #1027: the main event-loop bug was fixed in #1018, but the
doctorcommand's failure handlers renderedf"Doctor failed: {e}"directly. For message-less exceptions (e.g.httpx.ReadTimeout, a bareRuntimeError),str(e)is empty, so users saw a blankDoctor failed:line with no diagnostic.Both handlers in
src/basic_memory/cli/commands/doctor.pynow fall back torepr(e)whenstr(e)is empty, so the failure line always names the error (the reporter explicitly asked for the repr). These two sites are the only exception renderings in the file; all other error paths raise with explicit messages.Tests
New
tests/cli/test_doctor_command.py(the doctor CLI previously had no test coverage —*/cli/**is omitted from unit coverage) exercises the real command path viaCliRunner, stubbing onlyrun_doctor:ValueError(expected-error handler) printsDoctor failed: ValueError()RuntimeError(generic handler) printsDoctor failed: RuntimeError()on stderrAll 3 pass;
ruff check/ruff formatclean on touched files;just typecheckexits 0 (only pre-existing Python 3.14 event-loop-policy deprecation warnings in unrelated files).Refs #1027
🤖 Generated with Claude Code