Feature hasn't been suggested before
Describe the enhancement you want to request
permission.doom_loop is useful, but the current behavior appears to be hard-coded to trigger when the same tool call repeats 3 times with identical input. It would be helpful to make that repeat threshold configurable in opencode.json instead of fixed.
A configurable threshold would let users tune the guard for different workflows:
- lower values for tighter cost/safety control in autonomous runs
- higher values for iterative/debugging workflows where a few repeated retries are expected
A good direction would be to let permission.doom_loop accept staged thresholds directly:
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"doom_loop": {
"4": "ask",
"6": "deny"
}
}
}
That would allow progressive escalation instead of one fixed cutoff:
- 4+ repeated identical tool calls =>
ask
- 6+ repeated identical tool calls =>
deny
This feels more flexible than adding a separate top-level threshold field, because it keeps the behavior inside the existing permission system and supports multi-stage escalation naturally.
The exact config shape is up to you, but exposing the threshold this way would make the existing doom-loop protection much more practical.
Feature hasn't been suggested before
Describe the enhancement you want to request
permission.doom_loopis useful, but the current behavior appears to be hard-coded to trigger when the same tool call repeats 3 times with identical input. It would be helpful to make that repeat threshold configurable inopencode.jsoninstead of fixed.A configurable threshold would let users tune the guard for different workflows:
A good direction would be to let
permission.doom_loopaccept staged thresholds directly:{ "$schema": "https://opencode.ai/config.json", "permission": { "doom_loop": { "4": "ask", "6": "deny" } } }That would allow progressive escalation instead of one fixed cutoff:
askdenyThis feels more flexible than adding a separate top-level threshold field, because it keeps the behavior inside the existing permission system and supports multi-stage escalation naturally.
The exact config shape is up to you, but exposing the threshold this way would make the existing doom-loop protection much more practical.