Skip to content

fix(skills): stop reporting invalid source skills as installed - #122341

Closed
ooiuuii wants to merge 1 commit into
openclaw:mainfrom
ooiuuii:fix/source-skill-metadata-validation-122298
Closed

ooiuuii wants to merge 1 commit into
openclaw:mainfrom
ooiuuii:fix/source-skill-metadata-validation-122298

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #122298

What Problem This Solves

Local-directory and Git skill installs could report success even when normal discovery would later skip the installed root SKILL.md because its frontmatter was invalid, its description was empty, or the file exceeded the configured discovery byte limit.

What Changed

  • Validate only the source root SKILL.md before copying, using the existing boundary-safe frontmatter reader.
  • Apply the active target's skills.limits.maxSkillFileBytes during that validation.
  • Require a non-empty description while retaining the existing explicit-slug and frontmatter-name fallback behavior.
  • Pass the resolved target configuration from the skills CLI into the source installer.
  • Preserve current main's onInstallPolicyWarning callback through both local and Git source-install paths.

The validator intentionally does not enumerate nested child skills. An invalid root cannot be replaced by a valid nested skill, so third-party Git sources do not turn this single-root preflight into an unbounded directory scan.

Compatibility Rebase

The branch was rebased onto 82d2c992a25bc38336e1a5d49e1ef15d03798f19 and the conflict was resolved in favor of the current warning-acknowledgement contract. Both interactive and noninteractive callback-propagation cases remain covered by the current CLI tests. The two subsequent main commits through cbcbb005fdcf4c8c38770b65957b7f8b6527a1e4 do not touch this PR's files.

Evidence (exact head 1e7c98df6db83dcf65caa32d1a5fa088aa4951e3)

  • node scripts/run-vitest.mjs src/skills/lifecycle/source-install.test.ts --testNamePattern="^(?!.*reports ).*$" — 12 passed, 2 skipped. The two excluded pre-existing Git policy cases require restrictive parent-directory permissions unavailable in this Windows checkout; the full file otherwise failed only those two environment checks.
  • node scripts/run-vitest.mjs src/cli/skills-cli.commands.test.ts — 141 passed, including interactive and noninteractive install-policy warning callback propagation.
  • node scripts/run-vitest.mjs src/skills/loading/skill-root-discovery.test.ts --testNamePattern="maxSkillFileBytes" — 2 passed, 25 skipped.
  • Targeted oxfmt --check — passed.
  • Targeted type-aware oxlint — passed.
  • git diff upstream/main...HEAD --check — passed.

AI-assisted: implemented and reviewed with Codex.

@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@ooiuuii
ooiuuii marked this pull request as ready for review August 11, 2026 23:33
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 3:49 AM ET / 07:49 UTC.

ClawSweeper review

What this changes

Reject local and Git skill installs before copying when the root SKILL.md fails the existing discovery metadata or size requirements.

Merge readiness

⛔ Blocked before merge - 5 items remain

The fix remains necessary on current main and v2026.8.2. The previous warning-callback finding is resolved; one minor recovery-message defect remains.

Priority: P2
Reviewed head: 1e7c98df6db83dcf65caa32d1a5fa088aa4951e3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with retained proof acceptance and one minor diagnostic correction.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (none): Retained the recorded sufficient-proof acceptance for the source-install change. The captured body supplies supplemental tests, but the original runtime entrypoint, environment, and observed result were unavailable for reinspection; this is not a fresh runtime certification.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (none): Retained the recorded sufficient-proof acceptance for the source-install change. The captured body supplies supplemental tests, but the original runtime entrypoint, environment, and observed result were unavailable for reinspection; this is not a fresh runtime certification.
Evidence reviewed 11 items Verified introduction and merge result: Raw commit records match the supplied head and test-merge parents. Comparing the verified test merge with its main parent retains the warning callback and introduces only the supplied validation and test changes.
Current main still permits false success: The installer reads metadata only to choose a name, tolerates missing metadata, and then invokes installation without checking the discovery byte limit or description.
Latest release also lacks the preflight: The released source installer has the same unchecked installation path. The annotated v2026.8.2 tag resolves to the supplied release commit.
Findings 1 actionable finding [P3] Report size rejection without diagnosing malformed YAML
Security None None.

How this fits together

The skills installer copies local or Git sources into workspace or shared skill directories. Discovery then reads their metadata to make usable skills available to agents.

