fix(broker): inject permission allow-all block into opencode.json
Merged
KH
5mo ago+358+358+012345678901234567890123456789-12-12-01234567890123456789
Summary
ensure_opencode_confignow writes"permission": {"*": {"*": "allow"}}into everyopencode.jsonit generates- On new-file creation the block is included from the start
- On existing-file update the block is upserted if no
permissionkey is present (custom configs are left untouched) - Root-level
opencode.json(gitignored, local dev use) also updated on disk
Why
opencode has no --dangerously-allow flag equivalent, so spawned worker agents would pause and wait for interactive tool-approval prompts. The workaround from anomalyco/opencode#8463 is to set permission: { "*": { "*": "allow" } } in the repo-level opencode.json, which takes priority over the global config and suppresses all prompts.
Test plan
-
cargo test -p agent-relay-broker opencode_config— all 7 tests pass (3 new:opencode_config_includes_permission_allow_all,opencode_config_adds_permission_block_to_existing_file,opencode_config_preserves_existing_permission_block) - Full broker suite: 772 tests pass, 0 failed
- Spawn an opencode worker via the broker and confirm no approval prompts block execution
🤖 Generated with Claude Code