anomalyco / anomalyco/opencode
Background subagent parameter hidden from tool schema when experimental flag is enabled
@neriousy is already working on this.
Since Aug 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Description
When OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true, the background parameter on the task tool is completely invisible to agents. The parameter exists in the code but never appears in the tool schema, so agents don't know it's available and never use it.
Root Cause
In packages/opencode/src/tool/task.ts:366:
jsonSchema: flags.experimentalBackgroundSubagents
? undefined
: ToolJsonSchema.fromSchema(BaseParameters),
When the flag is enabled, jsonSchema is set to undefined. The parameter definition itself (in Parameters) includes background, but since the schema is undefined, the agent never sees it.
Expected Behavior
When the experimental flag is on, the background parameter should be visible in the tool schema so agents can discover and use it.
Environment
- OpenCode version: 1.18.17+
- OS: Windows 11
- Config:
OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.