refactor(doctor/status): unify daemon health checks#872
Closed
refactor(doctor/status): unify daemon health checks#872
Conversation
…r classification, streamline cascade/interceptor, clean up synthesize 1. Remove root-level shim files (errors.ts, logger.ts, registry.ts, types.ts, utils.ts, launcher.ts) — update all ~840 adapter imports to reference src/ directly 2. Consolidate interceptor: reuse shared DISGUISE_FN in tap interceptor instead of reimplementing 3. Unify error classification: single ClassifiedError type with icon/exitCode/hint lookup table, eliminating duplicated pattern matching between resolveExitCode and renderError 4. Simplify cascade probe: replace repetitive switch cases with PROBE_OPTIONS lookup map 12. Clean up synthesize.ts: remove deprecated snake_case field aliases (recommended_args, recommended_columns, recommendedColumnsLegacy) and unnecessary constant aliases Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update all documentation and skill files to reference src/ directly, matching the shim removal in the previous commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix imports in newly added deep-research adapter files that were still referencing the deleted root shim files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests now expect /search_result/<id> for bare note IDs (matching the note-helpers.ts change from PR #774) and updated empty-shell hint assertion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix imports in newly merged LessWrong and hupu/mentions adapter files that were still referencing the deleted root shim files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ode paths - Add getDaemonHealth() as single entry point for daemon status checks returning a discriminated union: 'stopped' | 'no-extension' | 'ready' - Delete browser/discover.ts (was a thin wrapper adding no value) - Remove isExtensionConnected() (replaced by getDaemonHealth) - Simplify doctor.ts: remove self-managed auto-start and double status check — bridge.connect() already handles auto-start, so doctor now does 1 live test + 1 health check instead of 2 checks + 1 bridge + 1 live + 1 check - Update bridge.ts to throw typed BrowserConnectError (via formatBrowserConnectError) instead of plain Error, enabling precise catch without string matching - Extract _pollUntilReady() in bridge.ts to deduplicate polling loops - Simplify commanderAdapter.ts renderError(): use err.kind directly instead of making a separate real-time status check that could race/fail - Update execution.ts fail-fast to use getDaemonHealth() with typed error kind - Update all affected tests (doctor, daemon-client, browser bridge)
5 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
getDaemonHealth()as single entry point for daemon status checks, returning discriminated union:'stopped' | 'no-extension' | 'ready'browser/discover.ts(pure wrapper layer with no value)isExtensionConnected()(subsumed bygetDaemonHealth)doctor.ts: remove double status check and self-managed auto-start — bridge.connect() already handles auto-startbridge.tsto throw typedBrowserConnectErrorinstead of plainErrorcommanderAdapter.tsrenderError(): useerr.kinddirectly instead of making a separate real-time status check that could race/failexecution.tsfail-fast to usegetDaemonHealth()with typed error kindAddresses: 5 fragmented status-check paths → 1 unified entry point. Net deletion of code.
Test plan
opencli doctorshows correct daemon/extension statusopencli daemon statusstill works