Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(skill): ignore complex YAML frontmatter to prevent parsing errors#1043

Merged
LearningGp merged 2 commits into
agentscope-ai:mainfrom
jujn:fix_1030
Apr 13, 2026
Merged

fix(skill): ignore complex YAML frontmatter to prevent parsing errors#1043
LearningGp merged 2 commits into
agentscope-ai:mainfrom
jujn:fix_1030

Conversation

@jujn
Copy link
Copy Markdown
Contributor

@jujn jujn commented Mar 25, 2026

Description

Close #1030

This PR updates the internal SimpleYamlParser to gracefully skip unsupported block-style complex structures (like lists or nested objects) instead of throwing exceptions.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@jujn jujn requested review from a team and Copilot March 25, 2026 14:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes MarkdownSkillParser more tolerant of complex/invalid YAML frontmatter by skipping unsupported lines instead of throwing, so skills with non-flat frontmatter won’t block loading.

Changes:

  • Updated SimpleYamlParser to skip non-key: value YAML lines and avoid throwing on unsupported structures.
  • Added/updated unit tests to assert “graceful ignore” behavior for invalid lines and list-style YAML in frontmatter.
  • Adjusted empty-value generation/parsing expectations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
agentscope-core/src/main/java/io/agentscope/core/skill/util/MarkdownSkillParser.java Makes YAML parsing tolerant by skipping unsupported lines/structures and adds debug logging.
agentscope-core/src/test/java/io/agentscope/core/skill/util/MarkdownSkillParserTest.java Updates tests to validate non-throwing behavior and adds a complex-frontmatter parsing scenario.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...gentscope/core/skill/util/MarkdownSkillParser.java 86.66% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@jujn
Copy link
Copy Markdown
Contributor Author

jujn commented Mar 27, 2026

@fang-tech PTAL Thanks.

Copy link
Copy Markdown
Collaborator

@fang-tech fang-tech left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link
Copy Markdown
Collaborator

@LearningGp LearningGp left a comment

Choose a reason for hiding this comment

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

LGTM

@LearningGp LearningGp merged commit 6688559 into agentscope-ai:main Apr 13, 2026
6 checks passed
liangxingguang pushed a commit to liangxingguang/agentscope-java that referenced this pull request May 21, 2026
…agentscope-ai#1043)

## Description

Close agentscope-ai#1030 

This PR updates the internal `SimpleYamlParser` to gracefully skip
unsupported block-style complex structures (like lists or nested
objects) instead of throwing exceptions.

## Checklist

Please check the following items before code is ready to be reviewed.

- [ ]  Code has been formatted with `mvn spotless:apply`
- [ ]  All tests are passing (`mvn test`)
- [ ]  Javadoc comments are complete and follow project conventions
- [ ] Related documentation has been updated (e.g. links, examples,
etc.)
- [ ]  Code is ready for review
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.

[Bug]: Agent SKILL.md parser fails for non-strings frontmatter, blocks loading of the skill

4 participants