Problem
Two presets cannot both contribute to the same array-valued config path. Existing modes:
replace — last writer wins; second install clobbers the first
merge — object key-merge only; doesn't apply to arrays
Concrete scenario
Today jdtls-lombok writes to `lsp.jdtls.command`:
```json
["jdtls", "--jvm-arg=-javaagent:{{cache}}/lombok.jar"]
```
If a future `jdtls-heap` preset also wanted to extend that command (e.g. `--jvm-arg=-Xmx4g`), there's no clean way to install both. Installing the second overwrites the first.
Same shape would hit any future preset that wants to add a JVM arg, classpath entry, or CLI flag to an LSP that's already configured by another preset.
Workarounds today
- Bundle into one preset (loses modularity)
- Hand-edit
opencode.json after install (breaks remove, breaks idempotency)
- Ship a personal preset via
OPENCODE_PRESETS_PATH that shadows the bundled one
Proposed direction (not committing to it)
A third mode — append / extend — that concatenates into the array at @path, deduping by exact element match. remove would strip exactly the elements the preset added.
Open questions:
- Dedup semantics (exact match? structural? by key prefix like `--jvm-arg=-javaagent:`?)
- Order guarantees across multiple appenders
- How
remove interacts with user-added entries that happen to match
Why file now
No real second use case yet. Filing so it's not lost when one shows up — don't implement speculatively.
Problem
Two presets cannot both contribute to the same array-valued config path. Existing modes:
replace— last writer wins; second install clobbers the firstmerge— object key-merge only; doesn't apply to arraysConcrete scenario
Today
jdtls-lombokwrites to `lsp.jdtls.command`:```json
["jdtls", "--jvm-arg=-javaagent:{{cache}}/lombok.jar"]
```
If a future `jdtls-heap` preset also wanted to extend that command (e.g. `--jvm-arg=-Xmx4g`), there's no clean way to install both. Installing the second overwrites the first.
Same shape would hit any future preset that wants to add a JVM arg, classpath entry, or CLI flag to an LSP that's already configured by another preset.
Workarounds today
opencode.jsonafter install (breaksremove, breaks idempotency)OPENCODE_PRESETS_PATHthat shadows the bundled oneProposed direction (not committing to it)
A third mode —
append/extend— that concatenates into the array at@path, deduping by exact element match.removewould strip exactly the elements the preset added.Open questions:
removeinteracts with user-added entries that happen to matchWhy file now
No real second use case yet. Filing so it's not lost when one shows up — don't implement speculatively.