refactor(doctor/status): unify daemon health checks#873
Merged
Conversation
…lth() - Add getDaemonHealth() returning 'stopped' | 'no-extension' | 'ready' - Delete discover.ts (thin wrapper with no value) - Bridge uses getDaemonHealth() + _pollUntilReady() (eliminates duplicate polling) - Doctor simplified: live check auto-starts daemon; no-live mode does minimal auto-start only when stopped (avoids misreporting idle-exit as failure) - CommanderAdapter preserves error message/hint detail (not just generic title) - All callers use single unified status entry point
Merged
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
getDaemonHealth()returning'stopped' | 'no-extension' | 'ready'as the single entry point for all daemon status queriesdiscover.ts(thin wrapper layer with no value)getDaemonHealth()+_pollUntilReady()— eliminates duplicate polling loops andisExtensionConnected()calls--no-livemode does minimal auto-start only when stopped (avoids misreporting idle-exit as failure)err.messageanderr.hintdetail (prevents swallowing actionable info like port numbers and manual start commands)isDaemonRunning(),isExtensionConnected(),checkDaemonStatus()— all replaced bygetDaemonHealth()Net: -6 lines, 5 status check paths → 1.
Supersedes #872 (closed without merge). Incorporates the two review fixes from @mbp-codex-pr1:
--no-liveidle-exit false negativeTest plan
npx tsc --noEmit— zero type errorsnpx vitest run— 1491 pass, 1 skip, 1 flaky e2e (pre-existing StackOverflow)opencli doctorwith daemon runningopencli doctor --no-livewith daemon idle-exited