mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-28 07:33:05 +00:00
fix(agent-pool): tick falhava em ERR_MODULE_NOT_FOUND (dotenv) (#72)
Os scripts do pool NAO sao dependency-free: agent-pool.mjs -> agent-github.mjs -> scripts/lib/cli.mjs -> dotenv. O workflow agora instala deps como os irmaos (pnpm/action-setup + cache + pnpm install --frozen-lockfile). Guard adicional: pull_request closed sem merge nao dispara o tick (ruido em todo PR de stage). Verificado localmente: o script carrega e para na leitura estrita de variables (fail-closed desenhado; em GHA o GITHUB_TOKEN tem actions:write). Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
This commit is contained in:
parent
b2b11c3dfe
commit
f357fcd780
2 changed files with 12 additions and 5 deletions
11
.github/workflows/agent-pool.yml
vendored
11
.github/workflows/agent-pool.yml
vendored
|
|
@ -51,13 +51,18 @@ jobs:
|
||||||
tick:
|
tick:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
# pull_request closed WITHOUT merge is not a replenish signal — skip.
|
||||||
|
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
# The pool scripts are dependency-free .mjs (gh CLI + native fetch) — no
|
cache: pnpm
|
||||||
# pnpm install, ticks stay under a minute.
|
# The pool scripts import scripts/lib/cli.mjs (dotenv) via agent-github —
|
||||||
|
# they are NOT dependency-free, so install like every sibling workflow.
|
||||||
|
- run: pnpm install --frozen-lockfile
|
||||||
- name: agent:pool workflow
|
- name: agent:pool workflow
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
@ -65,7 +70,7 @@ jobs:
|
||||||
ACTION: ${{ inputs.action }}
|
ACTION: ${{ inputs.action }}
|
||||||
MAX_SLOTS: ${{ inputs.maxSlots }}
|
MAX_SLOTS: ${{ inputs.maxSlots }}
|
||||||
run: |
|
run: |
|
||||||
# schedule / pull_request closed → reconcile tick; dispatch → the chosen action.
|
# schedule / pull_request merged → reconcile tick; dispatch → the chosen action.
|
||||||
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
|
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
|
||||||
args=(--action "$ACTION" --actor "$GITHUB_ACTOR")
|
args=(--action "$ACTION" --actor "$GITHUB_ACTOR")
|
||||||
if [ -n "$MAX_SLOTS" ]; then args+=(--max-slots "$MAX_SLOTS"); fi
|
if [ -n "$MAX_SLOTS" ]; then args+=(--max-slots "$MAX_SLOTS"); fi
|
||||||
|
|
|
||||||
|
|
@ -229,8 +229,10 @@ Parâmetros (só relevantes ao backoff de retry de tick): `spawnRetryBackoff = p
|
||||||
|
|
||||||
## 6. API de controle
|
## 6. API de controle
|
||||||
|
|
||||||
`pnpm agent:pool -- < comando >` → `scripts/agent-pool.mjs` (Node 24, zero deps npm: `gh` CLI +
|
`pnpm agent:pool -- < comando >` → `scripts/agent-pool.mjs` (Node 24; `gh` CLI + `fetch` nativo,
|
||||||
`fetch` nativo; roda no runner GHA sem `pnpm install`):
|
mas com a dependência transitiva habitual de `scripts/lib/cli.mjs` → `dotenv` — o workflow instala
|
||||||
|
deps como os workflows irmãos; corrigido em 2026-07-31 após o ERR_MODULE_NOT_FOUND da primeira
|
||||||
|
ativação):
|
||||||
|
|
||||||
| Comando | Faz |
|
| Comando | Faz |
|
||||||
| ----------------------- | ------------------------------------------------------------------------------------------------------ |
|
| ----------------------- | ------------------------------------------------------------------------------------------------------ |
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue