Skip to content

[FEATURE]: Make doom_loop repeat threshold configurable #23531

Description

@jjangga0214

Feature hasn't been suggested before

  • I have verified this feature I'm about to request 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions