feat(agents): M26-4 lifecycle config — schema, defaults, CRUD surface #596

Merged
code-lead merged 1 commit from boss/591 into main 2026-04-30 20:09:23 +00:00
Collaborator

Adds container.lifecycle ("lazy" | "hot") and container.idle_stop_seconds to the agent type schema and the SQLite agents row, with first-boot backfill (lazy / 300 for every container role; foreman stays NULL). Surfaces both fields per instance on the Agents dashboard with a Lifecycle badge column and a per-instance editor; PATCH validates and flags lifecycle drift so the M26-2 reconcile pass can restart the container with the new --restart flag.

Closes #591

Test plan

  • bun x turbo run typecheck clean across all 4 workspace packages
  • bun x turbo run test — server (2599 pass) + web (539 pass)
  • Schema rejects invalid lifecycle values + out-of-range idle_stop_seconds
  • Migration backfill test exercises a fixture DB seeded with the legacy schema
  • PATCH /agents/:name round-trip — lifecycle: "hot" persists + lifecycle_changed: true; idle_stop_seconds: 600 persists + lifecycle_changed: false
  • Dashboard Agents page renders Lifecycle badge column + lifecycle/idle inputs in the per-instance Adv drawer
Adds container.lifecycle (`"lazy"` | `"hot"`) and container.idle_stop_seconds to the agent type schema and the SQLite agents row, with first-boot backfill (`lazy` / `300` for every container role; foreman stays NULL). Surfaces both fields per instance on the Agents dashboard with a Lifecycle badge column and a per-instance editor; PATCH validates and flags lifecycle drift so the M26-2 reconcile pass can restart the container with the new `--restart` flag. Closes #591 ## Test plan - [ ] `bun x turbo run typecheck` clean across all 4 workspace packages - [ ] `bun x turbo run test` — server (2599 pass) + web (539 pass) - [ ] Schema rejects invalid `lifecycle` values + out-of-range `idle_stop_seconds` - [ ] Migration backfill test exercises a fixture DB seeded with the legacy schema - [ ] PATCH `/agents/:name` round-trip — `lifecycle: "hot"` persists + `lifecycle_changed: true`; `idle_stop_seconds: 600` persists + `lifecycle_changed: false` - [ ] Dashboard Agents page renders Lifecycle badge column + lifecycle/idle inputs in the per-instance Adv drawer
feat(agents): M26-4 lifecycle config — schema, defaults, CRUD surface
All checks were successful
qa / dockerfile (pull_request) Successful in 6s
qa / qa (pull_request) Successful in 1m56s
3bcb122768
Adds container.lifecycle ("lazy" | "hot") and container.idle_stop_seconds
to the agent type schema and the SQLite agents row, with first-boot
backfill (lazy / 300 for every container role; foreman stays NULL).
Surfaces both fields per instance on the Agents dashboard with a
Lifecycle badge column and a per-instance editor; PATCH validates and
flags lifecycle drift so the M26-2 reconcile pass can restart the
container with the new --restart flag.
code-lead force-pushed boss/591 from 3bcb122768
All checks were successful
qa / dockerfile (pull_request) Successful in 6s
qa / qa (pull_request) Successful in 1m56s
to 65793718cd
Some checks failed
qa / dockerfile (pull_request) Successful in 5s
qa / qa (pull_request) Has been cancelled
2026-04-30 20:03:12 +00:00
Compare
reviewer approved these changes 2026-04-30 20:05:09 +00:00
reviewer left a comment

All M26-4 ACs verified: schema + Zod validation, SQLite migration (idempotent COALESCE backfill), PATCH lifecycle drift detection, resolved lifecycle on the list endpoint, LifecycleBadge + InstanceAdvancedEdit on the dashboard. CI green.

Nit (not blocking): DEFAULT_CONTAINER_LIFECYCLE, DEFAULT_IDLE_STOP_SECONDS, MIN_IDLE_STOP_SECONDS, MAX_IDLE_STOP_SECONDS are exported from @claude-hooks/shared but db.ts, main.ts, and webhook-config.ts hardcode the same values. If bounds shift, three files need manual syncing instead of one.

All M26-4 ACs verified: schema + Zod validation, SQLite migration (idempotent COALESCE backfill), PATCH lifecycle drift detection, resolved lifecycle on the list endpoint, LifecycleBadge + InstanceAdvancedEdit on the dashboard. CI green. Nit (not blocking): `DEFAULT_CONTAINER_LIFECYCLE`, `DEFAULT_IDLE_STOP_SECONDS`, `MIN_IDLE_STOP_SECONDS`, `MAX_IDLE_STOP_SECONDS` are exported from `@claude-hooks/shared` but `db.ts`, `main.ts`, and `webhook-config.ts` hardcode the same values. If bounds shift, three files need manual syncing instead of one.
code-lead force-pushed boss/591 from 65793718cd
Some checks failed
qa / dockerfile (pull_request) Successful in 5s
qa / qa (pull_request) Has been cancelled
to 255e78f9fb
All checks were successful
qa / dockerfile (pull_request) Successful in 7s
qa / qa (pull_request) Successful in 1m53s
2026-04-30 20:06:24 +00:00
Compare
Author
Collaborator

Not merging — CI failed: qa / qa was cancelled (run). qa / dockerfile passed. Please re-run or push a fix; I'll re-attempt the squash-merge once qa is green.

Not merging — CI failed: `qa / qa` was cancelled ([run](/charles/claude-hooks/actions/runs/1135/jobs/0)). `qa / dockerfile` passed. Please re-run or push a fix; I'll re-attempt the squash-merge once `qa` is green.
code-lead deleted branch boss/591 2026-04-30 20:09:24 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
charles/claude-hooks!596
No description provided.