fix(opencode): add question:deny to permission block for robust tool disabling

Per OpenCode GitHub issue workaround, add "question": "deny" to the
permission block in addition to the existing "tools":{"question":false}.

This ensures the question tool is disabled via both configuration methods,
preventing stdin hangs in batch mode.

Config now: {"permission":{"*":"allow","external_directory":"allow","question":"deny"},"tools":{"question":false}}
This commit is contained in:
Pedram Amini
2026-02-03 15:17:01 -06:00
parent ccabe75248
commit 63d15d1a16

View File

@@ -200,11 +200,14 @@ export const AGENT_DEFINITIONS: AgentDefinition[] = [
imageArgs: (imagePath: string) => ['-f', imagePath], // Image/file attachment: opencode run -f /path/to/image.png -- "prompt"
noPromptSeparator: true, // OpenCode doesn't need '--' before prompt - yargs handles positional args
// Default env vars: enable YOLO mode (allow all permissions including external_directory)
// Also disable the question tool - it waits for stdin input which hangs batch mode
// Disable the question tool via both methods:
// - "question": "deny" in permission block (per OpenCode GitHub issue workaround)
// - "question": false in tools block (original approach)
// The question tool waits for stdin input which hangs batch mode
// Users can override by setting customEnvVars in agent config
defaultEnvVars: {
OPENCODE_CONFIG_CONTENT:
'{"permission":{"*":"allow","external_directory":"allow"},"tools":{"question":false}}',
'{"permission":{"*":"allow","external_directory":"allow","question":"deny"},"tools":{"question":false}}',
},
// Agent-specific configuration options shown in UI
configOptions: [