fix(plugins): enforce minimum host versions for installable plugins#52094
fix(plugins): enforce minimum host versions for installable plugins#52094vincentkoc merged 7 commits intomainfrom
Conversation
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5e59c77f3
ℹ️ 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".
Greptile SummaryThis PR adds a Key highlights:
Confidence Score: 5/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/plugins/min-host-version.ts
Line: 74-77
Comment:
**Unreachable dead code branch**
`parseSemver(requirement.minimumLabel)` is guaranteed to succeed here because `parseMinHostVersionRequirement` already validates it at line 36–38 before returning a non-null `requirement`. The error branch at line 75–77 can never be reached. Consider removing it to avoid giving the impression this is a realistic fallback:
```suggestion
const minimumSemver = parseSemver(requirement.minimumLabel);
if (!isAtLeast(currentSemver, minimumSemver!)) {
```
Or, if you want to keep the defensive check, add a comment explaining why it is there even though the value was pre-validated.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/plugins/min-host-version.ts
Line: 3
Comment:
**Exported constant is never consumed**
`MIN_HOST_VERSION_PREFIX` is declared and exported but is not imported or used anywhere in the codebase. If it is not part of the public API surface, removing it avoids dead exports and removes any confusion about whether callers should rely on it.
How can I resolve this? If you propose a fix, please make it concise.Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/plugin-min-..." | Re-trigger Greptile |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50c06e92bb
ℹ️ 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".
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🔵 minHostVersion guardrails bypass when PluginCandidate lacks packageManifest
Description
As a result, a plugin that does have Impact:
Vulnerable code: const minHostVersionCheck = checkMinHostVersion({
currentVersion: currentHostVersion,
minHostVersion: candidate.packageManifest?.install?.minHostVersion,
});Why this is reachable:
RecommendationEnsure Options:
Example (option 1 — registry-side fallback): import fs from "node:fs";
import path from "node:path";
import { getPackageManifestMetadata, type PackageManifest } from "./manifest.js";
function tryLoadPackageMetadata(dir: string): OpenClawPackageManifest | undefined {
const p = path.join(dir, "package.json");
if (!fs.existsSync(p)) return undefined;
const raw = JSON.parse(fs.readFileSync(p, "utf-8")) as PackageManifest;
return getPackageManifestMetadata(raw);
}
const packageMeta = candidate.packageManifest ?? tryLoadPackageMetadata(candidate.packageDir ?? candidate.rootDir);
const minHostVersionCheck = checkMinHostVersion({
currentVersion: currentHostVersion,
minHostVersion: packageMeta?.install?.minHostVersion,
});Also consider treating an unreadable/invalid Analyzed PR: #52094 at commit Last updated on: 2026-03-22T16:36:48Z |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1248607cc9
ℹ️ 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".
…penclaw#52094) * fix(plugins): enforce min host versions * fix(plugins): tighten min host version validation * chore(plugins): trim dead min host version code * fix(plugins): handle malformed min host metadata * fix(plugins): key manifest cache by host version
…penclaw#52094) * fix(plugins): enforce min host versions * fix(plugins): tighten min host version validation * chore(plugins): trim dead min host version code * fix(plugins): handle malformed min host metadata * fix(plugins): key manifest cache by host version
…penclaw#52094) * fix(plugins): enforce min host versions * fix(plugins): tighten min host version validation * chore(plugins): trim dead min host version code * fix(plugins): handle malformed min host metadata * fix(plugins): key manifest cache by host version (cherry picked from commit 3ce5a83)
…penclaw#52094) * fix(plugins): enforce min host versions * fix(plugins): tighten min host version validation * chore(plugins): trim dead min host version code * fix(plugins): handle malformed min host metadata * fix(plugins): key manifest cache by host version (cherry picked from commit 3ce5a83)
…penclaw#52094) * fix(plugins): enforce min host versions * fix(plugins): tighten min host version validation * chore(plugins): trim dead min host version code * fix(plugins): handle malformed min host metadata * fix(plugins): key manifest cache by host version
…penclaw#52094) * fix(plugins): enforce min host versions * fix(plugins): tighten min host version validation * chore(plugins): trim dead min host version code * fix(plugins): handle malformed min host metadata * fix(plugins): key manifest cache by host version
…penclaw#52094) * fix(plugins): enforce min host versions * fix(plugins): tighten min host version validation * chore(plugins): trim dead min host version code * fix(plugins): handle malformed min host metadata * fix(plugins): key manifest cache by host version
Summary
openclaw/plugin-sdk/*subpaths.openclaw.install.minHostVersionmetadata, enforce it during plugin install and manifest loading, and added guardrails/tests plus manifest coverage for affected installable plugins.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
openclaw.install.minHostVersionabove the running host version.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
openclaw.install.minHostVersionabove the running host version.Expected
Actual
Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
minHostVersionsyntax, future stricter floors (>=...) still accepted by the guardrail, direct-install packages withoutnpmSpecmetadata (irc,twitch,voice-call).Review Conversations
Compatibility / Migration
Yes, for compatible hosts)No)No)Failure Recovery (if this breaks)
openclaw.install.minHostVersionfields from affected plugin manifests.src/plugins/install.ts,src/plugins/manifest-registry.ts, affectedextensions/*/package.jsonmanifests.minHostVersionmetadata.Risks and Mitigations
AI-assisted: yes. Tested locally with
pnpm test -- src/plugins/min-host-version.test.ts src/plugins/install.test.ts src/plugins/manifest-registry.test.ts src/plugins/install-min-host-version-guardrails.test.ts test/release-check.test.ts,pnpm build, andpnpm check.