Skip to content

fix(packages): make Plugin Inspector advisory and validate declared entrypoints - #4379

Merged
Patrick-Erichsen merged 3 commits into
mainfrom
plugin-inspector-advisory
Nov 4, 2026
Merged

Patrick-Erichsen merged 3 commits into
mainfrom
plugin-inspector-advisory

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Plugin Inspector no longer fails or blocks a plugin publish, and its one real check moves into package validation.

Over the last 30 days the publish-time Inspector gate blocked 145 plugin publishes. Only 4 were plugin defects (declared entrypoints missing from the upload). The other 141 were the tool failing: 512 MiB Node action OOMs, timeouts, or OpenClaw target preparation errors, all reported to publishers as Plugin Inspector blocked publish.

This is PR 1 of 2. It covers steps 1 and 3 (Inspector is advisory, entrypoint check moves into package validation). It still runs Inspector inside the publish request, but bounded and non-blocking. The follow-up, #4383 (stacked on this branch), moves Inspector out of the publish request entirely, into post-acceptance monitoring through the existing plugin-inspector-bulk-scan.yml workflow (dispatched per accepted release, plus the nightly sweep).

Behavior

Entrypoint validation (blocking, in package validation)

  • validateOpenClawExternalCodePluginPackageContents (clawhub-schema, used by both the server publish path and the CLI before upload) rejects a code plugin when a file declared by openclaw.extensions, openclaw.runtimeExtensions, openclaw.setupEntry, or openclaw.runtimeSetupEntry is missing from the uploaded files.
  • It follows OpenClaw's validatePackageExtensionEntriesForInstall / listBuiltRuntimeEntryCandidates for installed packages:
    • A declared runtime entry must exist.
    • Otherwise a TypeScript entry needs compiled output: dist/<path>, dist/src/<path>, or <path> with .js/.mjs/.cjs, ordered by .mts/.cts.
    • A JavaScript entry must exist itself.
    • runtimeSetupEntry without setupEntry is rejected.
    • Entries that resolve outside the package are rejected, including a declared source entry whose runtime entry replaces it (OpenClaw bounds-checks both).
  • Example error: demo-plugin declares openclaw.extensions entry ./dist/index.js, but that file is missing from the package. OpenClaw cannot load this plugin without it. Build first and publish a local folder or .tgz, or include the runtime file in the GitHub ref. Otherwise update package.json openclaw.extensions to point at a published file.
  • Undeclared entrypoints are out of scope, so this adds no new requirement for packages without openclaw.extensions.

Plugin Inspector (advisory)

  • Inspector results carry an outcome: clean, findings, tool_failure, or timeout. Failures also carry { stage, reason: out_of_memory | target_unavailable | timeout | error, message }.
  • The Node action no longer turns its own failure into a P0 plugin-inspector-error breakage. A workspace-cleanup failure is logged and no longer becomes a finding.
  • The publishing action races the Inspector action against PACKAGE_INSPECTOR_PUBLISH_BUDGET_MS (120 s). It also catches a rejected runAction, which is how a Convex Node OOM kill surfaces. Either way the publish continues. The deadline lives in the caller because Inspector's heavy TypeScript work is synchronous and would starve an in-action timer.
  • Real findings, breakages included, are returned in inspectorFindings (the CLI prints them as ERROR/WARNING advisories), staged with the attempt, and stored at finalization as scanSource: "publish" findings. Publish-time findings never email owners; owner email stays with reviewed bulk-scan notification runs.
  • Outcomes are recorded on packageInspectorScanStates (new optional fields outcome, failure, scanSource). A publish-time failure that never resolved its OpenClaw target uses targetOpenClawVersion: "unresolved". A tool failure never inserts finding rows, even if findings were staged.
  • A failed rescan of the same release, Inspector version and target keeps the completed verdict and its findings. It records only the latest failure.
  • A failed or timed-out scan state never counts as coverage:
    • The bulk-scan claim does not skip it.
    • The plugin validation report takes its verdict from the latest scan that actually inspected the release.
    • A release with only failed scans reports status: "skipped" with skipReason: "inspector-timeout" | "inspector-tool-failure". It never reports error (and no longer reports a misleading clean).
  • The bulk scan reports its own failures with the same classification.
  • The publish page's special "Plugin Inspector blocked publish" error panel is removed, since the server no longer produces that error.

Back-compat:

  • Attempts staged before deploy have no inspectorOutcome, and their finalization behaves as before.
  • Scan-state rows without outcome are treated as completed scans.
  • The Plugin Inspector dependency version is unchanged.

Tests

Highest seam, publishPackageForUserInternal (convex/packages.public.test.ts, "advisory Plugin Inspector"):

  • Inspector action rejects with Node.js action execution ran out of memory: publish succeeds and stages tool_failure / out_of_memory, with no findings.
  • Inspector reports an OpenClaw target preparation failure: publish succeeds and stages tool_failure / target_unavailable.
  • Inspector never settles: publish succeeds after the 120 s budget (fake timers) and stages timeout.
  • Real Inspector breakage: publish succeeds and returns it as an error advisory finding.
  • Declared ./dist/plugin.js missing from the upload: publish is rejected with the actionable error, and Inspector is never invoked.
  • Valid plugin: publishes with a clean outcome.

Convex runtime (convex/packageInspectorAdvisory.runtime.test.ts, convex-test):

  • Finalizing an OOM attempt publishes the release and records a tool_failure scan state with no findings.
  • A timeout attempt with stale staged findings stores no findings.
  • Real breakages are stored as error findings with no notification.
  • A nightly timeout ingest records timeout, and the release stays claimable.

Also covered:

  • A completed nightly scan followed by a failed rescan of the same target keeps its findings.
  • A legacy attempt staged without an Inspector outcome still finalizes and stores its findings.
  • classifyPackageInspectorFailure unit tests: OOM vs timeout vs target stage, and the message cap.

Other updated tests:

  • packages/schema/src/openclawContract.test.ts covers the entrypoint rules: dist/src variants, .mts, runtime and setup entries, escapes, and length mismatch.
  • Node action lifecycle tests now cover tool_failure, timeout, and OOM classification, plus a cleanup failure that keeps the result.
  • Validation-report skipped status is covered.
  • The UI publish error test, CLI fixtures that declared an unshipped ./dist/index.js, and the e2e/local-auth Playwright fixture (now a missing-entrypoint rejection) are updated.

Commands run locally:

  • bun run ci:static: pass (format, oxlint, knip, llms, audit warnings only).
  • bunx tsc --noEmit, bunx tsc -p convex/tsconfig.json --noEmit, bun run ci:types:packages: pass.
  • bun run ci:packages: pass.
  • bun run ci:unit: all touched suites pass. The only local failures are timing-sensitive scanner and Endor wrapper tests that pass in isolation and fail only under local load. They are unrelated.
  • vitest -c vitest.e2e.config.ts e2e/clawhub.e2e.test.ts (CLI publish subset): pass.

Spec: specs/plugin-inspector-reliability.md ("Plugin Inspector is advisory"). Docs: docs/publishing.md, docs/plugin-validation-fixes.md.

@Patrick-Erichsen
Patrick-Erichsen requested a review from a team as a code owner November 4, 2026 01:38
@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clawhub Ready Ready Preview Nov 4, 2026 2:09am UTC

Request Review

…ntrypoints

Plugin Inspector no longer fails or blocks a plugin publish. Tool failures
(out of memory, timeouts, OpenClaw target preparation errors) are recorded
as tool_failure/timeout outcomes on the scan state, never as plugin
breakage, and real Inspector findings are stored as advisory findings.

Package validation now rejects code plugins whose declared openclaw
extensions, runtimeExtensions, setupEntry, or runtimeSetupEntry files are
missing from the upload, mirroring OpenClaw's install-time checks.
Address review: a failed rescan of the same release/target no longer
overwrites a completed outcome or hides its findings, the declared entry is
bounds-checked even when a runtime entry replaces it, and the failure
classification and legacy finalization paths are covered by tests.
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 4, 2026
@Patrick-Erichsen
Patrick-Erichsen force-pushed the plugin-inspector-advisory branch from 81e9ef6 to a9954fd Compare November 4, 2026 02:06
@Patrick-Erichsen
Patrick-Erichsen merged commit aebfd33 into main Nov 4, 2026
40 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the plugin-inspector-advisory branch November 4, 2026 02:18

This branch was successfully deployed

1 active deployment
Preview – clawhub — a9954fde Deployed Nov 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant