feat(scheduler): workflow recipes with confirm-before-create

Store self-contained playbook recipes on scheduled jobs, add schedule_propose draft gate, and run playbook instructions at fire time instead of only short reminders.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-07-14 09:58:39 +08:00
parent ad5d1db3c6
commit d036190195
10 changed files with 989 additions and 49 deletions

View file

@ -286,9 +286,16 @@ def _worker_loop(*, store: Any, worker_id: str, poll_interval_s: float) -> None:
if not system_prompt:
system_prompt = str(getattr(executor, "system_prompt", "") or "")
if is_scheduled_turn:
from runtime.scheduler.recipe import recipe_has_playbook
from runtime.scheduler.turn_text import scheduled_turn_system_suffix
system_prompt = str(system_prompt or "") + scheduled_turn_system_suffix(lang=lang)
playbook = bool((metadata or {}).get("scheduled_playbook")) or recipe_has_playbook(
payload.get("recipe") if isinstance(payload.get("recipe"), dict) else None
)
system_prompt = str(system_prompt or "") + scheduled_turn_system_suffix(
lang=lang,
playbook=playbook,
)
max_messages = int(store.get_setting("AIA_TURN_MAX_CONTEXT_MESSAGES") or 80)
max_tool_rounds = int(store.get_setting("AIA_TURN_MAX_TOOL_ROUNDS") or 100)