Skip to content

fix(doctor): stop the plugin check from holding back later checks - #889

Merged
runkids merged 2 commits into
mainfrom
runkids/doctor-pending-plugins
Nov 13, 2026
Merged

runkids merged 2 commits into
mainfrom
runkids/doctor-pending-plugins

Conversation

@runkids

@runkids runkids commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

Follow-up to #870 (Doctor page streams checks as they finish). No separate issue.

What changed

  • The plugin check no longer holds back the checks after it. When doctor streams (_SKILLSHARE_DOCTOR_STREAM=1, used by /api/doctor/stream), the plugin check runs in the background through a new doctorResult.later. It streams a pending row in its place right away, backups, trash and the version checks stream as soon as they finish, and the plugin result follows. The full result keeps the check between hooks and backups. Text output and plain --json run it inline with a spinner, as before.
  • The skill scan and Git status show as running too. A streamed doctor sends a pending source row before it scans the skill source, and runs the Git check in the background the same way, so the checks after it do not wait. A finished background check is recorded at the next check, not at the end, so its row does not stay pending after its result is known. The pending row holds the check's place in the result until then.
  • The dashboard says which check is still running. A pending row shows the check's name with a spinner and "Checking" (the existing update.check.checking key, translated in all locales). The result replaces it in place (withStreamedCheck). It stays visible under every filter, and the unlabeled skeleton row is hidden while it shows.
  • Docs: the /api/doctor/stream row in ui.md and its four translations describe the pending row.

Why

The plugin check asks each Agent's native CLI what is installed and can take many seconds. Checks ran in order, so the page stopped at an unlabeled skeleton row after Hooks and showed nothing below it until plugins finished.

Verification

  • make check in the devcontainer passed: Go unit and integration tests, and the Herdr node tests.
  • go test -race ./cmd/skillshare/ passed.
  • UI: vitest for src/lib/doctorUpdates.test.ts, plus tsc -b and eslint on the changed files, were clean.
  • python3 scripts/ai-context.py check passed.
  • New tests:
    • TestDoctorLaterStreamsPendingAndKeepsItsPlace: a check added while the plugin check is still blocked streams before its result, and the result keeps its slot.
    • TestDoctor_JSON_StreamDefersPluginCheck: the CLI path with a plugin package configured.
    • withStreamedCheck vitest: a pending row is replaced in place.
  • TestDoctorLaterRecordsAFinishedCheckAtTheNextCheck: a finished background check streams right after the next check.
  • go test -race on the doctor tests, repeated 10 times.
  • E2E with a fake git that sleeps 3 s per call, running the built binary directly: source pending at 14 ms, every other check by 35 ms, and the Git result at 3 s.
  • E2E in an ssenv with a fake claude CLI that sleeps 2 s per call (first commit): plugins pending at 987 ms, then backup, trash and both versions by 989 ms, and the plugin result at 15 s. The final JSON order was hooks, plugins, backup.
  • Screenshots of the Doctor page with a scripted stream, both while pending and after the result arrived.

Not run: the full UI test suite, the website build, Windows, E2E runbooks. The new tests were not run against the old code first.

Not covered

  • A finished background check is recorded when the next check is added. If the next check is itself slow, the finished row stays pending until that check ends. Recording it sooner would need the background goroutine to write the stream under a lock.
  • Text mode now shows a spinner while Git runs, as it does for plugins.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

The dashboard's Doctor page streams checks as doctor finds them, but the
plugin check asks each Agent's native CLI what is installed and can take
many seconds. Checks run in order, so backups, trash and the version
checks waited behind it while the page showed only an unlabeled skeleton
row, with nothing saying which check was still running.

When doctor streams, the plugin check now runs in the background. It is
streamed first as a "pending" row in its place, the checks after it
stream as soon as they finish, and its result follows. The full result
keeps the check in its original place. Text output and plain --json run
it inline as before.

The dashboard shows a pending row as the check's name with a spinner and
"Checking", replaces it in place when the result arrives, keeps it
visible under every filter, and drops the unlabeled skeleton while it is
shown. The /api/doctor/stream reference documents the pending row.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T17:44:17.216784Z 83334ba Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Doctor scans the skill source before it streams its first check, and
runs git status on the source inline. On a large source either can take
seconds, and the dashboard showed only an unlabeled skeleton meanwhile.

A streamed doctor now sends a pending "source" row before the scan, and
runs the Git check in the background like the plugin check, so the
checks after it no longer wait. A finished background check is recorded
at the next check instead of at the end, so its row does not stay
pending after its result is known. The pending row now holds the
check's place in the result while it runs.
@runkids

runkids commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 83334bab83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@runkids
runkids merged commit fab72f7 into main Nov 13, 2026
9 checks passed
@runkids
runkids deleted the runkids/doctor-pending-plugins branch November 15, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant