Skip to content

fix(doctor): separate platform-incompatible skills from missing requirements - #89260

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
Alix-007:fix/89232-doctor-platform-skills
Jun 15, 2026
Merged

vincentkoc merged 3 commits into
openclaw:mainfrom
Alix-007:fix/89232-doctor-platform-skills

Conversation

@Alix-007

@Alix-007 Alix-007 commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #89232

Summary

openclaw doctor reported skills with a declared OS requirement that doesn't match the current platform (e.g. macOS-only apple-notes, imsg, homebrew on Linux/Windows) under the same "Missing requirements" count as genuinely-broken installs, and doctor --fix would prompt to disable them. Those skills aren't broken — they're inapplicable by design on this OS — and the noise hides real issues.

This derives a platformIncompatible flag from the shared requirement evaluator's missing.os (which already accounts for remote macOS node eligibility, not just local process.platform) and updates doctor so platform-mismatched skills are:

  • excluded from the "Missing requirements" count and surfaced as a single Incompatible (platform mismatch, auto-skipped): N line;

  • excluded from doctor --fix's disable target, so it no longer prompts to disable inapplicable-but-not-broken skills.

  • src/skills/discovery/status.ts — expose platformIncompatible from the shared evaluator's missing.os (incl. remote macOS eligibility)

  • src/commands/doctor-workspace-status.ts — drop platform-incompatible from "Missing requirements", add single rollup line

  • src/commands/doctor-skills-core.ts — exclude platform-incompatible from collectUnavailableAgentSkills (the doctor --fix disable target)

Real behavior proof

Behavior addressed: A skill whose declared OS requirement excludes this host (and that no remote node can satisfy) is no longer counted as a "missing requirement" nor offered for disable by doctor --fix; it is reported once under an "Incompatible (platform mismatch)" rollup, so genuinely-broken installs stay visible. Skills satisfiable via a remote macOS node are not flagged, because the flag follows the shared evaluator's missing.os.

Real environment tested: Linux x86_64, Node.js v22, HEAD 455ff07c7bde7b4512055682ba468a03048f2535 based on origin/main 489efc8f5eb15066f007f820ea71398357ad08e8. Production functions buildWorkspaceSkillStatus and collectUnavailableAgentSkills driven directly via node --import tsx, plus the Vitest suites.

Exact steps or command run after this patch:

node --import tsx -e 'Promise.all([import("./src/skills/discovery/status.ts"), import("./src/skills/test-support/test-helpers.ts"), import("./src/commands/doctor-skills-core.ts")]).then(([m,h,d])=>{
  const mk=(n,meta)=>({skill:h.createCanonicalFixtureSkill({name:n,description:"t",filePath:"/tmp/"+n,baseDir:"/tmp",source:"test"}),frontmatter:{},metadata:meta});
  const r=m.buildWorkspaceSkillStatus("/tmp/ws",{entries:[mk("mac-only",{os:["darwin"],requires:{}}),mk("portable",{})]});
  for(const s of r.skills) console.log(s.skillKey,"platformIncompatible="+s.platformIncompatible);
  console.log("collectUnavailable:",JSON.stringify(d.collectUnavailableAgentSkills(r).map(s=>s.skillKey)));
  console.log("Missing:",r.skills.filter(s=>!s.eligible&&!s.disabled&&!s.blockedByAllowlist&&!s.platformIncompatible).length);
})'

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run \
  src/skills/discovery/status.test.ts \
  src/commands/doctor-workspace-status.test.ts \
  src/commands/doctor-skills.test.ts --reporter=dot

Evidence after fix:

platform: linux
  mac-only  platformIncompatible=true   (via missing.os)
  portable  platformIncompatible=false  (via missing.os)
collectUnavailable (doctor --fix disable target): []   <- mac-only excluded
Missing requirements: 0

status.test.ts: 12 passed | doctor-workspace-status.test.ts: 6 passed | doctor-skills.test.ts: 9 passed

Observed result after fix: The macOS-only skill on Linux resolves to platformIncompatible=true (via the shared evaluator's missing.os), drops out of both the doctor "Missing requirements" count (1 → 0) and the doctor --fix disable target (collectUnavailableAgentSkills → []), and appears once under the "Incompatible (platform mismatch)" rollup. A portable skill stays false. tsgo:core passes.

What was not tested: A live full openclaw doctor / doctor --fix run on Windows with the real ClawHub bundle (the reporter's environment), and an actual reachable remote macOS node; the platform-mismatch + remote-eligibility branch is exercised on Linux against macOS-only skills via the production status builder, the doctor disable collector, and the unit suites — the same code path.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 2, 2026
@clawsweeper

clawsweeper Bot commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 6:20 AM ET / 10:20 UTC.

Summary
The branch adds a platformIncompatible skill-status flag, excludes those skills from doctor missing-requirement and disable targets, and adds focused regression coverage for the doctor status rollup.

PR surface: Source +26, Tests +82. Total +108 across 8 files.

Reproducibility: yes. Source inspection shows unsupported OS requirements populate missing.os, make the skill ineligible, and current doctor code counts and repairs those entries as ordinary unavailable skills; I did not run the Windows bundle scenario live.

Review metrics: 1 noteworthy metric.

  • Skill status surface: 1 added field. SkillStatusEntry is consumed by doctor, CLI, gateway, and UI-adjacent code, so the additive field needs type and fixture coverage before merge.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-skills.test.ts, migration/backfill/repair: src/commands/doctor-workspace-status.test.ts, migration/backfill/repair: src/flows/doctor-core-checks.test.ts, unknown-data-model-change: src/commands/doctor-skills.test.ts, unknown-data-model-change: src/commands/doctor-workspace-status.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] The PR proof does not include a live Windows openclaw doctor / doctor --fix run with the real ClawHub bundle or a reachable remote macOS node; confidence comes from source inspection, Linux production-function output, focused tests, and CI.

Maintainer options:

  1. Decide the mitigation before merge
    Land this doctor-side classification fix after normal maintainer and CI review; broader openclaw skills check or UI presentation consistency can remain a separate follow-up if maintainers want it.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair lane is needed; this PR is already the focused implementation candidate and has no actionable review finding.

Security
Cleared: The diff touches TypeScript doctor/skills logic and tests only; it does not change dependencies, workflows, lockfiles, package scripts, secrets handling, or supply-chain surfaces.

Review details

Best possible solution:

Land this doctor-side classification fix after normal maintainer and CI review; broader openclaw skills check or UI presentation consistency can remain a separate follow-up if maintainers want it.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows unsupported OS requirements populate missing.os, make the skill ineligible, and current doctor code counts and repairs those entries as ordinary unavailable skills; I did not run the Windows bundle scenario live.

Is this the best way to solve the issue?

Yes. Deriving platformIncompatible from the shared evaluator's missing.os is the narrowest maintainable fix because it preserves remote-platform eligibility and updates both the doctor summary and doctor --fix target.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0314819f918a.

Label changes

Label justifications:

  • P2: This is a bounded CLI doctor bug fix that reduces noisy diagnostics and avoids unnecessary skill-disable prompts with limited blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output from production functions plus focused Vitest/typecheck validation, with Windows and remote-macOS proof gaps disclosed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from production functions plus focused Vitest/typecheck validation, with Windows and remote-macOS proof gaps disclosed.
Evidence reviewed

PR surface:

Source +26, Tests +82. Total +108 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 3 30 4 +26
Tests 5 82 0 +82
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 112 4 +108

What I checked:

  • Repository policy read: Root AGENTS.md was read fully and applied; no scoped AGENTS.md owns the touched src/commands, src/skills, src/cli, or src/flows paths, and the only maintainer note found was Telegram-specific. (AGENTS.md:1, 0314819f918a)
  • Current main status shape lacks the split: SkillStatusEntry on current main exposes eligibility and missing requirements but has no platform-incompatible classification, so downstream doctor code cannot distinguish OS mismatches from real missing tools/config. (src/skills/discovery/status.ts:47, 0314819f918a)
  • Current main doctor summary over-counts: Current main counts every enabled, non-allowlist-blocked ineligible skill as Missing requirements, with no OS-mismatch exclusion or separate rollup. (src/commands/doctor-workspace-status.ts:97, 0314819f918a)
  • Current main doctor repair target includes OS mismatches: collectUnavailableAgentSkills on current main returns any enabled, allowed, agent-visible ineligible skill, so doctor --fix can target platform-incompatible skills for disable. (src/commands/doctor-skills-core.ts:6, 0314819f918a)
  • Shared evaluator is the right contract: resolveMissingOs already evaluates local and remote platforms, so deriving the new flag from missing.os avoids duplicating a local-only platform check. (src/shared/requirements.ts:76, 0314819f918a)
  • Sibling onboarding already separates unsupported OS: The onboarding skills flow already separates missing.os entries into Unsupported on this OS and excludes them from missing requirements, supporting the same invariant for doctor. (src/commands/onboard-skills.ts:62, 0314819f918a)

Likely related people:

  • kevinslin: Recent main history and blame place the current skills status, shared requirements, and doctor status surfaces in the large auto plugin approvals refactor that now owns these files' current shape. (role: recent area contributor; confidence: high; commits: e82d19fb06b5; files: src/skills/discovery/status.ts, src/shared/requirements.ts, src/commands/doctor-workspace-status.ts)
  • steipete: History shows the shared requirement evaluator and OS requirement behavior came from the central requirements evaluation refactor, which this PR relies on for remote-aware missing.os. (role: shared requirements contributor; confidence: high; commits: 4f61a3f52735, bc0160d0f2e0, 268094938b69; files: src/shared/requirements.ts, src/commands/onboard-skills.ts)
  • brokemac79: Recent history on doctor-workspace-status.ts added adjacent doctor status reporting in the same summary surface this PR updates. (role: recent doctor status contributor; confidence: medium; commits: 72e40833bac7; files: src/commands/doctor-workspace-status.ts)
  • byungskers: The PR discussion requested focused coverage for the new doctor rollup string and zero-count omission, and the current head adds that coverage. (role: reviewer; confidence: medium; files: src/commands/doctor-workspace-status.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@byungskers

Copy link
Copy Markdown

Nice cleanup. One small thing I'd still like to lock down: could we add a focused doctor-workspace-status assertion for the new rollup string (including the “only show it when count > 0” behavior)?

Right now the data-path test covers platformIncompatible, but the user-facing summary formatting feels like the part most likely to regress later.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 2, 2026
@Alix-007
Alix-007 force-pushed the fix/89232-doctor-platform-skills branch from ab5b84a to 27920b3 Compare June 2, 2026 01:09
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 2, 2026
@Alix-007

Alix-007 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed both rank-up moves:

  • [P1] agree with the shared evaluator (incl. remote macOS): platformIncompatible now derives from the shared requirement evaluator's missing.os (which already accounts for remote macOS node eligibility) instead of a local-only process.platform check. A macOS-only skill that a remote node can satisfy is no longer flagged incompatible.
  • [P2] doctor --fix repair/readiness: collectUnavailableAgentSkills (the doctor --fix disable target) now excludes platform-incompatible skills, so doctor --fix no longer prompts to disable them — they stay applicable on a matching OS.

Verified by driving the production functions on Linux: a macOS-only skill resolves to platformIncompatible=true (via missing.os), is excluded from collectUnavailableAgentSkills ([]), and drops out of doctor "Missing requirements" (1 → 0); a portable skill stays false. The status / doctor-workspace-status / doctor-skills suites are all green and tsgo:core passes. PR body updated with the current-head proof.

@clawsweeper

clawsweeper Bot commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 2, 2026
@Alix-007
Alix-007 force-pushed the fix/89232-doctor-platform-skills branch from 27920b3 to 5f4c3c7 Compare June 2, 2026 01:20
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 2, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 2, 2026
@Alix-007
Alix-007 force-pushed the fix/89232-doctor-platform-skills branch from 5f4c3c7 to b984f1e Compare June 2, 2026 01:35
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S and removed size: XS labels Jun 2, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 2, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 2, 2026
@Alix-007
Alix-007 force-pushed the fix/89232-doctor-platform-skills branch from 455ff07 to 477f18a Compare June 4, 2026 07:24
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@Alix-007
Alix-007 force-pushed the fix/89232-doctor-platform-skills branch from 477f18a to 455ff07 Compare June 4, 2026 07:33
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 5, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@byungskers thanks for the careful review — agreed the user-facing summary formatting is the most regression-prone part. I added a focused test suite (src/commands/doctor-workspace-status.test.ts) that locks down exactly that, on top of the existing platformIncompatible data-path test:

  • noteWorkspaceStatus > surfaces a platform-incompatible rollup and keeps those skills out of Missing requirements asserts the summary renders Incompatible (platform mismatch, auto-skipped): 1 while the incompatible skill stays out of Missing requirements.
  • noteWorkspaceStatus > omits the platform-incompatible rollup when the count is zero asserts the rollup line is absent (expect(body).not.toContain("Incompatible (platform mismatch")) when no skill is platform-incompatible — i.e. the "only show it when count > 0" behavior you flagged.

So the rollup-string surface is now covered directly. CI is green on the current head.

@Alix-007

Copy link
Copy Markdown
Contributor Author

Hi @sallyom — I see you're in the skills area (just merged #92894 on managed skill paths). This fix is on the skills surface too: openclaw doctor was lumping platform-incompatible skills (e.g. macOS-only on Linux) in with genuinely-missing-requirement skills, so it over-reported problems. It now separates "incompatible (platform mismatch, auto-skipped)" from "missing requirements". Diamond-rated, sufficient proof, CLEAN/mergeable, and @byungskers's requested focused rollup test is already in. Would slot naturally into a skills sweep.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@vincentkoc vincentkoc self-assigned this Jun 15, 2026

@vincentkoc vincentkoc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed live state, diff, and checks. Platform-incompatible skills are separated from genuinely missing requirements with focused doctor/status coverage; checks are clean.

@vincentkoc
vincentkoc merged commit 1b5ac45 into openclaw:main Jun 15, 2026
173 checks passed
@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks so much for the review and merge here, @vincentkoc 🙏 And thanks @byungskers for the earlier nudge on the rollup count coverage — glad the platform-incompatible vs missing-requirement distinction is in. 🦞

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

Labels

cli CLI command changes commands Command implementations P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: openclaw doctor reports platform-incompatible skills (macOS-only / Linux-only) as 'missing requirements' on incompatible hosts

3 participants