opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: Make breaking the agent loop on a tool deny configurable

Open baaym opened this issue 1 month ago • 4 comments

Currently the agent loop breaks in the case of a tool deny. It means the error is not automatically sent back to the LLM, and it requires user action to continue.

My preference, and perhaps that of others, is to continue the agent loop and have the error automatically fed back to the LLM.

To support this I added a new configuration option breakLoopOnToolDeny which defaults to true (current behavior). This allows users to change this behavior through their config.

Open questions

  • Is this feature desirable?
  • Is the naming of this configuration option correct? I see both camel case and snake case for config options. Also this could've move under 'experimental' options, but I don't know what the criteria are for that.
  • Does this require a change in the OpenCode config.json schema? I had some issues getting that sorted locally

baaym avatar Nov 25 '25 09:11 baaym

Build issues should be sorted now

baaym avatar Nov 26 '25 09:11 baaym

Friendly pinging @rekram1-node in case this PR was missed (as per comment on another PR)

baaym avatar Dec 10 '25 18:12 baaym

maybe you can make it an EXPERIMENTAL flag or experimental config option.

Could see people wanting ore control and stuff. Also can u name it in the same format of other options

rekram1-node avatar Dec 10 '25 19:12 rekram1-node

@rekram1-node thanks for your feedback! I updated the PR:

  • Moved the setting to the experimental section
  • Renamed it to break_loop_on_tool_deny

baaym avatar Dec 12 '25 11:12 baaym