subdirectory subagent definitions not being picked up #1563

Closed
opened 2026-02-16 17:31:34 -05:00 by yindo · 12 comments
Owner

Originally created by @musyoka101 on GitHub (Sep 2, 2025).

Originally assigned to: @rekram1-node on GitHub.

on the latest release i cannot see or invoke any of my subagents is this a bug on my end alone ?

Image Image

I have those subagents present in agents/subagents directory

Image
Originally created by @musyoka101 on GitHub (Sep 2, 2025). Originally assigned to: @rekram1-node on GitHub. on the latest release i cannot see or invoke any of my subagents is this a bug on my end alone ? <img width="1198" height="270" alt="Image" src="https://github.com/user-attachments/assets/f4f4852f-2547-4f5f-9f67-85b51dc3ad40" /> <img width="971" height="348" alt="Image" src="https://github.com/user-attachments/assets/8d925ae2-99b3-405f-a278-ac1f09de5e39" /> I have those subagents present in agents/subagents directory <img width="311" height="406" alt="Image" src="https://github.com/user-attachments/assets/64b93be8-01f4-4d40-8571-f0ace2ff3f00" />
yindo closed this issue 2026-02-16 17:31:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 2, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1306: Similar issue with agents/subagents not working properly - user reports that their agent is ignored and needs explicit task tool invocation to work

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 2, 2025): This issue might be a duplicate of existing issues. Please check: - #1306: Similar issue with agents/subagents not working properly - user reports that their agent is ignored and needs explicit task tool invocation to work Feel free to ignore if none of these address your specific case.
Author
Owner

@musyoka101 commented on GitHub (Sep 2, 2025):

I've noticed this only happens if the agent workflow files are used Per-project: /project/.opencode/agent/

I've used globally they seem to work

@musyoka101 commented on GitHub (Sep 2, 2025): I've noticed this only happens if the agent workflow files are used Per-project: /project/.opencode/agent/ I've used globally they seem to work
Author
Owner

@OpeOginni commented on GitHub (Sep 2, 2025):

Hey @musyoka101 from the Docs it seems like you need to put them in the agent folder not subagents one as I see in your screenshot. https://opencode.ai/docs/agents/#create-agents

---
description: Code review without edits
mode: subagent
permission:
  edit: deny
  bash: ask
  webfetch: deny
---

Only analyze code and suggest changes.

Then give it a mode of subagent either in the MD file itself or in your config https://opencode.ai/docs/agents/#mode

@OpeOginni commented on GitHub (Sep 2, 2025): Hey @musyoka101 from the Docs it seems like you need to put them in the `agent` folder not `subagents` one as I see in your screenshot. https://opencode.ai/docs/agents/#create-agents ```md --- description: Code review without edits mode: subagent permission: edit: deny bash: ask webfetch: deny --- Only analyze code and suggest changes. ``` Then give it a mode of subagent either in the MD file itself or in your config https://opencode.ai/docs/agents/#mode
Author
Owner

@musyoka101 commented on GitHub (Sep 2, 2025):

@OpeOginni but it's been working till the latest updates. But whats funny is for global config it works

Image Image Image

Here is my global folder config

Image
@musyoka101 commented on GitHub (Sep 2, 2025): @OpeOginni but it's been working till the latest updates. But whats funny is for global config it works <img width="1573" height="589" alt="Image" src="https://github.com/user-attachments/assets/85d8fd3e-c5e1-4bd0-b738-0750ff1a803e" /> <img width="1447" height="761" alt="Image" src="https://github.com/user-attachments/assets/28d37131-7709-4382-93a3-56b3aa11108a" /> <img width="1230" height="821" alt="Image" src="https://github.com/user-attachments/assets/2da8a834-2fe0-4172-839c-ff9b781ab7a7" /> Here is my global folder config <img width="472" height="323" alt="Image" src="https://github.com/user-attachments/assets/ff354ced-dea1-4018-9e4e-759da8c705d8" />
Author
Owner

@OpeOginni commented on GitHub (Sep 2, 2025):

@musyoka101 Right here https://github.com/sst/opencode/blob/dev/packages/opencode/src/config/config.ts#L46-L49

