Skip to content

Remove the Diagnostics settings page and the dry-run Doctor server #248

Closed

Description

@GoDiao

Problem

Settings → Diagnostics adds little that users can't already get elsewhere:

  • Report a problem in the sidebar already collects the recent errors and exports the diagnostics bundle (desktop/src/components/layout/ReportProblemDialog.tsx).
  • Doctor already appears where it's needed, on the crash screen (desktop/src/components/ErrorBoundary.tsx) and on the startup error screen (desktop/src/components/layout/StartupErrorView.tsx). Its server half only does a dry run: DoctorService.repair in src/server/services/doctorService.ts returns dryRun: true, mutated: false and changes nothing.
  • The warning count on the page is mostly noise. Every API request that fails because the server isn't reachable (Failed to fetch) is recorded as a diagnostic event (reportApiFailure in desktop/src/api/client.ts). The scheduled task notification poller (desktop/src/hooks/useScheduledTaskDesktopNotifications.ts) produces two such events on every poll while the server is starting or restarting. In one local log, 546 of 588 events were these.

What to do

Remove

  1. The Diagnostics settings page: desktop/src/pages/DiagnosticsSettings.tsx, its tab in desktop/src/pages/Settings.tsx and 'diagnostics' in the settings tab type in desktop/src/stores/uiStore.ts.
  2. The /doctor slash command, which only opens that page (SETTINGS_SLASH_COMMANDS in desktop/src/components/chat/composerUtils.ts).
  3. The diagnostics endpoints only that page uses, on both sides:
    • server, src/server/api/diagnostics.ts: GET status, GET events, POST open-log-dir, DELETE /api/diagnostics;
    • service, src/server/services/diagnosticsService.ts: getStatus, openLogDir, clear and anything only they use;
    • client, desktop/src/api/diagnostics.ts: getStatus, getEvents, openLogDir, clear and their types.
  4. The Doctor server half: src/server/api/doctor.ts, src/server/services/doctorService.ts, the doctor case in src/server/router.ts, desktop/src/api/doctor.ts, and the server part of runDoctorRepair in desktop/src/lib/doctorRepair.ts. DoctorPanel then shows only the local result.
  5. i18n keys that no longer have a user, in both en.ts and zh.ts, and the tests for removed code.

Change

  1. Don't record a diagnostic event when an API request fails because the server can't be reached (Failed to fetch). Keep recording failures where the server answered with an error.

Keep

  • The diagnostics event log, buildProblemReport (src/server/services/problemReport.ts) and the export bundle with reveal-export: Report a problem uses them.
  • POST /api/diagnostics/events: clients still record real errors there.
  • The local Doctor repair (clearing a few localStorage keys) on the crash and startup error screens.
  • Unrelated things with similar names: /api/status/diagnostics (config directories for Settings) and the Computer Use doctor (/api/computer-use/doctor).

Done when

  • No Diagnostics tab in Settings, no /doctor command, no /api/doctor route, and no dead exports, types or i18n keys left behind.
  • Report a problem still shows recent errors and exports a bundle; the crash and startup error screens still offer Doctor.
  • A failed request with no server response is not recorded, and a request the server rejects still is, with a test for each.
  • The checks in AGENTS.md pass, and the CHANGELOG has an entry under [Unreleased] → Removed.

Comment here if you'd like to take it.

Activity

  1. iruzen-dono commented on Nov 13, 2026

    @iruzen-dono
    Contributor

    I'd like to take this one.

    Plan, matching the "What to do" order:

    1. Remove the Diagnostics settings page, its tab entry, the i18n keys that no longer have a user (both en.ts and zh.ts), and the tests for the removed code.
    2. Remove the /doctor command and the /api/doctor route, with DoctorService.repair's dry-run half — keeping the local repair the crash and startup error screens call.
    3. Stop recording a diagnostic event when a request fails because the server could not be reached, and keep recording the ones the server answered. A test for each side.
    4. CHANGELOG entry under [Unreleased] → Removed.

    I will start on Windows 11 with Bun 1.3.14. If anyone is already on it, say so and I'll pick another one instead.

  2. iruzen-dono commented on Nov 13, 2026

    @iruzen-dono
    Contributor

    Opened #250 for this: #250

    What it removes: the Diagnostics tab and its page, the /doctor command (both the CLI command and the composer one that opened the tab), /api/doctor with DoctorService, and 28 i18n keys from en.ts and zh.ts. What it keeps: the local Doctor repair on the crash and startup error screens, the diagnostics event log, buildProblemReport and the export bundle, plus /api/status/diagnostics.

    On the behaviour change: a request now goes unrecorded only when fetch itself rejects with a TypeError, i.e. the server was never reached. Timeouts are still recorded, because the server was reachable and slow and mcpDiagnostics.test.ts locks the redaction of MCP environment values on that path.

    bun run lint, bun run test -- --run and bun test all pass on the changed areas; the remaining red tests in this Windows checkout are red on main too (artifact symlinks, prepare-ripgrep, two ActiveSession context tests, LocalSlashCommandPanel, MessageList, UpdateChecker) and I listed them in the PR body with the comparison.

    CI on the PR is showing action_required, which is the fork approval gate rather than a failed job. Nothing else is pending on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions