Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(cron, tools): update READMEs for execute_job_now and MCP registry

Steven Enamakel5c2146847232
diff --git a/crates/openhuman-core/src/cron/README.md b/crates/openhuman-core/src/cron/README.md
index 0076a80efa..56d9029191 100644
--- a/crates/openhuman-core/src/cron/README.md
+++ b/crates/openhuman-core/src/cron/README.md
@@ -8,7 +8,7 @@ Scheduled-job runtime. Owns cron-expression and human-delay parsing, the persist
- `pub fn add_once` / `pub fn add_once_at` / `pub fn parse_human_delay` / `pub fn pause_job` / `pub fn resume_job` / `pub fn update_cron_job` — `ops.rs` (also re-exported as `pub use ops as rpc`).
- `pub fn schedule_cron_expression` / `pub fn next_run_for_schedule` / `pub fn normalize_expression` / `pub fn validate_schedule` / `pub fn validate_agent_schedule` / `pub fn runs_closer_than` / `pub struct TooFrequent` / `pub const MIN_AGENT_JOB_INTERVAL` — `schedule.rs`.
- `pub fn add_job` / `pub fn add_agent_job` / `pub fn add_agent_job_with_definition` / `pub fn add_shell_job` / `pub fn add_flow_schedule_job` / `pub fn find_flow_schedule_job` / `pub fn due_jobs` / `pub fn get_job` / `pub fn list_jobs` / `pub fn list_runs` / `pub fn record_last_run` / `pub fn record_run` / `pub fn remove_job` / `pub fn reschedule_after_run` / `pub fn update_job` — `store.rs` (split into `store_part_01.rs` / `store_part_02.rs` via `include!`).
-- `pub mod scheduler` (`pub async fn run(config: Config)`) — `scheduler.rs`, split via `include!` into `scheduler_part_01.rs` (poll loop, `run`, failure classifiers), `scheduler_part_02.rs` (`execute_job_with_retry`, per-job-type execution, `run_agent_job`, `build_agent_for_cron_job`, `run_flow_schedule_job`) and `scheduler_part_03.rs` (`deliver_if_configured`, `run_job_command_with_timeout`).
+- `pub mod scheduler` (`pub async fn run(config: Config)`, `pub async fn execute_job_now` for the `cron.run` "Run Now" path) — `scheduler.rs`, split via `include!` into `scheduler_part_01.rs` (poll loop, `run`, `execute_job_now`, failure classifiers), `scheduler_part_02.rs` (`execute_job_with_retry`, per-job-type execution, `run_agent_job`, `build_agent_for_cron_job`, `run_flow_schedule_job`) and `scheduler_part_03.rs` (`deliver_if_configured`, `run_job_command_with_timeout`).
- `pub mod scheduler_gate` — throttles *background* LLM work (memory digests, embeddings, summarisation) on host power / CPU signals via `current_policy()` / `wait_for_capacity()`. It lives here for historical reasons; the cron poll loop does not consult it, and its consumers are `modules/memory_host.rs` and `security/credentials/`. See its own [README](scheduler_gate/README.md).
- `pub mod seed` — `seed.rs` — `seed_proactive_agents` installs the built-in proactive jobs when onboarding flips to completed (`config/ops/ui.rs`); `prune_retired_jobs` removes rows for removed features on boot and workspace activation.
- `pub mod bus` — `bus.rs` — `CronDeliverySubscriber` (`cron::delivery`) consumes `CronDeliveryRequested` and sends through the named `tinychannels_bus::Channel`.
@@ -17,13 +17,13 @@ Scheduled-job runtime. Owns cron-expression and human-delay parsing, the persist
## Job types
-- **`shell`** — `run_job_command_with_timeout` refuses the command unless the scheduler's `SecurityPolicy` (built once in `scheduler::run` via `SecurityPolicy::from_config`) passes `can_act`, `is_rate_limited`, and `is_command_allowed`; a `blocked by security policy:` result is never retried.
+- **`shell`** — `run_job_command_with_timeout` refuses the command unless the `SecurityPolicy` (`SecurityPolicy::from_config`, built once in `scheduler::run` and per call in `execute_job_now`) passes `can_act`, `is_rate_limited`, and `is_command_allowed`; a `blocked by security policy:` result is never retried.
- **`agent`** — the scheduler builds an `Agent` directly and runs a turn (see below); it does not go through `agent::triage`.
- **`flow`** — a `flows::Flow` schedule-trigger binding. `flows/ops_part_06.rs::bind_schedule_trigger` creates it via `add_flow_schedule_job` (idempotent through `find_flow_schedule_job`) from both `flows_set_enabled` and `reconcile_schedule_triggers_on_boot`. Its `command` column carries the bound flow's id; on fire `run_flow_schedule_job` publishes `DomainEvent::FlowScheduleTick { flow_id }` instead of running anything itself. `flows::bus::FlowTriggerSubscriber` does the actual dispatch. Never created via the `cron_add` agent tool, whose `job_type` enum is `shell` / `agent` only.
### Agent jobs
-`run_agent_job` prefixes the prompt (`[cron:<id> <name>] <prompt>`), applies a per-job `model` override to a cloned `Config`, and, when `job.agent_id` names a definition in `AgentDefinitionRegistry`, applies that definition's model hint, iteration cap, and prompt body. `build_agent_for_cron_job` then picks the constructor: `Agent::from_config_for_agent_with_profile` when `job.profile_id` still resolves through `agent::profiles::load_profiles` (the same profile-aware path the task dispatcher uses, so the run inherits the profile's SOUL, memory scope, and tool/skill/MCP allowlists), `Agent::from_config_for_agent` when only `agent_id` is set (falling back to `Agent::from_config` if the definition fails to build), or `Agent::from_config` otherwise. A deleted profile is warned about and the job runs profile-less.
+`run_agent_job` prefixes the prompt (`[cron:<id> <name>] <prompt>`), applies a per-job `model` override to a cloned `Config`, and, when `job.agent_id` names a definition in `AgentDefinitionRegistry`, resolves that definition's `ModelSpec` onto the cloned config (the iteration cap is left to the session builder, see #4868). `build_agent_for_cron_job` then picks the constructor: `Agent::from_config_for_agent_with_profile` when `job.profile_id` still resolves through `agent::profiles::load_profiles` (the same profile-aware path the task dispatcher uses, so the run inherits the profile's SOUL, memory scope, and tool/skill/MCP allowlists), `Agent::from_config_for_agent` when only `agent_id` is set (falling back to `Agent::from_config` if the definition fails to build), or `Agent::from_config` otherwise. A deleted profile is warned about and the job runs profile-less.
`execute_job_with_retry` wraps every job type with `config.reliability.scheduler_retries` attempts and exponential backoff. For agent jobs it classifies failures before retrying: backend session-expired, provider insufficient-credits (402), managed-backend budget-exhausted (400), API-key-unset, and local-LLM-unreachable all halt the loop immediately and suppress the retries-exhausted error report. The user-facing message is a canned string from `classify_agent_anyhow_for_user`; the raw error goes only to observability.
diff --git a/crates/openhuman-core/src/tools/README.md b/crates/openhuman-core/src/tools/README.md
index 0f742e48be..58148acb04 100644
--- a/crates/openhuman-core/src/tools/README.md
+++ b/crates/openhuman-core/src/tools/README.md
@@ -96,14 +96,14 @@ None. No `store.rs`; the module holds no persisted state. Tools that persist (me
## Dependencies
- `crate::agent` — `host_runtime` (`RuntimeAdapter`/`NativeRuntime`), `tool_policy::GeneratedToolRuntimeContext`, harness definitions (`AgentDefinition`, `SubagentEntry`) for orchestrator tool synthesis, and the agent-owned dispatch tools re-exported here.
-- `crate::config` — `Config`, `BrowserConfig`, `HttpRequestConfig`, `SearchEngine`, `DelegateAgentConfig`; drives all registration gating and `config::rpc::load_config_with_timeout` in RPC handlers.
+- `crate::config` — `Config`, `BrowserConfig`, `HttpRequestConfig`, `DelegateAgentConfig`; drives all registration gating and `config::rpc::load_config_with_timeout` in RPC handlers.
- `crate::search` — active search engine registry and search-owned tool implementations.
- `crate::security` — `SecurityPolicy` (host/path/command gating threaded into nearly every tool) + `AuditLogger`.
- `crate::memory` — `memory::ops::guard::active_memory_guard` (read by `tool_stats`) and the memory-owned tool sets re-exported here; the registry takes no `Memory` handle itself.
- `crate::integrations` — `build_client` backend HTTP client + the integration tool structs (apify, brave, parallel, stock, twilio, tinyfish, google_places, querit, seltz, searxng).
- `crate::integrations::composio` — `all_composio_agent_tools`, mode-aware client (`create_composio_client`) for `openhuman.tools_composio_execute`.
- `crate::runtime::javascript` / `crate::runtime::python` — `NodeBootstrap` shared by shell/node_exec/npm_exec (behind `runtime-node`), `PythonBootstrap` for `python_exec`.
-- `crate::mcp::config_servers` / `crate::mcp::registry` — generic remote MCP server registry + bridge tools (`mcp` feature).
+- `crate::mcp::config_servers` (`McpServerRegistry` behind the `mcp_*` bridge tools and the gitbooks MCP source) and `crate::mcp::registry` (tool re-exports; `connections` for the discovery registry) — `mcp` feature.
- `tinytools` (vendored via `vendor/tinyagents/`) — the `Tool` trait itself and its vocabulary, re-exported through `traits.rs`.
- `crate::skills` — skill-run spawning and skill-owned tools (`skills` feature).
- `crate::agent::learning` — LinkedIn enrichment scrape/render for the Apify RPC handler.