Skip to content

fix(config): preserve description from markdown agent frontmatter#27965

Closed
zmrlft wants to merge 1 commit into
anomalyco:devfrom
zmrlft:dev
Closed

fix(config): preserve description from markdown agent frontmatter#27965
zmrlft wants to merge 1 commit into
anomalyco:devfrom
zmrlft:dev

Conversation

@zmrlft
Copy link
Copy Markdown

@zmrlft zmrlft commented May 17, 2026

Issue for this PR

Closes #27831

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Custom markdown-defined subagents showed "should only be called manually" instead of their description in the Task tool tooltip.

Root cause: when loading markdown-defined agents, the description field from frontmatter was dropped during schema decode/normalize in config/agent.ts.

  • normalize() now explicitly carries description in the return value
  • load() falls back to raw frontmatter description if schema-decoded result lacks it

How did you verify your code works?

Ran bun test for config/agent-color, config/config, config/markdown tests - all 162 pass (1 unrelated timeout in agent.test.ts). Also bun run typecheck passes with no errors.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

When loading agents from markdown files (.opencode/agents/*.md), the
description field from YAML frontmatter could be lost during the schema
decode process. The normalize() function relied on spreading all decoded
properties via ...agent, but when the Schema.decodeTo wrapper interferes
with the decode, description may not be included.

Two changes:
1. normalize() now explicitly carries description through the return value
2. load() now falls back to the raw frontmatter description if the schema
   decoded result lacks it

Fixes anomalyco#27831
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@zmrlft zmrlft closed this May 17, 2026
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.

Custom markdown-defined subagents show "should only be called manually" in Task tool despite having description in frontmatter

1 participant