From 9a60a350da95c185fa954ccf5b81e2d0b071e28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Ign=C3=A1cio=20Fontoura=20Solla?= Date: Sun, 2 Aug 2026 18:55:50 -0300 Subject: [PATCH] ops: one-shot workflow to archive a Cursor Cloud agent Unmerged helper to cancel+archive pool workers with the repo CURSOR_API_KEY. --- .github/workflows/archive-cursor-agent.yml | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/archive-cursor-agent.yml diff --git a/.github/workflows/archive-cursor-agent.yml b/.github/workflows/archive-cursor-agent.yml new file mode 100644 index 00000000..6f29a808 --- /dev/null +++ b/.github/workflows/archive-cursor-agent.yml @@ -0,0 +1,50 @@ +# One-shot operator helper — do not merge; run with --ref then delete branch. +name: Archive Cursor agent (ops) +on: + workflow_dispatch: + inputs: + agent_id: + description: Cursor agent id (bc-…) + required: true + type: string + run_id: + description: Cursor run id (run-…) optional cancel first + required: false + type: string +jobs: + archive: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v5 + with: + node-version-file: .nvmrc + - name: Cancel run (if any) + archive agent + env: + CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }} + AGENT_ID: ${{ inputs.agent_id }} + RUN_ID: ${{ inputs.run_id }} + run: | + node --input-type=module <<'NODE' + import { + archiveCursorAgent, + cancelCursorRun, + } from './scripts/lib/agent-pool-cursor.mjs' + + const agentId = process.env.AGENT_ID + const runId = process.env.RUN_ID?.trim() + if (!process.env.CURSOR_API_KEY) { + console.error('CURSOR_API_KEY missing') + process.exit(1) + } + if (runId) { + try { + await cancelCursorRun(agentId, runId) + console.log('cancelled', runId) + } catch (error) { + console.warn('cancel failed (continuing):', error.message) + } + } + await archiveCursorAgent(agentId) + console.log('archived', agentId) + NODE