AFK runs in lab — autonomous ready-for-agent resolution #61

Closed
opened 2026-06-01 12:21:38 +02:00 by dominik.polakovics · 2 comments

What to build

lab gains the ability to run AFK runs (see CONTEXT.md): unattended claude --remote-control sessions that each take one ready-for-agent issue from a project's own Forgejo tracker, resolve it in an isolated git worktree, and open a PR — manually from a per-project context menu, or automatically via a per-project toggle.

Design is locked in ADR-0007 (docs/adr/0007-lab-drives-afk-runs.md) and the AFK run / Instance (lab) glossary entries in CONTEXT.md. The code lives at hosts/fw/vms/dev/modules/lab/.

Key decisions (rationale in ADR-0007):

  • lab selects + claims the issue (label flip ready-for-agent → in-progress) and seeds the specific issue number into the prompt; the agent only resolves it and opens the PR.
  • Each AFK run gets an isolated git worktree on branch afk/<N>, parked under ~/.local/state/lab/worktrees/ — outside ~/projects/ so the scanner can't list it as a bogus project.
  • claude --remote-control does not self-exit, so a run is "done" when a PR with head afk/<N> appears; it is a failure on session-death-without-PR or a ~45-min timeout.
  • Auto = serial, one run per project, under the global instance cap; 3 consecutive failures pause the project until reset from the UI.

Slices (tracer bullets)

  • Slice 1 — Manual AFK run via the menu (tracer; no blockers)
  • Slice 2 — Run lifecycle: auto-reap on PR, fail on death/timeout (blocked by Slice 1)
  • Slice 3 — Automatic AFK runs: per-project toggle + scheduler (blocked by Slices 1, 2)
  • Slice 4 — Safety cap + reset (blocked by Slices 2, 3)
  • Slice 5 — (N ready) count hint (blocked by Slices 1, 3)

Notes

  • Forgejo-only: detected by an origin under git.cloonar.com; non-Forgejo project cards show a disabled menu line.
  • Prerequisite: dominik needs a one-time tea login add on dev (covers both the lab's issue queries and the agent's tea pr create).
  • This is a tracking issue — it stays needs-triage and never gets ready-for-agent.
## What to build `lab` gains the ability to run **AFK runs** (see `CONTEXT.md`): unattended `claude --remote-control` sessions that each take one `ready-for-agent` issue from a project's own Forgejo tracker, resolve it in an isolated git worktree, and open a PR — manually from a per-project context menu, or automatically via a per-project toggle. Design is locked in **ADR-0007** (`docs/adr/0007-lab-drives-afk-runs.md`) and the **AFK run** / **Instance (lab)** glossary entries in `CONTEXT.md`. The code lives at `hosts/fw/vms/dev/modules/lab/`. Key decisions (rationale in ADR-0007): - `lab` selects + claims the issue (label flip `ready-for-agent → in-progress`) and seeds the specific issue number into the prompt; the agent only resolves it and opens the PR. - Each AFK run gets an isolated `git worktree` on branch `afk/<N>`, parked under `~/.local/state/lab/worktrees/` — outside `~/projects/` so the scanner can't list it as a bogus project. - `claude --remote-control` does not self-exit, so a run is "done" when a PR with head `afk/<N>` appears; it is a failure on session-death-without-PR or a ~45-min timeout. - Auto = serial, one run per project, under the global instance cap; 3 consecutive failures pause the project until reset from the UI. ## Slices (tracer bullets) - [ ] Slice 1 — Manual AFK run via the `⋯` menu (tracer; no blockers) - [ ] Slice 2 — Run lifecycle: auto-reap on PR, fail on death/timeout (blocked by Slice 1) - [ ] Slice 3 — Automatic AFK runs: per-project toggle + scheduler (blocked by Slices 1, 2) - [ ] Slice 4 — Safety cap + reset (blocked by Slices 2, 3) - [ ] Slice 5 — `(N ready)` count hint (blocked by Slices 1, 3) ## Notes - Forgejo-only: detected by an `origin` under `git.cloonar.com`; non-Forgejo project cards show a disabled menu line. - Prerequisite: `dominik` needs a one-time `tea login add` on `dev` (covers both the lab's issue queries and the agent's `tea pr create`). - This is a tracking issue — it stays `needs-triage` and never gets `ready-for-agent`.
Author
Owner

Slices created (dependency order):

  • #62 — Slice 1: Manual AFK run via the ⋯ menu (tracer) — no blockers
  • #63 — Slice 2: Run lifecycle (auto-reap on PR, fail on death/timeout) — blocked by #62
  • #64 — Slice 3: Automatic AFK runs (toggle + scheduler) — blocked by #62, #63
  • #65 — Slice 4: Safety cap + reset — blocked by #63, #64
  • #66 — Slice 5: (N ready) count hint — blocked by #62, #64

Dependency graph:

#62 → #63 → #64 → #65
#62 ───────→ #64 → #66

Triage #62 to ready-for-agent first — it is the bootstrap (built by hand, since AFK runs don't exist yet to build themselves); #63–#66 become AFK-able once it lands.

Slices created (dependency order): - [ ] #62 — Slice 1: Manual AFK run via the ⋯ menu (tracer) — no blockers - [ ] #63 — Slice 2: Run lifecycle (auto-reap on PR, fail on death/timeout) — blocked by #62 - [ ] #64 — Slice 3: Automatic AFK runs (toggle + scheduler) — blocked by #62, #63 - [ ] #65 — Slice 4: Safety cap + reset — blocked by #63, #64 - [ ] #66 — Slice 5: (N ready) count hint — blocked by #62, #64 Dependency graph: #62 → #63 → #64 → #65 #62 ───────→ #64 → #66 Triage #62 to `ready-for-agent` first — it is the bootstrap (built by hand, since AFK runs don't exist yet to build themselves); #63–#66 become AFK-able once it lands.
Author
Owner

This was generated by AI during triage.

Closing this tracking epic — all slices are resolved:

  • Slice 1 — Manual AFK run via the ⋯ menu — #62 (merged)
  • Slice 2 — Run lifecycle: auto-reap on PR / fail on death-timeout — #63 (merged)
  • Slice 3 — Automatic AFK runs: per-project toggle + scheduler — #64 (merged)
  • Slice 4 — Safety cap + reset — #65 (merged)
  • Slice 5 — (N ready) count hint — #66 (closed)

Plus AFK-agent isolation hardening (#76). The ADR-0007 AFK-run capability is in place.

Note: Slice 5 (#66) was closed without landing in main — the (N ready) hint is descoped rather than shipped. Reopen #66 if it's wanted later.

> *This was generated by AI during triage.* Closing this tracking epic — all slices are resolved: - Slice 1 — Manual AFK run via the ⋯ menu — #62 (merged) - Slice 2 — Run lifecycle: auto-reap on PR / fail on death-timeout — #63 (merged) - Slice 3 — Automatic AFK runs: per-project toggle + scheduler — #64 (merged) - Slice 4 — Safety cap + reset — #65 (merged) - Slice 5 — `(N ready)` count hint — #66 (closed) Plus AFK-agent isolation hardening (#76). The ADR-0007 AFK-run capability is in place. Note: Slice 5 (#66) was closed without landing in `main` — the `(N ready)` hint is descoped rather than shipped. Reopen #66 if it's wanted later.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/nixos#61
No description provided.