Skip to content

feat(scheduler): #1174 — flow_yaml schedule action kind (inline YAML flow)#1265

Open
ohdearquant wants to merge 3 commits into
mainfrom
show/lionagi-sweep/sched-yaml
Open

feat(scheduler): #1174 — flow_yaml schedule action kind (inline YAML flow)#1265
ohdearquant wants to merge 3 commits into
mainfrom
show/lionagi-sweep/sched-yaml

Conversation

@ohdearquant

Copy link
Copy Markdown
Owner

New flow_yaml schedule action from the lionagi-sweep show (#1174) — schedule an inline YAML flow spec (same shape as li o flow -p). Critic APPROVE (CRIT:0 MAJ:0 MIN:1) after a redo: attempt 1 was correctly REJECTED (the YAML spec persisted as NULL and the tests bypassed the DB layer / false-greened); the gate caught it and the redo fixed all four blockers. 12 schedule tests pass (incl. a non-tautological round-trip); pre-commit ruff green.

What it does

  • New flow_yaml action kind: payload is a YAML flow spec, dispatched on fire via the same flow execution entry as flow/play (no re-parser, no stub).
  • YAML validated at schedule-creation time (clear error on malformed spec), not only at fire time.
  • Persisted correctly: action_flow_yaml threaded through INSERT + UPDATE allow-list + a migration (_drop_legacy_action_kind_check, mirroring the session-status-check rebuild) so existing DBs accept the new kind.
  • Lifecycle/status parity with the other action kinds (uniform under the feat(studio): invocation timeout + reap mechanism for stuck invocations #1170-1173 reapers).

Tests

12 passing incl. a DB round-trip test that fails-before / passes-after the persistence fix (the gap that false-greened attempt 1). Frontend schedule-builder UI for the new kind noted as a follow-up.

Closes #1174

🤖 Generated with Claude Code

ohdearquant and others added 2 commits June 3, 2026 15:02
Add a new schedule action kind `flow_yaml` whose payload is an inline
YAML flow spec (same format as `li o flow -p`). On fire it writes the
spec to a temp file and dispatches via the existing `li o flow -f` path,
reusing the real flow execution entry rather than reimplementing parsing.

- Validate the YAML spec at schedule-creation time (reject malformed or
  incomplete specs with a clear error), not only at fire time.
- Persist the `action_flow_yaml` payload: add it to the INSERT column
  list + value tuple in create_schedule and to the allowed set in
  update_schedule so it round-trips through StateDB.
- Add a registered migration (_drop_legacy_action_kind_check) that
  rebuilds the schedules table to include 'flow_yaml' in the action_kind
  CHECK, mirroring the existing legacy-check rebuild pattern and running
  after column reconciliation.
- Keep status reporting / invocation lifecycle uniform with the other
  action kinds so the reapers and monitor treat flow_yaml identically.
- Add tests/cli/test_scheduler_flow_yaml.py incl. a DB round-trip test
  proving the YAML payload survives create -> read -> update.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…l_complete

The four sync tests in test_scheduler_flow_yaml.py drove their coroutines via
asyncio.get_event_loop().run_until_complete(...), which raises
"RuntimeError: There is no current event loop" under pytest-xdist workers on
Python 3.10+ (no implicit loop in a non-main worker thread). asyncio.run()
creates and tears down a fresh loop per call — the correct modern idiom and a
drop-in for these isolated tests (exception propagation is identical, so the
try/except ValueError cases are unaffected).

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>
Co-Authored-By: Claude Opus 4.6 (1M context) <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

Development

Successfully merging this pull request may close these issues.

feat(studio): add YAML-specified flow as schedule trigger type

1 participant