Bug Description
The guardrails team plugin enforces a minimum of 2 tasks even for single-task investigation/read-only requests, causing team requires at least two tasks errors.
Steps to Reproduce
-
Send a long investigation request (500+ chars) to OpenCode, e.g.:
"We already have CI/CD deploying to Vercel and Cloud Run on develop merge. Just run supabase db query to apply the migration. Investigate and report."
-
The guardrails big() function detects this as a "large implementation request"
-
The parallel implementation gate activates, blocking all mutations until team is called
-
The AI tries to call team with 1 task (just the investigation)
-
Error: team requires at least two tasks
-
The AI is stuck: can't proceed without team, can't call team with < 2 tasks
Root Cause
File: packages/guardrails/profile/plugins/team.ts
Line 470 — hardcoded minimum:
if (args.tasks.length < 2) throw new Error("team requires at least two tasks")
Lines 730-751 — big() function over-triggers:
- Detects "large" requests by checking for implementation keywords + 500+ chars OR 3+ bullet points
- Investigation/read-only requests with verbose context trigger the same gate
- The gate blocks bash commands (even non-mutating ones) until
team is called
Line 565-580 — the gate mechanism:
if (item.tool === "bash" && !mut(String(out.args.command ?? ""))) return // Non-mutating should pass
Note: The code says non-mutating bash should pass through, but supabase db query may be classified as mutating by the mut() function, OR the "Permission required" prompt comes from the core permission system rather than the team gate.
Proposed Fix
Options (in order of preference):
- Allow single-task team calls: Remove or reduce the minimum to 1
- Exempt read-only/investigation requests: Don't trigger
big() gate for requests that don't contain write/implementation keywords
- Make minimum configurable: Add a config option like
"team": { "minTasks": 1 }
Environment
- OpenCode: built from source (dev branch)
- Guardrails profile: default
- macOS 15.4 (Darwin 25.4.0)
🤖 Generated with Claude Code
Bug Description
The guardrails team plugin enforces a minimum of 2 tasks even for single-task investigation/read-only requests, causing
team requires at least two taskserrors.Steps to Reproduce
Send a long investigation request (500+ chars) to OpenCode, e.g.:
The guardrails
big()function detects this as a "large implementation request"The parallel implementation gate activates, blocking all mutations until
teamis calledThe AI tries to call
teamwith 1 task (just the investigation)Error:
team requires at least two tasksThe AI is stuck: can't proceed without
team, can't callteamwith < 2 tasksRoot Cause
File:
packages/guardrails/profile/plugins/team.tsLine 470 — hardcoded minimum:
Lines 730-751 —
big()function over-triggers:teamis calledLine 565-580 — the gate mechanism:
Note: The code says non-mutating bash should pass through, but
supabase db querymay be classified as mutating by themut()function, OR the "Permission required" prompt comes from the core permission system rather than the team gate.Proposed Fix
Options (in order of preference):
big()gate for requests that don't contain write/implementation keywords"team": { "minTasks": 1 }Environment
🤖 Generated with Claude Code