Skip to content

implement: fleet OpenCode scheduled-task pattern — systemd timers + opencode run with per-job route #2232

Open

Description

@dezren39

Implement: fleet OpenCode scheduled-task pattern (systemd timers + opencode run, per-job route)

Follow-on from the #2019 investigation (LIST 4a, fleet program #2055). The investigation's verdict: OpenCode has no native scheduler (upstream anomalyco/opencode#41906 still open); the proven pattern is an OS timer firing opencode run --model opencode-route/<tier> — verified live 2026-10-29 with a one-shot systemd user timer on the laptop (fired on schedule, route resolved to opencode-go DeepSeek V4.1 Flash, exit 0, zero Muse tokens in trigger or execution).

Scope

  1. A small, committable job registry for fleet scheduled OpenCode tasks: one unit (or unit pair) per job under a managed directory, each naming cadence, workdir, prompt/command, and route (opencode-route/workhorse|specialist|summit|speed).
  2. Per-job run logs in a fixed location, readable by the babysitter/monitor (directory-scoped server-API reads are the reliable session surface; opencode session list is not).
  3. Migrate ONE real low-risk fleet job as the proof (a quota probe or census refresh — fire-and-forget, failure visible next round), and record the before/after Muse-token cost of its trigger.
  4. Considered and deferred (do not silently switch): adopting the v1 different-ai/opencode-scheduler plugin (needs a v2 port — the fleet fork cannot run v1 plugins) and waiting for upstream #41906.

Out of scope

Acceptance


Program: Drew's 2026-10-28 directive, fleet LIST 4a follow-on. Filed by queue worker task 3338, 2026-10-29.

Activity

  1. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  2. added
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  3. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: reviewed (coverage loop-back)
    Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7314 (triage, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
    Found via: coverage loop-back 2026-11-03

  4. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  6. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  7. 48 remaining items

  8. added
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 4, 2026
  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    Agent note — handed off to the opencode claimant (task 9170)

    Resume brief for the claimant session (carried from prior progress)

    • Branch queue/9170-2232-opencode-scheduled-task, worktree /home/user/git/fleet/task-9170 (laptop). Implementation: quota-freshness-summary job (hourly, opencode-route/workhorse) in pm-stack/opencode-scheduled-jobs/; systemd user service/timer installed but disabled; logs at ~/.local/state/opencode-scheduled/quota-freshness-summary/{latest.log,history.jsonl}; registry doc/fleet-schedule-registry.md updated.
    • Prior recorded evidence: bash pm-stack/opencode-scheduled-jobs/test.sh pass; systemd-analyze --user verify pass (unrelated existing warnings). PR feat(pm-stack): add OpenCode quota summary schedule pilot #5325 checks at last record: aggregator tests and typecheck FAILURE, other 2 checks passed — re-verify fresh.
    • Acceptance gaps still open: no scheduled firing observed (timer disabled; explicit enablement required before observing a full hourly cycle); Muse-token before/after delta on issue investigate: OpenCode native scheduled tasks — creation, route choice, independence from Muse tokens #2019 not measured (no telemetry proof); the pilot is a read-only quota freshness summary, not a replacement for quota-gatherer or pool-quota-steward.
  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked-up
    queue: repo-health-code-pilot
    task: 9170 (small_fix, worker repo-worker-code, lane ec118cad-0fd3-4652-91c4-27432f2f2efd)
    by: openchamber-scheduled-lane
    at: 2026-11-04T22:12:23.388Z

    Fresh revalidation: issue #2232 is OPEN; PR #5166 is MERGED. Canonical PR #5325 is still OPEN and draft, authored by dezren39, head 7b71609; checks show optional aggregator tests/typecheck FAILURE and it conflicts with main. No unresolved review threads. The task's prior progress assigns execution_lane=opencode and explicitly says not to edit, mark ready, or merge the Drew-owned PR absent owner direction. Claim labels are synced.
    next: escalate for Drew's explicit direction on ownership/authorization before any work touches PR #5325.

  11. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    user/escalatedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 4, 2026
  12. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: blocked (escalated-to-user)
    queue: repo-health-code-pilot
    task: 9170 (small_fix, worker repo-worker-code, lane ec118cad-0fd3-4652-91c4-27432f2f2efd)
    by: openchamber-scheduled-lane
    at: 2026-11-04T22:13:23.887Z

    Blocker for Drew: canonical PR #5325 is Drew-authored and explicitly marked do-not-edit/mark-ready/merge unless ownership changes or the owner directs. Fresh state: OPEN draft at 7b71609, conflicts with main, and its optional aggregator tests/typecheck check is failing; there are no unresolved review threads. This lane made no source or PR changes and ran no tests.
    required decision: please release/transfer ownership of #5325 or explicitly authorize a specific action; until then no worker should modify the canonical PR. The task is blocked with reason-class escalated-to-user; issue #2232 remains OPEN. Labels: queue/blocked + status/blocked + user/escalated; worker assignment labels removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority/highImportant and time-sensitivequeue/blockedQueue or user escalation statesource/creatorFiled by the new-issue-creator jobstatus/blockedQueue or user escalation statetask/triageQueue packet kind: verify, reproduce, and route this itemuser/escalatedQueue or user escalation state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions