ci(bonk): resolve opencode permission defaults that ask interactively#770
Merged
ci(bonk): resolve opencode permission defaults that ask interactively#770
Conversation
opencode has two permission defaults that ask for approval rather than allowing or denying outright: - external_directory (any tool touching paths outside the project cwd) - doom_loop (same tool call repeating 3x with identical input) CI runs have no TTY, so the prompts deadlock until the workflow timeout fires. PR #769 dropped that timeout from 45 to 30 min, but the underlying hang is still there. The triggering case last week was a bash redirect (`git show ... > /tmp/foo`) which counts as touching an external directory. Set both explicitly in OPENCODE_CONFIG_CONTENT for all four bonk-family workflows. external_directory is deny-by-default with /tmp/** and ~/** allowed (the only legitimate external paths a CI agent needs: scratch files and home-dir caches). doom_loop is deny so a stuck loop aborts the run instead of waiting forever. read defaults stay as opencode ships them (allow with .env files denied) since that baseline is sensible.
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-i18n | 48e6aaf | Apr 25 2026, 10:18 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | 48e6aaf | Apr 25 2026, 10:19 AM |
0aveRyan
pushed a commit
to 0aveRyan/emdash
that referenced
this pull request
Apr 27, 2026
…emdash-cms#770) opencode has two permission defaults that ask for approval rather than allowing or denying outright: - external_directory (any tool touching paths outside the project cwd) - doom_loop (same tool call repeating 3x with identical input) CI runs have no TTY, so the prompts deadlock until the workflow timeout fires. PR emdash-cms#769 dropped that timeout from 45 to 30 min, but the underlying hang is still there. The triggering case last week was a bash redirect (`git show ... > /tmp/foo`) which counts as touching an external directory. Set both explicitly in OPENCODE_CONFIG_CONTENT for all four bonk-family workflows. external_directory is deny-by-default with /tmp/** and ~/** allowed (the only legitimate external paths a CI agent needs: scratch files and home-dir caches). doom_loop is deny so a stuck loop aborts the run instead of waiting forever. read defaults stay as opencode ships them (allow with .env files denied) since that baseline is sensible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Resolves the two opencode permission defaults that ask for approval (rather than allowing or denying outright):
external_directory— any tool touching paths outside the project cwddoom_loop— same tool call repeating 3x with identical inputCI runs have no TTY, so when either of these prompts fires the run deadlocks until the workflow timeout. #769 dropped that timeout from 45 to 30 min, but the underlying hang is still there. Last week the triggering case was a bash redirect (
git show ... > /tmp/foo) —/tmp/is outside the project cwd, so it trippedexternal_directory→ask→ 30-minute hang.Sets both explicitly in
OPENCODE_CONFIG_CONTENTfor all four bonk-family workflows:{ "permission": { "external_directory": { "*": "deny", "/tmp/**": "allow", "~/**": "allow" }, "doom_loop": "deny" } }/tmp/**and~/**cover the legitimate external paths a CI agent needs (scratch files, home-dir caches like~/.config/...). Everything else outside cwd is denied.doom_loopdenies so a stuck loop aborts the run instead of waiting forever.readdefaults stay as opencode ships them (allow with.env*files denied) — that baseline is sensible.Type of change
Checklist
pnpm typecheckpasses (no TS files touched)pnpm lintpasses (pnpm --silent lint:json | jq '.diagnostics | length'→0)pnpm testpasses (or targeted tests for my change) — N/A, CI workflow onlypnpm formathas been runAI-generated code disclosure
JSON content drafted with Claude Opus, validated against the live opencode config schema (
https://opencode.ai/config.json+ the embedded models.dev schema). Reviewed line by line.Screenshots / test output
Validated each workflow's
OPENCODE_CONFIG_CONTENTJSON parses and contains the expected permission rules:Repro from PR #769 logs: the run stalled exactly when the model issued
git show origin/main:packages/core/src/search/fts-manager.ts > /tmp/fts-main.ts. The> /tmp/...redirect crosses out of cwd, triggersexternal_directory: ask, and CI has no one to answer.Related: PR #769 (concurrency + auto-PR template + workflow timeout drop) — same workflow set, complementary fix.