Skip to content

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

docs(cron): update README with current registration state and tool details

Steven Enamakel4fc7fcaba16b
diff --git a/crates/openhuman-core/src/cron/tools/README.md b/crates/openhuman-core/src/cron/tools/README.md
index 4fc9f6d19b..1fb810c85b 100644
--- a/crates/openhuman-core/src/cron/tools/README.md
+++ b/crates/openhuman-core/src/cron/tools/README.md
@@ -2,54 +2,74 @@
Agent-facing tools over the `cron` domain. Six per-operation tools
(`add.rs`, `list.rs`, `update.rs`, `remove.rs`, `run.rs`, `runs.rs`) are the
-implementation; `collapsed.rs` wraps them into the single `CronTool` the
-model actually sees. Re-exported wholesale by `crate::tools::mod` (`pub use
-crate::cron::tools::*`).
+implementation; `collapsed.rs` wraps them into a single action-dispatched
+`CronTool`. All seven are re-exported wholesale by `crate::tools` (`pub use
+crate::cron::tools::*` in `tools/mod.rs`).
+
+Every tool first checks `config.cron.enabled` and returns an error result
+when cron is disabled.
+
+## Registration state
+
+`tools/ops.rs::all_tools` registers the six per-operation tools and **not**
+`CronTool`. The `CronTool` registration added in `61618e7e8b` ("expose
+collapsed scheduler tool") was dropped by `4a6f9b7082` ("align merge
+resolution with main APIs"), before the crate refactor. The six members still
+report `ToolExposure::Hidden` (`fn exposure`), which
+`tools/impl/meta/tool_search.rs` strips from the advertised catalogue, so at
+this commit the scheduler surface is dispatchable by name (replayed
+transcripts, saved skills, `user_filter.rs` family `cron`, toolpack
+`scheduling`) but no cron tool is advertised to the model. The `//!` docs in
+`tools.rs` and `collapsed.rs` describe the intended wiring, not the current
+one.
## Collapsed dispatch (`collapsed.rs`)
`CronTool` (`CRON_TOOL_NAME = "cron"`) advertises one schema with an `action`
field (`list` / `add` / `update` / `remove` / `run` / `runs`) instead of six
near-duplicate schemas — four of the six take only `job_id`. Each action
-forwards to the matching per-operation tool via `crate::tools::implementations
-::meta::collapse`, so validation and business logic live in exactly one
-place. `permission_level_with_args` / `external_effect_with_args` resolve the
-real per-action answer once `action` is known; the argument-free
-`permission_level` reports the strictest member (`CronAddTool`'s `Execute`)
-so an unparseable call over-restricts rather than under-.
-
-The six per-operation tools stay registered as `ToolExposure::Hidden`
-(`fn exposure`) — off the wire, but still dispatchable — so a replayed
-transcript or saved skill that names `cron_add` etc. keeps working.
+forwards to the matching per-operation tool through
+`crate::tools::implementations::meta::collapse` (`merge_action_schemas`,
+`resolve`, `args_without_action`), so schedule parsing, the `SecurityPolicy`
+check and delivery validation live in exactly one place.
+`permission_level_with_args` / `external_effect_with_args` resolve the real
+per-action answer once `action` is known; with a missing or unknown `action`
+they fall back to the strictest member (`Execute`, shared by `add` / `update`
+/ `run`) and `true`, so an unparseable call over-restricts rather than under-.
+The argument-free `permission_level` / `external_effect` report the same
+strictest values.
## Per-operation tools
| Tool | Name | Permission | `external_effect` | Delegates to |
| --- | --- | --- | --- | --- |
| `CronAddTool` | `cron_add` | `Execute` | `true` | `cron::add_shell_job` / `cron::add_agent_job` |
-| `CronListTool` | `cron_list` | default (read-only) | default (`false`) | `cron::list_jobs` |
-| `CronUpdateTool` | `cron_update` | `Execute` | `true` | `cron::update_job` |
+| `CronListTool` | `cron_list` | trait default (`ReadOnly`) | trait default (`false`) | `cron::list_jobs` |
+| `CronUpdateTool` | `cron_update` | `Execute` | `true` | `cron::update_job` (after `SecurityPolicy::is_command_allowed` on `patch.command`) |
| `CronRemoveTool` | `cron_remove` | `Write` | `true` | `cron::remove_job` |
| `CronRunTool` | `cron_run` | `Execute` | `true` | `cron::get_job` + `cron::scheduler::execute_job_now`, then `cron::record_run` / `cron::record_last_run` |
-| `CronRunsTool` | `cron_runs` | default (read-only) | default (`false`) | `cron::list_runs` |
+| `CronRunsTool` | `cron_runs` | trait default (`ReadOnly`) | trait default (`false`) | `cron::list_runs` (output truncated to `MAX_RUN_OUTPUT_CHARS = 500`) |
-The mutating tools (`add`, `update`, `remove`, `run`) all set
-`external_effect = true` and are gated by the approval flow
-(GHSA-f46p-6vf9-64mm): they persist or immediately execute a stored command
-or agent prompt on the host.
+The mutating tools (`add`, `update`, `remove`, `run`) set
+`external_effect = true` so `ApprovalGate::intercept` runs even for turns that
+originate from an inbound channel message (GHSA-f46p-6vf9-64mm): they persist
+or immediately execute a stored command or agent prompt on the host.
### `CronAddTool` details
-- Accepts `schedule` (`cron` / `at` / `every`), `job_type` (`shell` |
- `agent`, inferred from the presence of `prompt` when omitted), `command` or
- `prompt`, `session_target`, `model`, `delivery`, and `delete_after_run`.
-- Shell commands are checked against `SecurityPolicy::is_command_allowed`
- before being scheduled.
-- `delivery` defaults to `DeliveryConfig { mode: "proactive", .. }` for agent
- jobs. `validate_delivery` enforces that `mode: "announce"` carries both
- `channel` and `to`, and that `to` is in that channel's configured
- `allowed_users` — this blocks scheduling a cron whose output is delivered
- to an arbitrary chat id (see #928).
+- Args: `name` (derived as a slug of `prompt` when omitted), `schedule`
+ (`kind: cron | at | every`), `job_type` (`shell` | `agent`, inferred from
+ the presence of `prompt` when omitted), `command` or `prompt`,
+ `session_target` (`SessionTarget`, default `Isolated`), `model`,
+ `delivery`, `delete_after_run` (defaults to `true` for `at` schedules).
+- Shell commands are checked with `SecurityPolicy::is_command_allowed` before
+ being scheduled.
+- Agent jobs default to `DeliveryConfig { mode: "proactive", best_effort:
+ true, .. }`. `validate_delivery` only inspects `mode: "announce"`: it
+ requires `channel` and `to`, exempts `web`, rejects an unconfigured
+ channel, accepts any `to` when the channel's `allowed_users` is empty, and
+ otherwise requires `to` to be in that list — this blocks scheduling a cron
+ whose output is delivered to an arbitrary chat id (#928).
- `JobType::Flow` is unreachable through this tool (flow-schedule rows are
created internally by `flows::ops::flows_set_enabled` via
`cron::add_flow_schedule_job`); the arm returns an explicit error instead of
@@ -59,15 +79,17 @@ or agent prompt on the host.
- `cron` domain: [`../README.md`](../README.md) — job/run model, scheduler,
delivery modes, agent-job minimum interval.
-- `crates/openhuman-core/src/tools/impl/system/schedule.rs` — a separate,
- older one-shot `schedule` tool built on `cron::add_once` /
- `cron::add_once_at` rather than these six; not part of the collapse above.
-- `crates/openhuman-core/src/tools/implementations/meta/collapse.rs` — the
- generic action-collapsing helper `collapsed.rs` builds on.
+- `crates/openhuman-core/src/tools/impl/system/schedule.rs` — the separate
+ one-shot `schedule` tool built on `cron::add_once` / `cron::add_once_at`;
+ not part of the collapse above.
+- `crates/openhuman-core/src/tools/impl/meta/collapse.rs` (module path
+ `crate::tools::implementations::meta::collapse`) — the generic
+ action-collapsing helper `collapsed.rs` builds on.
## Tests
`add_tests.rs`, `list_tests.rs`, `update_tests.rs`, `remove_tests.rs`,
`run_tests.rs`, `runs_tests.rs` cover each per-operation tool;
-`collapsed_tests.rs` covers action dispatch, schema merging, and the
-strictest/resolved permission behavior.
+`collapsed_tests.rs` covers the merged schema, per-action versus fallback
+permission levels, the unknown-action error, and that every member is
+`Hidden`.