Skip to content
Closed
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
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,21 @@ The plugin will extract the command from the code block and run it when the agen

## Configuration

This plugin supports opencode V1 (>= 1.18.29) and V2.

### Plugin Options

The plugin accepts an `maxRetries` option (default: `10`) that controls the maximum number of times the agent will be re-prompted when the check command fails:
The plugin accepts a `maxRetries` option (default: `10`) that controls the maximum number of times the agent will be re-prompted when the check command fails.

V2:

```jsonc
{
"plugin": [{ "package": "bacluc-opencode-completion-check-command@<version>", "options": { "maxRetries": 10 } }],
}
```

V1:

```json
{
Expand All @@ -50,7 +62,7 @@ Setting `maxRetries` to `0` disables re-prompting entirely — the command runs

### Custom Command Template

The `/completion-check-command` is automatically registered by the plugin's `config` hook. If you want to override the template, add it to your `opencode.json`:
The `/completion-check-command` is automatically registered by the plugin. In V1 the plugin's `config` hook registers it, and an `opencode.json` override replaces the template (the plugin's `command.execute.before` hook still captures the command from the code block). V1 uses `command` and the `{{arguments}}` placeholder:

```json
{
Expand All @@ -63,6 +75,8 @@ The `/completion-check-command` is automatically registered by the plugin's `con
}
```

In V2 the plugin registers the command through the plugin API (`ctx.command.transform`) and reads the raw arguments itself, so the template cannot be overridden with a `command` entry: a same-named `command.completion-check-command` from config replaces the plugin's implementation and breaks command registration.

### Default Command Sources

On `session.created` the plugin resolves the default command in precedence order:
Expand Down
8 changes: 1 addition & 7 deletions opencode.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"$schema": "https://opencode.ai/config.json",
"command": {
"completion-check-command": {
"template": "The user wants to verify task completion after you finish. Run your task, and when you are done, a completion check will automatically run to verify your work.\n\nThe completion check command is:\n{{arguments}}",
"description": "Register a shell command that will be executed after the agent finishes to verify task completion. Include a markdown code block with the shell command to run."
}
},
"plugin": [[".", {}]]
"plugin": [{ "package": ".", "options": {} }]
}
Loading
Loading