Skip to content

Make Loop idle continuation explicit and reliable - #138

Merged
ByBrawe merged 30 commits into
mainfrom
fix/idle-loop-scheduling
Aug 22, 2026
Merged

Make Loop idle continuation explicit and reliable#138
ByBrawe merged 30 commits into
mainfrom
fix/idle-loop-scheduling

Conversation

@ByBrawe

@ByBrawe ByBrawe commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Goal

Make /loop behave like a reliable continuation/scheduling primitive instead of a timer that can silently stall.

Behavior

  • /loop <prompt> is the ergonomic infinite idle-loop form: when the current assistant turn stops and the session is safely idle, send the prompt again
  • /loop idle <prompt> is the explicit equivalent
  • /loop every 5m <prompt> is recurring and waits 5m before the first run
  • /loop after 5m <prompt> / /loop in 5m <prompt> is a one-shot delayed prompt
  • legacy /loop 5m <prompt> remains supported (starts on next idle, then interval cadence)
  • short continue / devam et prompts get project-aware continuation guidance so the agent resumes existing repository/conversation work instead of treating each turn as fresh

Reliability

  • recover OpenCode stale busy/retry before the first Loop run only when the latest assistant tail is actually completed and no tool/child work is active
  • log throttled busy deferrals instead of leaving loop.log at only add
  • show schedule type/state in /loop-status
  • show persisted enabled jobs from other sessions in /loop-doctor
  • block prompt-producing Loop continuation when dedicated /goal already owns the same session, unless --allow-goal-overlap is explicitly supplied

Refactor

  • centralize due-time/admission semantics in runtime/schedule-policy.js
  • isolate human schedule grammar, scheduler diagnostics, companion Goal detection, project/session diagnostics, and shorthand continuation guidance into focused modules
  • keep the committed single-file stable src/index.js regenerated from the modular source tree

Verification

  • focused syntax, schedule-policy, registration, status and stale-busy regression tests
  • comprehensive source/generated-bundle suites
  • real OpenCode host canary now literally starts /loop --max-runs 3 devam et, requires three autonomous turns, verifies persisted scheduleMode: idle, and confirms the run limit stops further turns
  • Ubuntu/Windows bundle-host canaries and stable OpenCode compatibility gates

Documentation

  • README rewritten around idle/every/after scheduling and project continuation
  • docs/SCHEDULING.md defines the schedule/admission contract, stale-busy recovery, status/doctor diagnostics, session-bound behavior and dedicated /goal coexistence

This remains draft only until the exact synchronized head is green.

ByBrawe and others added 30 commits August 22, 2026 12:28
@ByBrawe
ByBrawe marked this pull request as ready for review August 22, 2026 09:47
Copilot AI lite review requested due to automatic review settings August 22, 2026 09:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ByBrawe
ByBrawe merged commit 6ff8cf1 into main Aug 22, 2026
10 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.

2 participants