New version of agent loop #453

Closed
opened 2026-06-05 20:05:14 +00:00 by guettli · 2 comments
guettli commented 2026-06-05 20:05:14 +00:00 (Migrated from codeberg.org)

Implement plan of below comment

Implement plan of below comment
guettlibot commented 2026-06-05 20:55:02 +00:00 (Migrated from codeberg.org)

Implementation Plan: Update to new agentloop defaults

Context

The current loop/sharedinbox/ config predates two things that the new agentloop version introduces: (1) a standard -in-process inProcessLabel suffix (the sharedinbox config uses -in-progress), and (2) a merge.md prompt that automates CI + merge after a coding agent opens a PR. This plan adopts the agentloop defaults and drops project-specific prompt content, relying on the repo's own AGENTS.md and DEVELOPMENT.md for project context.


Step 1 — Pre-migration label check

Before renaming labels, verify that no Codeberg issues currently carry loop/plan-in-progress or loop/code-in-progress. If any do, wait for those agents to finish (or move the issues to NeedSupervisor) before proceeding. The old labels will become unused orphans on Codeberg after the rename and can be deleted manually afterward.


Step 2 — Update loop/sharedinbox/prompts/plan.md

Replace the current project-specific body with the agentloop default. The agent runs inside a clone of the repo and can read AGENTS.md / DEVELOPMENT.md directly — the explicit hints in the prompt are redundant.

---
inputLabel: loop/plan
inProcessLabel: loop/plan-in-process
outputLabel: loop/plan-done
concurrency: 3
---
You are a planning agent.

Read the issue description and write a concise, concrete implementation plan.
Your final message is posted back to the issue as a comment.

Do not change any code and do not open a pull request.

Key changes: loop/plan-in-progressloop/plan-in-process; concurrency: 13 (planning agents produce no PRs so can safely run in parallel); body replaced with generic default.


Step 3 — Update loop/sharedinbox/prompts/code.md

Replace with the agentloop example default, adding routes: { merge: loop/merge } so a successfully opened PR is handed off to the merge agent automatically.

---
inputLabel: loop/code
inProcessLabel: loop/code-in-process
outputLabel: loop/code-done
concurrency: 1
routes:
  merge: loop/merge
---
You are a coding agent working inside a clean checkout of this repository.

Implement the change requested in the issue description. Work only from the
issue title and body — there are no other instructions to read.

Guidelines:

- Keep the change focused: implement exactly what the issue asks, nothing more.
- Match the surrounding code's style, naming and structure. Read neighbouring
  files before writing new code.
- Add or update tests when you change behaviour, and make sure the existing
  checks pass.

When the work is done:

- Commit your work on a new branch named after the issue (for example
  issue-<NNNN>-short-description).
- Open a pull request that references the issue (e.g. "Closes #<NNNN>") with a
  short description of what changed and how you verified it.

Your final message is posted back to the issue as a comment, so summarise what
you did and link the pull request. End the message with the following marker
on its own line so agentloop hands the issue off to the merge prompt:

<!-- loop-route: merge -->

Key changes: loop/code-in-progressloop/code-in-process; body replaced with generic default; merge routing added.


Step 4 — Add loop/sharedinbox/prompts/merge.md

Copy the agentloop example merge.md verbatim — it is already generic and repo-agnostic. This prompt handles loop/merge issues: rebases the PR branch onto main if behind, polls CI, and merges once green. If CI cannot be made green it emits <!-- loop-route: escalate --> and moves the issue to NeedSupervisor.


Step 5 — Update AGENTS.md in the sharedinbox repo

Update the label workflow table, state diagram, and lifecycle section to match the new labels and add the merge step:

Label table:

Label Trigger Outcome
loop/plan Planning agent writes an implementation plan as a comment Issue moves to loop/plan-done
loop/code Coding agent implements the change, creates a branch + PR Issue routes to loop/merge
loop/merge Merge agent rebases, waits for CI, merges the PR Issue moves to loop/merge-done

State machine:

loop/plan  →  loop/plan-in-process  →  loop/plan-done
                                     ↘  NeedSupervisor

loop/code  →  loop/code-in-process  →  loop/merge (via route)
                                     ↘  NeedSupervisor

loop/merge →  loop/merge-in-process →  loop/merge-done
                                     ↘  NeedSupervisor

