setup-labels API is GitHub-only and uses an inconsistent label set
Environment
ao --version: 0.4.0 (also reproduces on 0.5.0 / main by code inspection atpackages/web/src/app/api/setup-labels/route.ts)- OS: macOS 26.3.1, arm64
- Node: v24.14.1
Summary
packages/web/src/app/api/setup-labels/route.ts is intended to pre-create the agent labels every project needs, but three issues make it unusable in practice for non-GitHub trackers and inconsistent with the rest of the orchestrator.
Three problems in 50 lines
1. Hardcoded to gh CLI without plugin dispatch.
The route shells out directly to gh label create --repo <project.repo> with no GH_HOST override. Effects per tracker:
| Tracker | setup-labels works? |
|---|---|
tracker-github |
yes (matches the hardcoded gh) |
tracker-gitlab |
no — gh doesn't speak GitLab; scm-gitlab/tracker-gitlab use glab |
tracker-forgejo |
no — gh with no GH_HOST won't reach a Forgejo host |
tracker-linear |
no — gh doesn't speak Linear |
The route bypasses the Tracker plugin abstraction entirely. The Tracker interface in @aoagents/ao-core/types.ts declares no label-management method, so there is no clean dispatch point today.
2. Label set inconsistent with services.ts.
The route creates: agent:backlog, agent:in-progress, agent:blocked, agent:done.
But pollBacklog / labelIssuesForVerification / relabelReopenedIssues in packages/web/src/lib/services.ts read and write a different set: agent:backlog, agent:in-progress, agent:done, merged-unverified.
Result: agent:blocked is created but never referenced by the orchestrator; merged-unverified is required by the verification flow but the route never creates it.
3. No caller wires the route up.
grep -rn "setup-labels" finds no UI button, CLI subcommand, or auto-trigger. The endpoint is dead from a UX perspective — operators would have to curl -X POST it manually, and even then, only GitHub projects would benefit.
Steps to reproduce (Forgejo example)
- Configure a project with
tracker.plugin: forgejo(Forgejorepo+host). - Ensure none of
agent:backlog,agent:in-progress,agent:done,merged-unverifiedexist as repo labels on the Forgejo repo. ao start, then open an issue on Forgejo and add labelagent:backlog(Forgejo accepts it as an ad-hoc string even without a repo-level entry).- Hit
curl http://localhost:3001/api/backlogto start the lazy poller. - Observe the orchestrator throw
Unable to resolve Forgejo label IDs for: agent:in-progresson every poll cycle when it tries to claim the issue. - Try
curl -X POST http://localhost:3001/api/setup-labels. The route claims success butgh label createeither fails or hits github.com — never the Forgejo host.
Expected vs. actual
Expected. A documented or in-product flow for creating the orchestrator's required labels on whatever tracker the project uses. The route (or its successor) should dispatch through registry.get("tracker", project.tracker.plugin) and create labels via the right API per provider.
Actual. Route shells gh directly with no GH_HOST — only github.com works. agent:blocked is created but never used; merged-unverified is required but never created. No caller invokes the route, so even GitHub users only benefit by hitting it by hand.
Relevant ao doctor output
Results: 17 PASS, 0 WARN, 0 FAIL, 0 FIXED
Environment looks healthy enough to run Agent Orchestrator.
Note: doctor does not currently check tracker labels — orthogonal to this issue but adds to the silent-failure surface.
Suggested fix shape
- Add
ensureLabels(labels: LabelSpec[]): Promise<void>(orcreateLabel+getLabelsprimitives) to theTrackerinterface in@aoagents/ao-core. - Implement per plugin:
tracker-githubviagh label createwithGH_HOSTtracker-gitlabviaglabor GitLab RESTtracker-forgejoviaPOST /repos/{owner}/{repo}/labels(already wired through the existingforgejoApihelper)tracker-linearno-op or skip (Linear doesn't have repo labels)
- Refactor
/api/setup-labelsto dispatch via the registry instead of shellingghdirectly. - Reconcile the canonical label set against
services.tsusage (either dropagent:blockedor wire it up; addmerged-unverified). - Wire a CLI command (
ao setup labels) and/or a dashboard button. Consider auto-running on first orchestrator boot in a project that's missing required labels.
Notes
Encountered while testing #1674 (Forgejo plugin rescue) against a real Forgejo instance. The bug is not introduced by that PR — the route exists unchanged on origin/main and tracker-gitlab would hit the same wall.
@prod-blip new issue from a non-collaborator.
Hi @raphaelbarreiros , thanks for filing this, it is really detailed and useful. I'm a contributor on AO and trying to get a sense of how it's working for folks using it in real workflows. Would love to hear a bit more about your experience and happy to hop on a quick 15-min call if that's easier. Here’s my calendly link https://calendly.com/atulpandey-iift1618/30min
Also, the contributors meet on Discord every day at 10pm IST: https://discord.gg/6KgeUjbe — drop in if you're around, good place to see what's being worked on and shape direction directly.