Commit 5cfbd2e
Add opencode_cmd config override for custom executable path (#524)
## Summary
Add `opencode_cmd` config key so users can override the OpenCode
executable path, matching the existing pattern for `codex_cmd`,
`claude_code_cmd`, `cursor_cmd`, and `pi_cmd`.
This is the simplest unblocking approach (option 3) from #355, enabling
users to point roborev at a wrapper script that passes `--agent` or
other flags to opencode.
## Changes
- **`internal/config/config.go`** — Add `OpenCodeCmd` field to `Config`
struct with `toml:"opencode_cmd"` tag; set default `"opencode"` in
`DefaultConfig()`
- **`internal/agent/acp.go`** — Add `case *OpenCodeAgent:` branch in
`applyCommandOverrides` to apply the config override
- **`internal/agent/acp_test.go`** — Add
`TestGetAvailableWithConfigOpenCodeCmd` following the established test
pattern
## How to test
```bash
go test ./internal/config/... ./internal/agent/...
```
The new test creates a fake binary, sets `opencode_cmd` in config, and
verifies `GetAvailableWithConfig` resolves to the overridden path.
## Notes
- No changes needed in `keyval.go` or `config_cmd.go` — config keys are
auto-discovered via reflection on `toml` struct tags
- No docs changes — existing `*_cmd` keys are not documented in-repo
(README defers to roborev.io/configuration)
Closes #355 (option 3)
Co-authored-by: Sergey Trofimovsky <sergey.trofimovsky@trulioo.com>1 parent 0b8f2f1 commit 5cfbd2e
3 files changed
+40
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1536 | 1536 | | |
1537 | 1537 | | |
1538 | 1538 | | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
1539 | 1545 | | |
1540 | 1546 | | |
1541 | 1547 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1149 | 1149 | | |
1150 | 1150 | | |
1151 | 1151 | | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
1152 | 1184 | | |
1153 | 1185 | | |
1154 | 1186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
691 | 692 | | |
692 | 693 | | |
693 | 694 | | |
| 695 | + | |
694 | 696 | | |
695 | 697 | | |
696 | 698 | | |
| |||
0 commit comments