mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 10:44:21 +01:00
docs: subtask config option (#2682)
This commit is contained in:
@@ -1445,7 +1445,7 @@ export namespace SessionPrompt {
|
|||||||
})()
|
})()
|
||||||
|
|
||||||
const agent = await Agent.get(agentName)
|
const agent = await Agent.get(agentName)
|
||||||
if (agent.mode === "subagent" || command.subtask) {
|
if ((agent.mode === "subagent" && command.subtask !== false) || command.subtask === true) {
|
||||||
using abort = lock(input.sessionID)
|
using abort = lock(input.sessionID)
|
||||||
|
|
||||||
const userMsg: MessageV2.User = {
|
const userMsg: MessageV2.User = {
|
||||||
|
|||||||
@@ -227,6 +227,8 @@ This is shown as the description in the TUI when you type in the command.
|
|||||||
### Agent
|
### Agent
|
||||||
|
|
||||||
Use the `agent` config to optionally specify which [agent](/docs/agents) should execute this command.
|
Use the `agent` config to optionally specify which [agent](/docs/agents) should execute this command.
|
||||||
|
If this is a [subagent](/docs/agents/#subagents) the command will trigger a subagent invocation by default.
|
||||||
|
To disable this behavior, set `subtask` to `false`.
|
||||||
|
|
||||||
```json title="opencode.json"
|
```json title="opencode.json"
|
||||||
{
|
{
|
||||||
@@ -238,7 +240,26 @@ Use the `agent` config to optionally specify which [agent](/docs/agents) should
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This is an **optional** config option. If not specified, defaults to "build".
|
This is an **optional** config option. If not specified, defaults to your current agent.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Subtask
|
||||||
|
|
||||||
|
Use the `subtask` boolean to force the command to trigger a [subagent](/docs/agents/#subagents) invocation.
|
||||||
|
This useful if you want the command to not pollute your primary context.
|
||||||
|
|
||||||
|
```json title="opencode.json"
|
||||||
|
{
|
||||||
|
"command": {
|
||||||
|
"analyze": {
|
||||||
|
"subtask": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This is an **optional** config option.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user