Skip to content

fix: resolve issue #18 — deterministic /loop parsing in opencode run mode - #19

Merged
jkrandom-sudo merged 1 commit into
mainfrom
fix/issue-18-run-mode-fallback
Jul 30, 2026
Merged

fix: resolve issue #18 — deterministic /loop parsing in opencode run mode#19
jkrandom-sudo merged 1 commit into
mainfrom
fix/issue-18-run-mode-fallback

Conversation

@jkrandom-sudo

Copy link
Copy Markdown
Owner

Auto-generated by mini-swe-agent (Kimi K3). Please review carefully.

Summary

Restores deterministic /loop command parsing in opencode run mode (headless and -i), where the command.execute.before hook never fires. Missing-prompt errors, cron rejection, unknown-flag rejection, and the canonical LOOP_HELP text now work in run mode; the TUI path is guarded against double-handling.

Verification

  • 173/173 tests pass, including 9 new regression tests (tests/run-mode.test.mjs)
  • tsc --noEmit clean

closes #18

@jkrandom-sudo

Copy link
Copy Markdown
Owner Author

Review follow-up: the fallback regex does not match real opencode run message text because argv elements with spaces are re-quoted (part.text is "/loop 5m" with literal quotes), so the deterministic guards were still bypassed end-to-end. Verified against a live session database. Fix + regression tests + real e2e verification in #20 (stacked on this branch).

@jkrandom-sudo
jkrandom-sudo marked this pull request as ready for review July 30, 2026 08:35
@jkrandom-sudo
jkrandom-sudo merged commit 16ca47c into main Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deterministic /loop parsing bypassed in opencode run — documented guards (missing prompt, cron rejection, unknown flags) never fire

1 participant