The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
docs(cron): document non-blocking dispatch and host agent resolution
Steven Enamakel2cd251878d1a
diff --git a/crates/openhuman-core/src/cron/README.md b/crates/openhuman-core/src/cron/README.mdindex 2ebd49c5e5..7d7255360d 100644--- a/crates/openhuman-core/src/cron/README.md+++ b/crates/openhuman-core/src/cron/README.md@@ -362,8 +362,24 @@ Cron publishes, through [`core/bus.rs`](../core/bus.rs), these `DomainEvent` var- `scheduler_gate` lives here for historical reasons, but the poll loop does notconsult it. Its consumers are `modules/memory_host.rs` and[`security/credentials/`](../security/credentials/).-- Run Now and the poll loop share `ACTIVE_RUNS`. A long-running job blocks its- own next tick, not other jobs.+- Dispatch is non-blocking: each due job is spawned onto a `JoinSet` bounded by+ `scheduler.max_concurrent` (`scheduler/dispatch.rs`), so one long job does not hold+ up the poll loop. A job is claimed (`scheduler/in_flight.rs`, shared with Run Now and+ the `cron_run` tool) from dispatch until its run is persisted, and the scheduler never+ dispatches a claimed job. A recurring job's `next_run` is advanced at dispatch+ (at-most-once per slot), then recomputed from the finish time as before.+- Per-job `JobPolicy { retries, single_flight }` lives in a host-owned+ `cron_job_policies` table in `jobs.db` (`policy.rs`); `CronJob` belongs to+ `tinyflows-schedule`. No row is the default policy. `retries: Some(0)` means exactly one+ attempt; with `single_flight` a slot that comes due mid-run is recorded as a `skipped`+ run, and Run Now refuses while the job runs. The table stays in SQLite even with a+ storage backend configured.+- System jobs: `system_job_handlers::register(name, handler)` installs an awaited in-process+ handler; the scheduler still publishes `CronSystemJobDue`, then records the handler's+ result as the run's status. With no handler, behaviour is unchanged.+- Host agents: `agent::host_agents` is a process-wide `HostAgentResolver`. Cron agent jobs+ (`scheduler/agent_run.rs`) and workflow `agent` nodes consult it before the registries and run+ as the embedder's agent (its prompt, host tools and own `CoreContext`).- A cron agent turn must suppress transcript autoload, or it resumes anunrelated conversation. Any new cron path that builds a session host needs`start_cron_turn_clean`.diff --git a/crates/openhuman-embed/README.md b/crates/openhuman-embed/README.mdindex 14fdf31792..23e44bdc60 100644--- a/crates/openhuman-embed/README.md+++ b/crates/openhuman-embed/README.md@@ -586,8 +586,13 @@ their modules as `*_tests.rs`.```bashcargo test -p openhuman-embed --features inference,mcp,skillscargo test -p openhuman-embed --features inference,mcp,skills --test runtime_agents+cargo test -p openhuman-embed --features inference,mcp,skills --test cron_agents```+`tests/cron_agents.rs` runs a cron job as a runtime agent with its host tool under the+`TrustedAutomation { Cron }` origin, records a system job handler's error, and starts and+stops the scheduler with the runtime.+The repository-root [`examples/embed_headless.rs`](../../examples/embed_headless.rs) and [`examples/embed_kernel.rs`](../../examples/embed_kernel.rs)use this crate's `Runtime` (`Runtime::builder()`, then `core_runtime().invoke`for raw RPC methods). They are `[[example]]` targets of `openhuman-cli`: