mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
Merge pull request #211 from fsolla/cursor/agent-pool-default-12-slots
Agent pool — default 12 concurrent cloud agent slots
This commit is contained in:
commit
dde938bbb1
5 changed files with 20 additions and 16 deletions
|
|
@ -11,7 +11,7 @@ description: >-
|
||||||
|
|
||||||
# Agent pool — operação do supervisor remoto
|
# Agent pool — operação do supervisor remoto
|
||||||
|
|
||||||
O pool mantém até **5 Cursor Cloud Agents** (configurável, máx 8) rodando `work-issue` sobre Issues `ready` elegíveis para autonomia. O supervisor é **determinístico** (não é um agente): workflow **`.github/workflows/agent-pool.yml`** (tick stateless a cada 10 min + a cada merge em `main` + sob dispatch) rodando `scripts/agent-pool.mjs`. Arquitetura e elegibilidade: `docs/plans/agent-pool-orchestrator.md`.
|
O pool mantém até **12 Cursor Cloud Agents** (configurável, máx 16) rodando `work-issue` sobre Issues `ready` elegíveis para autonomia. O supervisor é **determinístico** (não é um agente): workflow **`.github/workflows/agent-pool.yml`** (tick stateless a cada 10 min + a cada merge em `main` + sob dispatch) rodando `scripts/agent-pool.mjs`. Arquitetura e elegibilidade: `docs/plans/agent-pool-orchestrator.md`.
|
||||||
|
|
||||||
**O pool NUNCA deploya** — deploy gated fica em `ci.yml` após merge em `main`.
|
**O pool NUNCA deploya** — deploy gated fica em `ci.yml` após merge em `main`.
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ Apresente, nesta ordem:
|
||||||
1. **Estado do pool** — `desligado` | `ligado` | `pausado`; `maxSlots`; `startedAt`/`startedBy` se houver; slots `ocupados/max`.
|
1. **Estado do pool** — `desligado` | `ligado` | `pausado`; `maxSlots`; `startedAt`/`startedBy` se houver; slots `ocupados/max`.
|
||||||
2. **Workers ativos** (se houver) — Issue #N, URL do agente, classificação do tick (ocupado / auto-merge / …).
|
2. **Workers ativos** (se houver) — Issue #N, URL do agente, classificação do tick (ocupado / auto-merge / …).
|
||||||
3. **Fila elegível** (`isAutonomousClaimable`, mesma ordem do claim) — lista completa ou as primeiras ~15 se longa.
|
3. **Fila elegível** (`isAutonomousClaimable`, mesma ordem do claim) — lista completa ou as primeiras ~15 se longa.
|
||||||
4. **Próximas N em paralelo** — destaque as primeiras **`maxSlots`** (default **5**) entradas da fila elegível: são as que o próximo tick claimaria/spawnaria ao ligar (ou no tick seguinte se já ligado com gap). Inclua `#`, id, `model:`, título.
|
4. **Próximas N em paralelo** — destaque as primeiras **`maxSlots`** (default **12**) entradas da fila elegível: são as que o próximo tick claimaria/spawnaria ao ligar (ou no tick seguinte se já ligado com gap). Inclua `#`, id, `model:`, título.
|
||||||
5. **Exclusões relevantes** — `needs:consent` / `blocked` / deps / `migration-busy` (não precisam da lista inteira se for barulho; cite as que o humano costuma achar “por que não entrou”).
|
5. **Exclusões relevantes** — `needs:consent` / `blocked` / deps / `migration-busy` (não precisam da lista inteira se for barulho; cite as que o humano costuma achar “por que não entrou”).
|
||||||
|
|
||||||
### Confirmação de start (pool desligado)
|
### Confirmação de start (pool desligado)
|
||||||
|
|
@ -79,7 +79,7 @@ Pergunte de forma explícita, por exemplo:
|
||||||
## Operação remota (canal canônico = workflow_dispatch)
|
## Operação remota (canal canônico = workflow_dispatch)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm agent:pool -- start # liga (default 5 slots) — só após confirmação no fluxo acima
|
pnpm agent:pool -- start # liga (default 12 slots) — só após confirmação no fluxo acima
|
||||||
pnpm agent:pool -- start -- --max-slots 3
|
pnpm agent:pool -- start -- --max-slots 3
|
||||||
pnpm agent:pool -- stop # para de spawnar; ativos drenam até o merge
|
pnpm agent:pool -- stop # para de spawnar; ativos drenam até o merge
|
||||||
pnpm agent:pool -- pause # audit solitário / manutenção
|
pnpm agent:pool -- pause # audit solitário / manutenção
|
||||||
|
|
@ -112,4 +112,4 @@ Os wrappers disparam `gh workflow run agent-pool.yml -f action=…`; acompanhe c
|
||||||
## Se algo quebrar
|
## Se algo quebrar
|
||||||
|
|
||||||
- `tick` vermelho no Actions: ler o log do job — gh sem `actions:write` (permissões do workflow), `CURSOR_API_KEY` ausente/errada, ou API da Cursor fora. O tick seguinte re-tenta; nada fica em estado intermediário perigoso (claim revertido em falha de spawn).
|
- `tick` vermelho no Actions: ler o log do job — gh sem `actions:write` (permissões do workflow), `CURSOR_API_KEY` ausente/errada, ou API da Cursor fora. O tick seguinte re-tenta; nada fica em estado intermediário perigoso (claim revertido em falha de spawn).
|
||||||
- "You’ve reached the limit" no spawn: arquivar agents antigos em cursor.com/agents (cap do plano: 8 simultâneos no Pro; o pool usa ≤5 para deixar margem a humanos).
|
- "You’ve reached the limit" no spawn: arquivar agents antigos em cursor.com/agents (cap do plano Cursor por tier; o pool default é 12).
|
||||||
|
|
|
||||||
2
.github/workflows/agent-pool.yml
vendored
2
.github/workflows/agent-pool.yml
vendored
|
|
@ -33,7 +33,7 @@ on:
|
||||||
- tick
|
- tick
|
||||||
- status
|
- status
|
||||||
maxSlots:
|
maxSlots:
|
||||||
description: 'Slots simultâneos (só com action=start; default 5, máx 8)'
|
description: 'Slots simultâneos (só com action=start; default 12, máx 16)'
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
name: Agent pool orchestrator
|
name: Agent pool orchestrator
|
||||||
overview: 'Supervisor remoto stateless (GitHub Actions tick) que mantém até 5 Cursor Cloud Agents rodando work-issue sobre Issues ready; claim coordenado pelo supervisor, modelo da Issue no spawn, estado em repo variables + derivação; promote stage→main continua humano.'
|
overview: 'Supervisor remoto stateless (GitHub Actions tick) que mantém até 12 Cursor Cloud Agents rodando work-issue sobre Issues ready; claim coordenado pelo supervisor, modelo da Issue no spawn, estado em repo variables + derivação; promote stage→main continua humano.'
|
||||||
todos:
|
todos:
|
||||||
- id: fase0-spike
|
- id: fase0-spike
|
||||||
content: 'Spike API Cursor: GET /v1/models, spawn com model explícito, agentId idempotente, boot real'
|
content: 'Spike API Cursor: GET /v1/models, spawn com model explícito, agentId idempotente, boot real'
|
||||||
|
|
@ -24,7 +24,7 @@ isProject: false
|
||||||
|
|
||||||
## 1. Resumo executivo
|
## 1. Resumo executivo
|
||||||
|
|
||||||
Um **supervisor remoto stateless** mantém até **5 Cursor Cloud Agents** em paralelo, cada um
|
Um **supervisor remoto stateless** mantém até **12 Cursor Cloud Agents** em paralelo, cada um
|
||||||
executando `work-issue` sobre uma GitHub Issue `ready` e elegível para autonomia. O supervisor
|
executando `work-issue` sobre uma GitHub Issue `ready` e elegível para autonomia. O supervisor
|
||||||
é um **workflow do GitHub Actions** (`.github/workflows/agent-pool.yml`) que roda
|
é um **workflow do GitHub Actions** (`.github/workflows/agent-pool.yml`) que roda
|
||||||
`node scripts/agent-pool.mjs tick` a cada 10 minutos, a cada merge em `stage`, e sob
|
`node scripts/agent-pool.mjs tick` a cada 10 minutos, a cada merge em `stage`, e sob
|
||||||
|
|
@ -62,7 +62,7 @@ flowchart TB
|
||||||
Tick <--> Derive
|
Tick <--> Derive
|
||||||
end
|
end
|
||||||
|
|
||||||
subgraph workers [Workers — Cursor Cloud Agents, cap 5]
|
subgraph workers [Workers — Cursor Cloud Agents, cap 12]
|
||||||
Spawn["POST /v1/agents — prompt work-issue + model da Issue"]
|
Spawn["POST /v1/agents — prompt work-issue + model da Issue"]
|
||||||
W["worker × N: claim pré-feito → implementa → PR base stage → watch CI até merge"]
|
W["worker × N: claim pré-feito → implementa → PR base stage → watch CI até merge"]
|
||||||
Spawn --> W
|
Spawn --> W
|
||||||
|
|
@ -78,7 +78,7 @@ flowchart TB
|
||||||
|
|
||||||
Cada tick é um job curto (< 2 min) e idempotente que executa, nesta ordem:
|
Cada tick é um job curto (< 2 min) e idempotente que executa, nesta ordem:
|
||||||
|
|
||||||
1. **Lê config** — repo variables: `POOL_ENABLED`, `POOL_MAX_SLOTS` (default 5), `POOL_PAUSED`,
|
1. **Lê config** — repo variables: `POOL_ENABLED`, `POOL_MAX_SLOTS` (default 12), `POOL_PAUSED`,
|
||||||
`POOL_STARTED_AT`, `POOL_STARTED_BY`.
|
`POOL_STARTED_AT`, `POOL_STARTED_BY`.
|
||||||
2. **Sai cedo** se `POOL_ENABLED != true` ("pool desligado") ou `POOL_PAUSED == true`
|
2. **Sai cedo** se `POOL_ENABLED != true` ("pool desligado") ou `POOL_PAUSED == true`
|
||||||
("pausado — audit solitário").
|
("pausado — audit solitário").
|
||||||
|
|
@ -129,7 +129,7 @@ O step "set/get variables" usa `gh variable` com `GITHUB_TOKEN` e `permissions:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# start (qualquer máquina/phone com gh auth; também via browser Actions → Run workflow)
|
# start (qualquer máquina/phone com gh auth; também via browser Actions → Run workflow)
|
||||||
gh workflow run agent-pool.yml -f action=start # maxSlots default 5
|
gh workflow run agent-pool.yml -f action=start # maxSlots default 12
|
||||||
gh workflow run agent-pool.yml -f action=start -f maxSlots=3
|
gh workflow run agent-pool.yml -f action=start -f maxSlots=3
|
||||||
|
|
||||||
# stop (para de spawnar; ativos drenam naturalmente até o merge)
|
# stop (para de spawnar; ativos drenam naturalmente até o merge)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
* `pnpm agent:pool` — agent pool supervisor CLI
|
* `pnpm agent:pool` — agent pool supervisor CLI
|
||||||
* (docs/plans/agent-pool-orchestrator.md).
|
* (docs/plans/agent-pool-orchestrator.md).
|
||||||
*
|
*
|
||||||
* The pool keeps up to POOL_MAX_SLOTS (default 5) Cursor Cloud Agents running
|
* The pool keeps up to POOL_MAX_SLOTS (default 12) Cursor Cloud Agents running
|
||||||
* work-issue over `ready` autonomous-eligible issues. The supervisor is
|
* work-issue over `ready` autonomous-eligible issues. The supervisor is
|
||||||
* REMOTE: a stateless GitHub Actions tick (`.github/workflows/agent-pool.yml`)
|
* REMOTE: a stateless GitHub Actions tick (`.github/workflows/agent-pool.yml`)
|
||||||
* runs `workflow --action …` / `tick --live`; humans drive it via
|
* runs `workflow --action …` / `tick --live`; humans drive it via
|
||||||
|
|
@ -62,6 +62,7 @@ import {
|
||||||
decidePoolAutoStop,
|
decidePoolAutoStop,
|
||||||
parsePoolConfig,
|
parsePoolConfig,
|
||||||
parsePoolEvents,
|
parsePoolEvents,
|
||||||
|
POOL_DEFAULT_MAX_SLOTS,
|
||||||
POOL_OCCUPIED_CLASSES,
|
POOL_OCCUPIED_CLASSES,
|
||||||
POOL_VARIABLE_NAMES,
|
POOL_VARIABLE_NAMES,
|
||||||
reconcilePoolClaims,
|
reconcilePoolClaims,
|
||||||
|
|
@ -430,7 +431,10 @@ const runWorkflow = async ({ action, actor, maxSlots }) => {
|
||||||
writePoolVariable(POOL_VARIABLE_NAMES.startedAt, now)
|
writePoolVariable(POOL_VARIABLE_NAMES.startedAt, now)
|
||||||
writePoolVariable(POOL_VARIABLE_NAMES.startedBy, actor || 'desconhecido')
|
writePoolVariable(POOL_VARIABLE_NAMES.startedBy, actor || 'desconhecido')
|
||||||
writePoolVariable(POOL_VARIABLE_NAMES.paused, 'false')
|
writePoolVariable(POOL_VARIABLE_NAMES.paused, 'false')
|
||||||
if (maxSlots) writePoolVariable(POOL_VARIABLE_NAMES.maxSlots, String(maxSlots))
|
writePoolVariable(
|
||||||
|
POOL_VARIABLE_NAMES.maxSlots,
|
||||||
|
String(maxSlots ? Number.parseInt(maxSlots, 10) : POOL_DEFAULT_MAX_SLOTS),
|
||||||
|
)
|
||||||
log(`pool ligado por ${actor ?? '?'} (${now})`)
|
log(`pool ligado por ${actor ?? '?'} (${now})`)
|
||||||
await runTick({ dryRun: false })
|
await runTick({ dryRun: false })
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ export const POOL_VARIABLE_NAMES = {
|
||||||
startedBy: 'POOL_STARTED_BY',
|
startedBy: 'POOL_STARTED_BY',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const POOL_DEFAULT_MAX_SLOTS = 5
|
export const POOL_DEFAULT_MAX_SLOTS = 12
|
||||||
// Cursor Pro allows 8 concurrent cloud agents (plan §14); the pool leaves the
|
// Pro+ / Ultra allow more than Pro's 8 concurrent cloud agents; hard cap is a
|
||||||
// remaining slots for human sessions.
|
// pool safety rail, not the Cursor plan limit.
|
||||||
export const POOL_HARD_MAX_SLOTS = 8
|
export const POOL_HARD_MAX_SLOTS = 16
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Record<string, string | undefined>} [vars] raw `gh api` variable map
|
* @param {Record<string, string | undefined>} [vars] raw `gh api` variable map
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue