feat(studio): #1170 #1171 #1172 #1173 — self-healing session/invocation lifecycle reapers#1260
Open
ohdearquant wants to merge 1 commit into
Open
feat(studio): #1170 #1171 #1172 #1173 — self-healing session/invocation lifecycle reapers#1260ohdearquant wants to merge 1 commit into
ohdearquant wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-healing Studio lifecycle from the
lionagi-sweepshow. 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
LIONAGI_STUDIO_INVOCATION_DEADLINE_<KIND>_SECONDS); over-deadline / zero-session-past-grace running invocations transition totimed_outvia the sanctionedupdate_status(). (services/lifecycle.py,config.py)phantom_reaped), reusing the manual Admin prune logic. (services/admin.py,scheduler/engine.py)PRAGMA wal_checkpoint(TRUNCATE), size-threshold alert surfaced in System Health, prune-old-data action. (services/db_maintenance.py)Tests
36 passing across
test_lifecycle_reapers,test_db_maintenance,test_adversarial_reapers(incl. per-kind override + TOCTOU re-guard). Sanctionedupdate_status()path used throughout.Closes #1170
Closes #1171
Closes #1172
Closes #1173
🤖 Generated with Claude Code