Load subagent names from agents/ markdown files#117
Conversation
OpenCode also defines agents as *.md files under the config agents directory, so readSubagentNames now merges those definitions with opencode.json agents. Co-authored-by: Cursor <cursoragent@cursor.com>
|
FYI, three follow-ups that align this with how OpenCode itself loads agents (
Commits to follow. Thanks for kicking this off. |
Read from both `agent/` and `agents/` (OpenCode globs {agent,agents}/**/*.md),
scan recursively with path-based names, and parse quoted/alternate frontmatter
values (`mode: "subagent"`, `disable: "true"`, `disable: yes`).
Adds unit tests plus a real-filesystem test exercising both directories and
nested agents on disk.
|
Pushed the three fixes as a commit on top. Covered by unit tests and a real-filesystem test that writes Still needs a live check before merge: confirm that in a running OpenCode session the discovered names actually reach the |
OpenCode deletes JSON agents marked `disable: true` (agent/agent.ts). The loader passed them through, so markdown `disable` worked but JSON `disable` did not. Filter disabled JSON agents to match, with a regression test.
Summary
Test plan
Made with Cursor
I have my agents defined in markdown files for opencode, https://opencode.ai/docs/agents/#markdown, and they are not picked up by the plugin. Adding code to pick up the markdown agents.