flowchart TD
  A[Local directory or Git repository] --> B[Resolve install target and configuration]
  B --> C[Read bounded root skill metadata]
  C --> D{Root is loadable?}
  D -->|No| E[Report installation error]
  D -->|Yes| F[Apply install policy and copy]
  F --> G[Discover installed skill]
Loading

Before merge

  • Report size rejection without diagnosing malformed YAML (P3) - A valid SKILL.md exceeding skills.limits.maxSkillFileBytes reaches this error because the reader returns null on read failure. The added oversized-root test explicitly covers that input, but adding YAML frontmatter cannot fix it. Preserve the reader’s diagnostic, or make the fallback accurately mention the byte limit and recovery instead of attributing every rejection to metadata.
  • Resolve merge risk (P1) - Existing scripts may rely on copy-only success for unloadable sources; local and Git installs, including forced reinstalls, will now stop before copying.
  • Resolve merge risk (P1) - The original accepted runtime artifact and direct fs-safe dependency source could not be re-inspected in this environment; prior proof acceptance is retained without claiming fresh verification.
  • Complete next step (P2) - Correct the source-install error so a size-limit rejection gives an accurate recovery hint, and update the existing oversized-root test.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [P3] Report size rejection without diagnosing malformed YAML — src/skills/lifecycle/source-install.ts:219-223
Agent review details

Security

None.

PR surface

Source +16, Tests +60. Total +76 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 32 16 +16
Tests 2 62 2 +60
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 94 18 +76

Review metrics

Metric Value Why it matters
Production versus test growth Production net +16; tests net +60 Production growth replaces name-only parsing with a pre-copy rejection boundary; tests cover malformed roots, byte limits, and configuration propagation.
Existing limit enforcement 1 existing byte limit applied at installation; 0 new settings The installer now enforces the same configured size ceiling already used by discovery.

Stored data model

Persistent data-model change detected: serialized state: src/skills/lifecycle/source-install.ts, unknown-data-model-change: src/skills/lifecycle/source-install.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Make earlier rejection actionable (recommended)
    Preserve the intended pre-copy rejection while reporting size or read failures accurately so existing install scripts have a comprehensible failure outcome.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Correct source-install failure diagnostics so oversized valid SKILL.md files are not diagnosed solely as malformed YAML; preserve root-only bounded validation, slug fallback, and warning acknowledgement, and update focused regression coverage.

Technical review

Best possible solution:

Keep root-only preflight, fold actionable rejection diagnostics into the existing reader, and preserve slug selection, installed state, and warning acknowledgement.

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

Yes, from source: current main can copy the linked report’s unfenced skill and report success although discovery rejects it. No executable reproduction was run during this read-only review.

Is this the best way to solve the issue?

Yes, validation belongs at the shared local/Git installation boundary and should reuse discovery’s reader; automatic skills.entries registration would not repair malformed metadata. The rejection message needs a small correction.

Full review comments:

  • [P3] Report size rejection without diagnosing malformed YAML — src/skills/lifecycle/source-install.ts:219-223
    A valid SKILL.md exceeding skills.limits.maxSkillFileBytes reaches this error because the reader returns null on read failure. The added oversized-root test explicitly covers that input, but adding YAML frontmatter cannot fix it. Preserve the reader’s diagnostic, or make the fallback accurately mention the byte limit and recovery instead of attributing every rejection to metadata.
    Confidence: 0.98

Overall correctness: patch is correct
Overall confidence: 0.87

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0d2169fdabc4.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (none): Retained the recorded sufficient-proof acceptance for the source-install change. The captured body supplies supplemental tests, but the original runtime entrypoint, environment, and observed result were unavailable for reinspection; this is not a fresh runtime certification.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs misleading success for local and Git skill installation with a bounded affected workflow.
  • merge-risk: 🚨 compatibility: Previously successful copy operations can now return failure when their source would be skipped by discovery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (none): Retained the recorded sufficient-proof acceptance for the source-install change. The captured body supplies supplemental tests, but the original runtime entrypoint, environment, and observed result were unavailable for reinspection; this is not a fresh runtime certification.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained the recorded sufficient-proof acceptance for the source-install change. The captured body supplies supplemental tests, but the original runtime entrypoint, environment, and observed result were unavailable for reinspection; this is not a fresh runtime certification.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/skills/lifecycle/source-install.test.ts.
  • [P1] node scripts/run-vitest.mjs src/cli/skills-cli.commands.test.ts.
  • [P1] node scripts/run-vitest.mjs src/skills/loading/skill-root-discovery.test.ts --testNamePattern=maxSkillFileBytes.
  • [P1] node scripts/run-vitest.mjs src/skills/loading/skill-path-containment.test.ts.
  • [P1] git diff --check.

