feat(loop): fixed tasks run on creation, user-level loop.md, /proactive alias (0.8.0) - #24
Merged
Merged
Conversation
…ve alias (0.8.0) Claude Code alignment (v0.8.0 stage of the alignment report): - Fixed recurring tasks now execute immediately in the creation turn (Claude Code behavior) via a first-run prompt that confirms the schedule and performs the task; the next fire is anchored to creation time, keeping wall-clock semantics. One-shot (--once) tasks become due immediately instead, so the ticker fires them within one tick and auto-cancels. - Bare /loop now also reads the user-level ~/.opencode/loop.md when the project has none (priority: project > user > built-in default) — README already promised this but the code only checked the project. - /proactive is a full alias of /loop: bundled commands/proactive.md, the command hook accepts both names, and the run-mode chat.message fallback intercepts "/proactive ..." too. 182/182 tests pass. Verified against a real opencode serve: recurring fixed executed in the creation turn, once fired within seconds and auto-cancelled, /proactive created and ran its task, and bare /loop picked up ~/.opencode/loop.md. 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
Implements the v0.8.0 stage of the Claude Code alignment report:
--oncetasks become due immediately so the ticker fires them within one tick and auto-cancels.~/.opencode/loop.md(was 🔴 doc/code mismatch): bare/loopnow falls back to the user-level file when the project has none (priority: project > user > built-in default), matching the README's promise./proactivealias (Claude Code parity): bundledcommands/proactive.md, the command hook accepts both names, and the run-modechat.messagefallback intercepts/proactive ...too.Test plan
npm test— 182/182 (new run-now, once-immediate, user-level loop.md, alias tests; existing fire-cycle tests updated for run-now semantics)opencode serveE2E:/loop 10m …— assistant confirmed schedule AND executed the task in the same turn/loop 10s --once …— creation confirmation, fired within ~5s, auto-cancelled/proactive 10m …— task created and executed immediately/loopwith only~/.opencode/loop.mdpresent — maintenance task created from the user-level file🤖 Generated with Claude Code