fix: harden cron session automation flows
This commit is contained in:
@@ -947,7 +947,7 @@ def _run_gateway(
|
||||
from nanobot.bus.runtime_events import RuntimeEventBus
|
||||
from nanobot.channels.manager import ChannelManager
|
||||
from nanobot.cron.bound_runner import run_bound_cron_job
|
||||
from nanobot.cron.service import CronService
|
||||
from nanobot.cron.service import CronJobSkippedError, CronService
|
||||
from nanobot.cron.session_turns import is_bound_cron_job
|
||||
from nanobot.cron.types import CronJob
|
||||
from nanobot.providers.factory import build_provider_snapshot, load_provider_snapshot
|
||||
@@ -1167,12 +1167,14 @@ def _run_gateway(
|
||||
if is_bound_cron_job(job):
|
||||
return await run_bound_cron_job(job, agent=agent, cron=cron)
|
||||
|
||||
reason = "unbound agent cron job must be recreated from a chat session"
|
||||
logger.warning(
|
||||
"Cron: skipped unbound agent job '{}' ({}); recreate it from a chat session",
|
||||
"Cron: skipped unbound agent job '{}' ({}): {}",
|
||||
job.name,
|
||||
job.id,
|
||||
reason,
|
||||
)
|
||||
return None
|
||||
raise CronJobSkippedError(reason)
|
||||
|
||||
cron.on_job = on_cron_job
|
||||
|
||||
@@ -1191,6 +1193,7 @@ def _run_gateway(
|
||||
session_manager=session_manager,
|
||||
cron_service=cron,
|
||||
webui_runtime_model_name=_webui_runtime_model_name,
|
||||
webui_cron_pending_job_ids=getattr(agent, "pending_cron_job_ids_for_session", None),
|
||||
webui_static_dist=webui_static_dist,
|
||||
webui_runtime_surface=webui_runtime_surface,
|
||||
webui_runtime_capabilities=webui_runtime_capabilities,
|
||||
|
||||
Reference in New Issue
Block a user