fix(loop): eval P1 fixes — prompt fidelity, multi-process safety, tool validation (0.7.2) - #17
Merged
Merged
Conversation
…, tool validation (0.7.2) Addresses the three P1 findings from the OpenCode/Claude Code /loop comparison eval (L10/L11/L14): - LOOP-001: flags (--once/--all/--jitter=*) are parsed only in the option prefix before the prompt begins; `--` terminates flag parsing; prompt text is kept as the original substring, so flag-like text, whitespace, and newlines in the body survive verbatim (was: silently stripped). - LOOP-002: tasks now record ownerPid/ownerStartedAt. Store load drops only tasks whose owner process is confirmed dead (signal-0 probe, conservative on probe errors); tasks owned by other live OpenCode processes survive and stay visible via --all. The instance lock now only serializes same-process instances (shouldFire), so a second process fires its own tasks instead of starving. - LOOP-003: shared validateFixedInterval (>=1000ms) used by the slash parser, loop_schedule create, and set_fixed; tool schema gains .min(1000); adaptive/maintenance create with intervalMs is rejected. Also: bare `/loop stop` cancels every task in scope (current session, or all sessions with --all); `/loop stop <id>` stays single-task cancel. Verified end-to-end against real opencode serve instances: L14 marker verbatim, L11 dual-process coexistence + dead-owner cleanup, L10 tool rejection, and stop scoping. 164/164 unit tests pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Fixes the three P1 findings from the OpenCode vs Claude Code
/loopcomparison eval (L10/L11/L14):--once/--all/--jitter=*) are only parsed in the option prefix before the prompt begins;--terminates flag parsing; the prompt is kept as the original substring — flag-like text, whitespace, and newlines in the body are preserved verbatim (previously silently stripped).ownerPid/ownerStartedAt; store load drops only tasks whose owner is confirmed dead (signal-0 probe, conservative on errors) instead of tombstoning everything written by another live process. Instance lock now only serializes same-process instances (shouldFire) — a second OpenCode process fires its own tasks instead of starving.validateFixedInterval(≥1000ms) across slash parser,loop_schedulecreate, andset_fixed; schema gains.min(1000); adaptive/maintenance create withintervalMsrejected.Also: bare
/loop stopcancels all tasks in scope (session, or all with--all).Test plan
npm test— 164/164 (new parser fidelity, dual-process store, shouldFire, tool validation, stop tests)opencode serveprocesses, same project):中文 空格 --once --all $HOMEwritten verbatim; one-shot fired once and auto-cleanedlist --allsees them; dead owner's tasks dropped on next loadloop_schedule(create, fixed, intervalMs=0)rejected, no ghost task/loop stopcancels only current-session tasks🤖 Generated with Claude Code