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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user