Skip to content

feat(studio): #1170 #1171 #1172 #1173 — self-healing session/invocation lifecycle reapers#1260

Open
ohdearquant wants to merge 1 commit into
mainfrom
show/lionagi-sweep/studio-lifecycle
Open

feat(studio): #1170 #1171 #1172 #1173 — self-healing session/invocation lifecycle reapers#1260
ohdearquant wants to merge 1 commit into
mainfrom
show/lionagi-sweep/studio-lifecycle

Conversation

@ohdearquant

Copy link
Copy Markdown
Owner

Self-healing Studio lifecycle from the lionagi-sweep show. Critic APPROVE (CRIT:0; the one MAJ on #1170 was resolved + tested before commit — the reactive flow self-expanded to fix its own gate via an escalation_request, a nice live validation of the #1253 pattern). 36 focused tests pass; pre-commit ruff green.

Mechanisms

Tests

36 passing across test_lifecycle_reapers, test_db_maintenance, test_adversarial_reapers (incl. per-kind override + TOCTOU re-guard). Sanctioned update_status() path used throughout.

Closes #1170
Closes #1171
Closes #1172
Closes #1173

🤖 Generated with Claude Code

Add four self-healing lifecycle mechanisms, all routing status changes
through the sanctioned StateDB.update_status() path (entity + history row):

- #1170 invocation timeout reaper: per-action-kind configurable deadline
  (LIONAGI_STUDIO_INVOCATION_DEADLINE_<KIND>_SECONDS, global 2h default) +
  zero-session grace; transitions stale running invocations to timed_out.
- #1171 session terminal-status enforcement: null-status detector reaps
  sessions whose process is dead to failed, never double-writing terminals.
- #1172 automatic phantom reaper: reuses list_phantom_sessions() detection,
  transitions to failed (reason phantom_reaped) on startup + periodically;
  manual "Prune all phantom" now delegates to it; phantom_count in health.
- #1173 state.db lifecycle: PRAGMA wal_checkpoint(TRUNCATE) on startup +
  hourly tick, Last-checkpoint/size-alert health fields, transactional
  FK-safe prune-old-data action.

Refs #1170 #1171 #1172 #1173

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ohdearquant added a commit that referenced this pull request Jun 3, 2026
…en config

PR #1231 was 1 commit / 66 behind main, bundling a parallel scheduler
(lionagi/runtime/scheduler.py SchedulerEngine + an engine-model
cli/schedule.py) that collided with main's shipped API-model scheduler
(flow_yaml #1265 + lifecycle reapers #1260, v0.26.15). It also carried
cli/config.py, which imports lionagi.config_resolution — a module that
exists nowhere in the tree (only survived via a try/except ImportError).

- Merge current main (de-stale: add_schedule_subparser now resolves).
- Drop lionagi/runtime/ (engine scheduler superseded by main's API model).
- Restore cli/schedule.py + cli/main.py to main's API-model scheduler.
- Drop cli/config.py (unsalvageable: missing config_resolution dependency).

Keeps the genuine work system (lionagi/work/: forms, rules, engine, worker)
plus the unique, tested cli/cleanup.py and cli/orchestrate/charter.py.
Net diff vs main: 13 additive files, work-system only. Was: 6 schedule-CLI
tests failing on stale import; now green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant