fix: strip opencode-run argv quotes before /loop fallback matching - #20
Merged
jkrandom-sudo merged 1 commit intoJul 30, 2026
Merged
Conversation
Review follow-up for #19: `opencode run "/loop 5m"` stores the user message with literal outer quotes (argv elements containing spaces are re-quoted), so the fallback regex /^\/loop.../ never matched real run-mode text and every deterministic guard was still bypassed end-to-end — the unit tests only simulated unquoted parts. - reuse stripOuterQuotes (now exported) before matching, mirroring handleUserCommand - scan remaining text parts instead of bailing on the first non-match - regression tests for double- and single-quoted command text and for /loop appearing in a later text part (12/12 run-mode tests, 176/176 overall, tsc clean) - verified end-to-end against a real `opencode run` with the built plugin: quoted cron input is now rejected deterministically and no task is created; a quoted valid interval creates the fixed task Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jkrandom-sudo
merged commit Jul 30, 2026
2c512d8
into
fix/issue-18-run-mode-fallback
3 checks passed
jkrandom-sudo
added a commit
that referenced
this pull request
Jul 30, 2026
fix: land quoted-text fallback fix on main (PR #20 follow-up)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #19 (review follow-up).
Problem
`opencode run "/loop 5m"` stores the user message with literal outer quotes — opencode re-quotes argv elements containing spaces, so `part.text` is `"/loop 5m"`, not `/loop 5m`. The fallback regex in #19 never matched real run-mode text, so every deterministic guard was still bypassed end-to-end. The #19 unit tests passed because they only simulated unquoted parts.
Evidence from a real session database:
```json
{"type": "text", "text": ""/loop */5 * * * * check something"", "synthetic": null}
```
(`synthetic: null` = the fallback never intercepted; a task was created from cron syntax.)
Fix
Tests
🤖 Generated with Claude Code