feat(opencode): allow general nested task via depth - #47106
samuelrizzo wants to merge 1 commit into
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: PR #32301: feat: nested sub-agent spawning (up to 5 levels) + fixes for #23091 / #13715
PR #37902: fix(acp): child/subagent session permission requests no longer hang forever
The current PR #47106 appears to be a targeted fix/improvement rather than a full duplicate. It specifically aligns the behavior of the |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Issue for this PR
No issue filed.
Type of change
What does this PR do?
Nested subagents need two things today: subagent_depth >= 2 and a task: allow override on the agent. The built-in general agent denies todowrite but says nothing about task, so deriveSubagentSessionPermission adds an implicit task deny and hides the tool from the child. That means setting subagent_depth: 2 alone is not enough for general -> general, which is surprising next to the docs.
This adds task: allow to the default permission of general (one line in packages/opencode/src/agent/agent.ts). The depth check in task.ts is untouched, so the default (depth=1) still blocks nesting; you only get one nested level when you explicitly opt in with subagent_depth: 2. I left explore alone since it is read-only by design, and I did not change the default depth.
How did you verify your code works?
I tried bun test test/tool/task.test.ts in packages/opencode but the suite does not boot in this env (missing @opentui/solid/preload), unrelated to this diff. I verified the one-line diff by reading deriveSubagentSessionPermission + visibleTools paths and confirmed the existing depth tests (prevents subagents from launching subagents by default, allows nested subagents up to the configured depth) cover the gate I left in place.
Screenshots / recordings
Not a UI change.
Checklist