fix: ignore invalid opencode mode arguments (#302)

Co-authored-by: sanmaxdev <sanmaxdev@users.noreply.github.com>
This commit is contained in:
Sangeeth Thilakarathna
2026-07-09 03:12:14 +02:00
committed by GitHub
co-authored by sanmaxdev
parent ca4dad252d
commit a3e0169c3d
2 changed files with 10 additions and 1 deletions
+3 -1
View File
@@ -92,7 +92,9 @@ 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 mode = normalizePersistedMode((input.arguments || '').trim()) || getDefaultMode();
const args = (input.arguments || '').trim();
const mode = args ? normalizePersistedMode(args) : getDefaultMode();
if (!mode) return;
writeMode(mode);
log('info', 'ponytail ' + mode);
},