Skip to content

fix(desktop): make Check all match checking each harness on its own #3448

Closed

Description

@LHagfoss

Problem

In Settings > Harnesses, Check all marks every harness as failing. Pressing Check on each card one at a time mostly reports Ready.

runAllHarnessChecks (apps/desktop/src/state/harnessChecks.ts:73) starts every check at once with Promise.all. Each check then:

  1. calls checkHarnessAccounts(true, [id], false) → _rustcode/harnesses/account/check with redetect: [id], and each of those also fires refreshPlanCache(true) (a Keychain read for Claude);
  2. then calls fetchHarnessModels(id, true), which starts the harness process to list its models (60 s timeout), followed by refreshHarnesses().

So N harness processes, N redetects, N login-shell/Keychain reads and N full snapshot refreshes all run concurrently. Likely failure modes:

  • Each answer replaces the whole harnesses snapshot. A stale snapshot that arrives late (from an earlier request, holding another harness's cached detection) overwrites a fresh one, and currentResult then marks a Ready card as Not installed or Needs sign-in.
  • Concurrent harness starts and probes hit timeouts (the shell probe has a 3 s limit, see the Homebrew PATH issue) that a single check never hits.
  • N parallel Keychain reads raise prompts or get denied.

Proposal

  • Run Check all with limited concurrency (2 at a time) or one after another. Show progress ("Checking 2 of 5…").
  • Do one account/check with redetect set to all ids and one plan read up front, then list models per harness.
  • Apply a snapshot only if it is newer than the one held (a request sequence number in harnessCall).
  • Show each failure's real error text on the card, not a generic failed state.

Acceptance criteria

  • In the mock and in a unit test with delayed, out-of-order responses, Check all ends in the same per-card results as checking each card alone.
  • Only one Keychain/plan read per Check all.
  • bun run check and harnessChecks.test.ts cover the ordering.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions