Skip to content

fix: extract requires.env and homepage from top-level frontmatter#548

Open
MunemHashmi wants to merge 1 commit intoopenclaw:mainfrom
MunemHashmi:fix/522-extract-requires-env-metadata
Open

fix: extract requires.env and homepage from top-level frontmatter#548
MunemHashmi wants to merge 1 commit intoopenclaw:mainfrom
MunemHashmi:fix/522-extract-requires-env-metadata

Conversation

@MunemHashmi
Copy link

@MunemHashmi MunemHashmi commented Feb 27, 2026

Summary

Fixes #522

  • convex/lib/skills.ts: parseFrontmatterLevelDeclarations() now parses requires block (env, bins, anyBins, config) and primaryEnv from top-level SKILL.md frontmatter when no metadata.openclaw wrapper is present
  • convex/llmEval.ts: evalCtx.homepage now falls back to clawdis.homepage and clawdis.links.homepage, so skills declaring homepage inside the metadata block are picked up by the security scanner
  • convex/lib/skills.test.ts: Two new test cases covering the exact reproduction scenario from the issue

Root cause

When a skill declares requires.env at the top level of frontmatter (not nested under metadata.openclaw), parseClawdisMetadata delegates to parseFrontmatterLevelDeclarations. That fallback function handled envVars, dependencies, author, links, and homepage — but not requires. This meant parsed.clawdis.requires was always empty, so the security scanner showed "Required env vars: none" and flagged a metadata mismatch.

Test plan

  • bun run test -- convex/lib/skills.test.ts — 30/30 pass (including 2 new tests)
  • bun run lint — 0 warnings, 0 errors
  • bun run build — successful

…enclaw#522)

parseFrontmatterLevelDeclarations did not handle the requires block
(env, bins, anyBins, config) or primaryEnv when declared at the
top level of SKILL.md frontmatter without a metadata.openclaw wrapper.
This caused the security scanner to always show "Required env vars: none"
for skills using that format, triggering false-positive suspicious flags.

Also extends the evalCtx.homepage fallback chain to check
clawdis.homepage and clawdis.links.homepage so skills declaring
homepage inside the metadata block are picked up by the scanner.
@vercel
Copy link
Contributor

vercel bot commented Feb 27, 2026

@MunemHashmi is attempting to deploy a commit to the Amantus Machina Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR successfully fixes issue #522 by enabling requires block (env, bins, anyBins, config) and primaryEnv parsing from top-level frontmatter when no metadata.openclaw wrapper is present. The implementation mirrors the existing clawdis block parsing logic for consistency and adds fallback logic for homepage in the security scanner.

Key Changes:

  • parseFrontmatterLevelDeclarations() now parses requires block and primaryEnv from top-level frontmatter
  • Security scanner (llmEval.ts) checks clawdis.homepage and clawdis.links.homepage as fallbacks
  • Two comprehensive test cases validate the parsing behavior

Technical Quality:

  • Implementation is consistent with existing code patterns
  • Type-safe with proper validation
  • Well-tested with clear test coverage
  • Backward compatible - no breaking changes

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects focused changes that address a specific bug, consistent implementation patterns mirroring existing code, comprehensive test coverage with passing tests, and no breaking changes or security concerns identified
  • No files require special attention

Last reviewed commit: bd57b10

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.

Security scanner always shows 'Required env vars: none' — frontmatter requires.env not extracted into registry metadata

1 participant