It shows that the code base supports searching for md files allover the /agent folder only for the GLOBAL.Path (global config), but for the current Instance (Your current project's config), it is specifically searching for ones in .opencode/agent nothing else, no nesting supported. I cant be too sure on if it worked with a nested subagents folder previously, the commits don't show that this check was ever changed.

But for a solution I think you might have to move the files from the subagents folder and just keep them in the agent ones. IDK if the maintainers would want to offer that feature in for local project instance just as it is for the Global. Apologies if tagging you is wrong @rekram1-node just wanted to draw your attention.

@OpeOginni commented on GitHub (Sep 2, 2025): @musyoka101 Right here https://github.com/sst/opencode/blob/dev/packages/opencode/src/config/config.ts#L46-L49 It shows that the code base supports searching for `md` files allover the `/agent` folder only for the GLOBAL.Path (global config), but for the current Instance (Your current project's config), it is specifically searching for ones in `.opencode/agent` nothing else, no nesting supported. I cant be too sure on if it worked with a nested `subagents` folder previously, the commits don't show that this check was ever changed. But for a solution I think you might have to move the files from the `subagents` folder and just keep them in the `agent` ones. IDK if the maintainers would want to offer that feature in for local project instance just as it is for the Global. Apologies if tagging you is wrong @rekram1-node just wanted to draw your attention.
Author
Owner

@musyoka101 commented on GitHub (Sep 2, 2025):

thanks a lot @OpeOginni i think I'll wait and see if it will or will not be classified as a bug. If not I'll have to refactor my agentic workflows. Thank you for taking time and replying @OpeOginni

@musyoka101 commented on GitHub (Sep 2, 2025): thanks a lot @OpeOginni i think I'll wait and see if it will or will not be classified as a bug. If not I'll have to refactor my agentic workflows. Thank you for taking time and replying @OpeOginni
Author
Owner

@rekram1-node commented on GitHub (Sep 2, 2025):

@OpeOginni no problem tagging me, I read every single comment on every issue

@rekram1-node commented on GitHub (Sep 2, 2025): @OpeOginni no problem tagging me, I read every single comment on every issue
Author
Owner

@rekram1-node commented on GitHub (Sep 2, 2025):

i am pretty sure this is a bug

@rekram1-node commented on GitHub (Sep 2, 2025): i am pretty sure this is a bug
Author
Owner

@OpeOginni commented on GitHub (Sep 2, 2025):

@rekram1-node I was able to make a small fix (was just using the same pattern for recognising md in the Globals for the Project Instance).

Image Image Image

It seems to be working now based on that update. Ill try put in the PR, let me know if its sufficient or not 🙏

@OpeOginni commented on GitHub (Sep 2, 2025): @rekram1-node I was able to make a small fix (was just using the same pattern for recognising `md` in the Globals for the Project Instance). <img width="786" height="596" alt="Image" src="https://github.com/user-attachments/assets/c4d720bc-067c-45de-94b0-7147cf4e3aaa" /> <img width="256" height="133" alt="Image" src="https://github.com/user-attachments/assets/8862bac3-e863-4717-a948-685664499021" /> <img width="684" height="215" alt="Image" src="https://github.com/user-attachments/assets/08d94de3-d89b-4797-a4a9-be04551ade1a" /> It seems to be working now based on that update. Ill try put in the PR, let me know if its sufficient or not 🙏
Author
Owner

@rekram1-node commented on GitHub (Sep 2, 2025):

sounds good I will ask dax if the change was intentional first

@rekram1-node commented on GitHub (Sep 2, 2025): sounds good I will ask dax if the change was intentional first
Author
Owner

@rekram1-node commented on GitHub (Sep 2, 2025):

confirmed w/ him that it wasn't intentional

@rekram1-node commented on GitHub (Sep 2, 2025): confirmed w/ him that it wasn't intentional
Author
Owner

@rekram1-node commented on GitHub (Sep 2, 2025):

this will be fixed in next release thanks to @OpeOginni

@rekram1-node commented on GitHub (Sep 2, 2025): this will be fixed in next release thanks to @OpeOginni
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1563