Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ on a readline for the next.
| `permissions-build-tools` | Permissions | merge | Build tools (node, npm, mvn, gradle, make, python, pip, cargo, go) |
| `permissions-container-info` | Permissions | merge | Read-only docker, podman, oc inspection commands |
| `permissions-toolchain-info` | Permissions | merge | Version probes for common dev toolchains |
| `agent-runaway-guard` | Agent | merge | Adds step limits to built-in agents to prevent runaway tool loops |
| `default-agent-plan` | Agent | replace | Sets the default agent to "plan" so opencode always starts in plan mode instead of build mode |
| `tui-disable-mouse` | TUI | replace | Disables TUI mouse capture so native terminal selection and scrolling keep working |

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencode-presets",
"version": "0.8.6",
"version": "0.8.7",
"description": "Interactive CLI that patches OpenCode config files with curated presets — LSP, MCP, permissions, TUI.",
"type": "module",
"bin": {
Expand Down
24 changes: 24 additions & 0 deletions presets/agent-runaway-guard.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// @name: agent-runaway-guard
// @description: Adds practical step limits to opencode's built-in agents to
// prevent runaway tool loops while keeping normal coding workflows usable.
// @author: Jan <jan@trick77.com>
// @version: 0.1.0
// @path: agent
// @mode: merge
{
"build": {
"steps": 50
},
"plan": {
"steps": 20
},
"general": {
"steps": 15
},
"explore": {
"steps": 10
},
"scout": {
"steps": 10
}
}
27 changes: 27 additions & 0 deletions test/builtin-presets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,30 @@ test('ships a preset that makes webfetch ask before use', async () => {
webfetch: 'ask',
});
});

test('ships a runaway guard preset with step limits for built-in agents', async () => {
const preset = resolve(process.cwd(), 'presets/agent-runaway-guard.conf');

const { meta, body } = await parseConf(preset);

assert.equal(meta.name, 'agent-runaway-guard');
assert.equal(meta.path, 'agent');
assert.equal(meta.mode, 'merge');
assert.deepEqual(body, {
build: {
steps: 50,
},
plan: {
steps: 20,
},
general: {
steps: 15,
},
explore: {
steps: 10,
},
scout: {
steps: 10,
},
});
});