anomalyco / anomalyco/opencode

Background subagent parameter hidden from tool schema when experimental flag is enabled

Open
#45,345 0 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.