Also update the "Typical lifecycle" section to include the merge step (the merge agent closes the PR automatically via Closes #N; a human still reviews the PR before it merges, because the merge agent only runs CI and merges — it does not bypass review if branch protection is on).


Step 6 — No binary changes needed

The local agentloop binary already implements all of the above (routing, merge prompt, -in-process label convention). Only the config files under loop/sharedinbox/ and AGENTS.md in the SharedInbox repo need updating.

## Implementation Plan: Update to new agentloop defaults ### Context The current `loop/sharedinbox/` config predates two things that the new agentloop version introduces: (1) a standard `-in-process` inProcessLabel suffix (the sharedinbox config uses `-in-progress`), and (2) a `merge.md` prompt that automates CI + merge after a coding agent opens a PR. This plan adopts the agentloop defaults and drops project-specific prompt content, relying on the repo's own `AGENTS.md` and `DEVELOPMENT.md` for project context. --- ### Step 1 — Pre-migration label check Before renaming labels, verify that no Codeberg issues currently carry `loop/plan-in-progress` or `loop/code-in-progress`. If any do, wait for those agents to finish (or move the issues to `NeedSupervisor`) before proceeding. The old labels will become unused orphans on Codeberg after the rename and can be deleted manually afterward. --- ### Step 2 — Update `loop/sharedinbox/prompts/plan.md` Replace the current project-specific body with the agentloop default. The agent runs inside a clone of the repo and can read `AGENTS.md` / `DEVELOPMENT.md` directly — the explicit hints in the prompt are redundant. ```markdown --- inputLabel: loop/plan inProcessLabel: loop/plan-in-process outputLabel: loop/plan-done concurrency: 3 --- You are a planning agent. Read the issue description and write a concise, concrete implementation plan. Your final message is posted back to the issue as a comment. Do not change any code and do not open a pull request. ``` Key changes: `loop/plan-in-progress` → `loop/plan-in-process`; `concurrency: 1` → `3` (planning agents produce no PRs so can safely run in parallel); body replaced with generic default. --- ### Step 3 — Update `loop/sharedinbox/prompts/code.md` Replace with the agentloop example default, adding `routes: { merge: loop/merge }` so a successfully opened PR is handed off to the merge agent automatically. ```markdown --- inputLabel: loop/code inProcessLabel: loop/code-in-process outputLabel: loop/code-done concurrency: 1 routes: merge: loop/merge --- You are a coding agent working inside a clean checkout of this repository. Implement the change requested in the issue description. Work only from the issue title and body — there are no other instructions to read. Guidelines: - Keep the change focused: implement exactly what the issue asks, nothing more. - Match the surrounding code's style, naming and structure. Read neighbouring files before writing new code. - Add or update tests when you change behaviour, and make sure the existing checks pass. When the work is done: - Commit your work on a new branch named after the issue (for example issue-<NNNN>-short-description). - Open a pull request that references the issue (e.g. "Closes #<NNNN>") with a short description of what changed and how you verified it. Your final message is posted back to the issue as a comment, so summarise what you did and link the pull request. End the message with the following marker on its own line so agentloop hands the issue off to the merge prompt: <!-- loop-route: merge --> ``` Key changes: `loop/code-in-progress` → `loop/code-in-process`; body replaced with generic default; merge routing added. --- ### Step 4 — Add `loop/sharedinbox/prompts/merge.md` Copy the agentloop example `merge.md` verbatim — it is already generic and repo-agnostic. This prompt handles `loop/merge` issues: rebases the PR branch onto `main` if behind, polls CI, and merges once green. If CI cannot be made green it emits `<!-- loop-route: escalate -->` and moves the issue to `NeedSupervisor`. --- ### Step 5 — Update `AGENTS.md` in the sharedinbox repo Update the label workflow table, state diagram, and lifecycle section to match the new labels and add the merge step: **Label table:** | Label | Trigger | Outcome | |---|---|---| | `loop/plan` | Planning agent writes an implementation plan as a comment | Issue moves to `loop/plan-done` | | `loop/code` | Coding agent implements the change, creates a branch + PR | Issue routes to `loop/merge` | | `loop/merge` | Merge agent rebases, waits for CI, merges the PR | Issue moves to `loop/merge-done` | **State machine:** ``` loop/plan → loop/plan-in-process → loop/plan-done ↘ NeedSupervisor loop/code → loop/code-in-process → loop/merge (via route) ↘ NeedSupervisor loop/merge → loop/merge-in-process → loop/merge-done ↘ NeedSupervisor ``` Also update the "Typical lifecycle" section to include the merge step (the merge agent closes the PR automatically via `Closes #N`; a human still reviews the PR before it merges, because the merge agent only runs CI and merges — it does not bypass review if branch protection is on). --- ### Step 6 — No binary changes needed The local `agentloop` binary already implements all of the above (routing, merge prompt, `-in-process` label convention). Only the config files under `loop/sharedinbox/` and `AGENTS.md` in the SharedInbox repo need updating.
guettlibot commented 2026-06-07 06:58:55 +00:00 (Migrated from codeberg.org)

agentloop: issue was in progress but no agent run was found.

agentloop: issue was in progress but no agent run was found.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: guettli/sharedinbox#453