What I checked:

  • Verified introduction and merge result: Raw commit records match the supplied head and test-merge parents. Comparing the verified test merge with its main parent retains the warning callback and introduces only the supplied validation and test changes. (src/skills/lifecycle/source-install.ts:215, a2fafc8e4642)
  • Current main still permits false success: The installer reads metadata only to choose a name, tolerates missing metadata, and then invokes installation without checking the discovery byte limit or description. (src/skills/lifecycle/source-install.ts:132, 0d2169fdabc4)
  • Latest release also lacks the preflight: The released source installer has the same unchecked installation path. The annotated v2026.8.2 tag resolves to the supplied release commit. (src/skills/lifecycle/source-install.ts:207, 0965053fe6b9)
  • Discovery contract and sibling behavior: The existing loader requires a description and applies bounded reads. Workspace discovery filters out fallback child records when the requested root cannot load; managed skills are discovered without requiring a skills.entries registration. (src/skills/loading/workspace-skill-loader.ts:199, 1e7c98df6db8)
  • Caller and policy continuity: The CLI supplies the selected configuration and warning acknowledgement. Both source paths retain that callback through installation; existing interactive and noninteractive CLI cases are reported passing in the captured body. (src/cli/skills-cli.ts:681, 1e7c98df6db8)
  • Introduced diagnostic mismatch: The added oversized-root test supplies valid frontmatter with a 32-byte limit, yet expects an invalid-frontmatter error. The reader collapses read failures to null, and the installer consequently recommends a YAML change that cannot resolve the size rejection. (src/skills/lifecycle/source-install.test.ts:182, 1e7c98df6db8)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jesse Merhi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Make oversized-file rejection actionable and update the existing regression assertion.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

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

History

Review history (5 earlier review cycles)
  • reviewed 2026-08-17T11:16:29.400Z sha 93d95c1099e2875459b9bfb5721e0c1a6cd3d6d1 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-18T13:44:52.151Z sha 93d95c1099e2875459b9bfb5721e0c1a6cd3d6d1 :: needs maintainer review before merge. :: none
  • reviewed August 27, 2026, 4:23 AM ET / 08:23 UTC sha unknown :: needs changes before merge. :: [P1] Preserve source-install warning acknowledgement on rebase
  • reviewed 2026-09-03T01:58:00.761Z sha 93d95c1099e2875459b9bfb5721e0c1a6cd3d6d1 :: blocked before merge. :: [P1] Preserve source-install warning acknowledgement on rebase
  • reviewed September 2, 2026, 10:14 PM ET / September 3, 2026, 02:14 UTC sha unknown :: blocked before merge. :: [P1] Preserve source-install warning acknowledgement on rebase

@ooiuuii
ooiuuii force-pushed the fix/source-skill-metadata-validation-122298 branch from 1e0245d to 2d2a31d Compare August 12, 2026 06:09
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 12, 2026
@ooiuuii
ooiuuii force-pushed the fix/source-skill-metadata-validation-122298 branch from 2d2a31d to 93d95c1 Compare August 12, 2026 06:51
@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Aug 12, 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 12, 2026
steipete added a commit to openclaw/clawsweeper that referenced this pull request Aug 17, 2026
…capture (#1190)

Production terminal recordings (openclaw/openclaw#122341 run 32025434010)
showed ffmpeg capturing frames while the growth probe demanded strictly
increasing sizes between one-second samples, which VP9's bursty muxer
never guarantees. The recorder is now accepted once any payload is
written, VP9 encodes with realtime deadline tuning so hosted runners
hold the frame rate, and the workflow assertion learns the xfonts-base
dependency added in #1188.
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 18, 2026
@clawsweeper clawsweeper Bot added 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. and removed 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. labels Aug 27, 2026
@ooiuuii
ooiuuii force-pushed the fix/source-skill-metadata-validation-122298 branch from 93d95c1 to 1e7c98d Compare September 4, 2026 07:23
@ooiuuii

ooiuuii commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 4, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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 Sep 4, 2026
@vincentkoc vincentkoc self-assigned this Sep 9, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Sep 10, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

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

Labels

cli CLI command changes merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S stale Marked as stale due to inactivity 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 skills install --global writes files but skips skills.entries registration — skill invisible to gateway

2 participants