issue-agent: migrate to glimmung lease dispatch #152

Merged
nelsong6 merged 1 commit from glimmung-migration into main 2026-04-28 13:38:02 -07:00
nelsong6 commented 2026-04-28 13:27:37 -07:00 (Migrated from github.com)

Summary

Replaces the home-grown issue-agent.yml lock + issue-agent-worker.yml dispatch chain with glimmung as the entry point. Glimmung's webhook (glimmung.romaine.life/v1/webhook/github) receives the GitHub issues event, acquires a host venue from its Cosmos store via optimistic-CAS, and fires workflow_dispatch against this workflow with lease_id + host + issue_number. The lock now lives in glimmung's hosts container, not in a workflow holding a runner.

Changes

  • Delete .github/workflows/issue-agent.yml — the home-grown lock wrapper. Replaced by glimmung's optimistic-CAS on the host doc.
  • Rename .github/workflows/issue-agent-worker.yml → issue-agent.yaml — this is now the canonical entry point glimmung dispatches to.
  • New inputs: lease_id, host, issue_number (+ informational issue_title, gh_event, gh_action). Drops route_label, lock_run_id, dispatch_token.
  • New route job step: verify the glimmung lease via GET /v1/lease/{id}?project=spirelens. Assert state=active and host=inputs.host before any host-pinned phase runs. Capability auth — lease ID is a 128-bit ULID, possessing it is the proof.
  • route runner-label resolution is now deterministic: glimmung supplies the route label as inputs.host, this job derives the issue-agent-sts2-* resource label from its suffix and emits runs_on for each phase. No round-robin, no issue-label mutation, no gh api calls inside the route job.
  • Heartbeats at the start of test-plan, implementation, and verification. implementation additionally forks a background loop posting every 60s through the 30-min phase.
  • No explicit release step. Glimmung's workflow_run.completed webhook handler (subscribed to "Workflow runs" on the GitHub App) releases the lease automatically when this workflow finishes — including cancellation, runner-died, etc. The 1h TTL sweep is the ultimate backstop.

Operator setup (one-time)

  1. GitHub App → Subscribe to events → tick Workflow runs (alongside Issues).
  2. GitHub App → Webhook URL: https://glimmung.romaine.life/v1/webhook/github (already configured per earlier conversation).
  3. Glimmung admin: project spirelens (github_repo nelsong6/spirelens), workflow issue-agent (filename issue-agent.yaml, trigger_label issue-agent, requirements {\"apps\":[\"sts2\"]}), hosts named to match the existing runner route labels (issue-agent-runner-nelsonpc-user, issue-agent-runner-nelsonlaptop). Already done.

What stays unchanged

  • All three Claude phases (test-plan, implementation, verification) and their internal scripts.
  • Screenshot publishing, artifact upload, summary, PR creation.
  • The claim-issue and release-issue jobs (label-flipping for human visibility).
  • All runner labels on the actual GitHub Actions runners — no need to touch them.

Test plan

  • Tofu / build CI on this PR: lint passes, no other workflow disruption (touches only the two issue-agent files).
  • After merge: file a test issue with the issue-agent label. Confirm:
    • Glimmung dashboard shows a pending → active lease on one of the two hosts.
    • Workflow dispatched to the right runner.
    • Verify-lease step passes.
    • All three phases run, screenshots upload, PR opens.
    • Glimmung dashboard shows lease released after workflow_run.completed fires.
  • Concurrent test: file two issues 5s apart. Confirm both venues take work in parallel; if both busy when a 3rd lands, it sits in pending and promotes when the first completes.
## Summary Replaces the home-grown `issue-agent.yml` lock + `issue-agent-worker.yml` dispatch chain with [glimmung](https://github.com/nelsong6/glimmung) as the entry point. Glimmung's webhook ([glimmung.romaine.life/v1/webhook/github](https://glimmung.romaine.life/v1/webhook/github)) receives the GitHub `issues` event, acquires a host venue from its Cosmos store via optimistic-CAS, and fires `workflow_dispatch` against this workflow with `lease_id` + `host` + `issue_number`. The lock now lives in glimmung's `hosts` container, not in a workflow holding a runner. ## Changes - **Delete** `.github/workflows/issue-agent.yml` — the home-grown lock wrapper. Replaced by glimmung's optimistic-CAS on the `host` doc. - **Rename** `.github/workflows/issue-agent-worker.yml` → `issue-agent.yaml` — this is now the canonical entry point glimmung dispatches to. - **New inputs:** `lease_id`, `host`, `issue_number` (+ informational `issue_title`, `gh_event`, `gh_action`). Drops `route_label`, `lock_run_id`, `dispatch_token`. - **New `route` job step**: verify the glimmung lease via `GET /v1/lease/{id}?project=spirelens`. Assert `state=active` and `host=inputs.host` before any host-pinned phase runs. Capability auth — lease ID is a 128-bit ULID, possessing it is the proof. - **`route` runner-label resolution** is now deterministic: glimmung supplies the route label as `inputs.host`, this job derives the `issue-agent-sts2-*` resource label from its suffix and emits `runs_on` for each phase. No round-robin, no issue-label mutation, no `gh api` calls inside the route job. - **Heartbeats** at the start of `test-plan`, `implementation`, and `verification`. `implementation` additionally forks a background loop posting every 60s through the 30-min phase. - **No explicit release step.** Glimmung's `workflow_run.completed` webhook handler (subscribed to "Workflow runs" on the GitHub App) releases the lease automatically when this workflow finishes — including cancellation, runner-died, etc. The 1h TTL sweep is the ultimate backstop. ## Operator setup (one-time) 1. **GitHub App** → Subscribe to events → tick **Workflow runs** (alongside Issues). 2. **GitHub App** → Webhook URL: `https://glimmung.romaine.life/v1/webhook/github` (already configured per earlier conversation). 3. **Glimmung admin**: project `spirelens` (github_repo `nelsong6/spirelens`), workflow `issue-agent` (filename `issue-agent.yaml`, trigger_label `issue-agent`, requirements `{\"apps\":[\"sts2\"]}`), hosts named to match the existing runner route labels (`issue-agent-runner-nelsonpc-user`, `issue-agent-runner-nelsonlaptop`). Already done. ## What stays unchanged - All three Claude phases (test-plan, implementation, verification) and their internal scripts. - Screenshot publishing, artifact upload, summary, PR creation. - The `claim-issue` and `release-issue` jobs (label-flipping for human visibility). - All runner labels on the actual GitHub Actions runners — no need to touch them. ## Test plan - [ ] Tofu / build CI on this PR: lint passes, no other workflow disruption (touches only the two issue-agent files). - [ ] After merge: file a test issue with the `issue-agent` label. Confirm: - [ ] Glimmung dashboard shows a pending → active lease on one of the two hosts. - [ ] Workflow dispatched to the right runner. - [ ] Verify-lease step passes. - [ ] All three phases run, screenshots upload, PR opens. - [ ] Glimmung dashboard shows lease released after workflow_run.completed fires. - [ ] Concurrent test: file two issues 5s apart. Confirm both venues take work in parallel; if both busy when a 3rd lands, it sits in pending and promotes when the first completes.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/spirelens!152
No description provided.