From fee48ca59a61060088cb993242d91d5b967653fa Mon Sep 17 00:00:00 2001 From: guyoron1 <116871962+guyoron1@users.noreply.github.com> Date: Thu, 9 Jul 2026 18:52:22 +0300 Subject: [PATCH] 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 --- .opencode/plugins/ponytail.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.opencode/plugins/ponytail.mjs b/.opencode/plugins/ponytail.mjs index 6a77468..2e02783 100644 --- a/.opencode/plugins/ponytail.mjs +++ b/.opencode/plugins/ponytail.mjs @@ -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);