fix: guard against non-string input.arguments in OpenCode plugin (#557)

Wrap input.arguments with String() before calling .trim(), matching
the defensive pattern already used in the pi-extension (index.js:90).
Prevents TypeError if the host passes a non-string truthy value.

Fixes #553.

Co-authored-by: Emeriko <dietrich.gebert@gmail.com>
This commit is contained in:
guyoron1
2026-07-09 17:52:22 +02:00
committed by GitHub
co-authored by Emeriko
parent 8555a0a580
commit fee48ca59a
+1 -1
View File
@@ -84,7 +84,7 @@ export default async ({ client } = {}) => {
'command.execute.before': async (input) => {
if (!input || input.command !== 'ponytail') return;
// `off` is persisted like any mode; the transform reads it and stays silent.
const args = (input.arguments || '').trim();
const args = String(input.arguments || '').trim();
const mode = args ? normalizePersistedMode(args) : getDefaultMode();
if (!mode) return;
writeMode(mode);