Problem
When running OpenCode inside a Docker container or headless environment, the external_directory permission system blocks agents with interactive prompts that cannot be answered. Every new directory path triggers a new "Permission required" dialog.
The default permission rules include a hardcoded external_directory: * → ask catch-all that cannot be overridden via config — user-provided allow rules are prepended but the default ask comes after and takes precedence (last-match-wins).
Proposed Solution
Add a --yolo CLI flag (and/or autoApprove config option) that bypasses the interactive permission dialog for all tool requests, similar to Claude CLI's --dangerously-skip-permissions.
This would short-circuit the permission Request() method to return true immediately when enabled.
Use Case
- Running OpenCode as an agent inside Docker containers (e.g., Gas City multi-agent orchestration)
- CI/CD pipelines
- Any headless/non-interactive environment where the TUI permission prompt cannot be answered
Environment
- OpenCode 1.3.13
- Running inside Docker (Ubuntu 24.04)
- Agents get stuck on
external_directory permission prompts for paths like /workspace/.beads/formulas/*, /workspace/.gc/runtime/packs/dolt/*, etc.
Problem
When running OpenCode inside a Docker container or headless environment, the
external_directorypermission system blocks agents with interactive prompts that cannot be answered. Every new directory path triggers a new "Permission required" dialog.The default permission rules include a hardcoded
external_directory: * → askcatch-all that cannot be overridden via config — user-providedallowrules are prepended but the defaultaskcomes after and takes precedence (last-match-wins).Proposed Solution
Add a
--yoloCLI flag (and/orautoApproveconfig option) that bypasses the interactive permission dialog for all tool requests, similar to Claude CLI's--dangerously-skip-permissions.This would short-circuit the permission
Request()method to returntrueimmediately when enabled.Use Case
Environment
external_directorypermission prompts for paths like/workspace/.beads/formulas/*,/workspace/.gc/runtime/packs/dolt/*, etc.