openclaw/test/helpers
Omar Shahine 364d8be010
feat(agents): rename scheduler agent tool cron -> automations (#114841)
* refactor(agents): route scheduler tool-name consumers through canonical identity

Introduce AUTOMATIONS_TOOL_NAME + isAutomationsToolName() in
src/agents/tools/automations-tool-name.ts as the single source of truth for
the scheduler agent tool's name, and convert every exact-name consumer:
factory descriptors, deferred-followup availability detection, add-counting,
policy deny lists, mutation classification, trusted media set, tool catalog
id, system-prompt tool order and tool-line map, sandbox deny defaults,
delegation capability map, MCP loopback probes, and local-model lean deny.

Behavior-neutral: the constant still resolves to "cron". Prepares the
rename in RFC openclaw/rfcs#50 so the flip is a one-line change with no
scattered literals.

* feat(agents): rename scheduler agent tool cron -> automations

Flip AUTOMATIONS_TOOL_NAME to "automations" and register the legacy name:

- TOOL_NAME_ALIASES gains cron -> automations, so persisted toolsAllow/
  toolsDeny lists, tool groups, and creator allowlists written before the
  rename keep matching through the same shipped mechanism as bash -> exec.
  No doctor rewrite needed.
- isAutomationsToolName() accepts legacy names so saved transcripts keep
  their mutation/replay-safety classification; MUTATING_TOOL_NAMES retains
  the legacy entry for the same reason.
- Tool label, catalog label, and tool-search keywords follow the rename
  ("cron" kept as a search synonym).
- Regression tests cover old-name policy matching (allow and deny), legacy
  transcript replay classification, and legacy creator allowlists
  normalizing to the canonical id.

Model-facing description strings still say cron; those move in the
follow-up strings PR. Part of RFC openclaw/rfcs#50 Phase 1.

* test(agents): update creator-cap expectations for canonical automations id

The creator tool surface derives from normalized live tool names, so derived
toolsAllow outputs now emit "automations". Passthrough paths without a
creator cap keep storing user input verbatim; those expectations stay on the
legacy name as stored-data coverage.

* fix(gateway): canonicalize legacy cron tool calls and restore scheduler deny protection

Review follow-ups from ClawSweeper and Codex on the rename (RFC 0026):

- MCP loopback tools/call resolves legacy "cron" names to the published
  automations tool without re-advertising the old name in tools/list.
- Gateway /tools/invoke canonicalizes legacy names before core-id checks and
  exact-name dispatch, so pre-rename integrations keep working.
- Security fix: dangerous-tools deny lists (owner-only HTTP deny and
  control-plane set) were keyed on the literal "cron", so the renamed tool
  silently lost default-deny and owner-only protection on the HTTP invoke
  surface. Lists now use the canonical constant, and the gateway.tools.allow
  un-deny filter normalizes both sides so legacy allow entries still lift it.
- Voice high-impact confirmation list and MCP serve creator allowlist follow
  the canonical name.

Existing cron-regression suite now proves the legacy path end to end:
default deny 404 for both names, legacy allow entry lifts the deny, and
non-owner protection holds.

* fix(agents): cover stdio MCP legacy calls, probe prompts, and prompt snapshots for the rename

- stdio MCP servers (openclaw-tools-serve / plugin tools handlers) resolve
  legacy "cron" callTool names to the published canonical tool, matching
  the HTTP loopback behavior; listTools stays canonical-only.
- Live probe prompts instruct harnesses to load/call the automations MCP
  tool (mcp__openclaw__automations) instead of the retired name.
- Prompt snapshot fixture filter follows the canonical name (the renamed
  tool had silently dropped out of the Codex dynamic-tools snapshots);
  snapshots regenerated as a clean rename.
- Type-cast the new mcp-http handler test payloads for check-test-types.

* test(agents): update tool-surface expectations for the automations rename

CI-surfaced fallout in shards not covered by the focused local runs: tool
availability, agent-config filtering, coding-tools construction,
model-provider lean policy, and skill dispatch all assert the scheduler
tool's surface name. Mock fixtures and expectations follow the canonical
id; legacy-name coverage stays in the dedicated policy/creator-cap/invoke
regression suites.

* test(gateway): update tool-resolution exclude expectations for automations rename

* test(security): update trust-model audit expectations for automations rename

* docs(agents): declare cron a permanent scheduler-tool alias per owner decision

Maintainer decision (Omar): cron is not being retired anywhere — config keys,
RPC methods, schedule syntax, and the CLI token all keep it, and the tool
alias follows the same permanent contract as bash -> exec. No doctor rewrite
and no removal window; comments updated to state the contract instead of a
deprecation plan.

* chore(agents): regen prompt snapshots after rebase onto main

* fix(agents): teach canonical automations tool in fallback guidance and reuse the identity source

Review follow-ups: the structured-list fallback still taught models the cron
tool; the cron-scope test echoed its own stub; MCP serve allowlist and voice
confirmation hardcoded the name instead of the canonical constant.

* fix(mcp): place automations identity import outside the header comment

---------

Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
2026-07-30 07:16:13 -07:00
..
agents feat(agents): rename scheduler agent tool cron -> automations (#114841) 2026-07-30 07:16:13 -07:00
auto-reply refactor: remove dead split facades (#114726) 2026-07-27 16:32:52 -04:00
config feat(cron): database-backed heartbeat monitor scratch replaces HEARTBEAT.md (#112967) 2026-07-23 11:10:49 -07:00
cron refactor(sessions): collapse legacy JSON store (#113075) 2026-07-23 09:36:48 -07:00
gateway test(live): require Android node core commands 2026-06-06 16:12:56 +02:00
infra refactor(config): config-surface reduction tranche 3 — product consolidations (review request) (#111527) 2026-07-21 20:28:43 -07:00
media-generation refactor(deadcode): enforce repository hard zero (#108641) 2026-07-15 22:40:00 -07:00
acp-manager-task-state.ts refactor(deadcode): enforce repository hard zero (#108641) 2026-07-15 22:40:00 -07:00
AGENTS.md
auth-wizard.ts refactor(deadcode): enforce repository hard zero (#108641) 2026-07-15 22:40:00 -07:00
bounded-child-output.test.ts fix(test): keep bounded child output UTF-8 safe (#109168) 2026-07-16 22:53:11 -07:00
bounded-child-output.ts fix(test): keep bounded child output UTF-8 safe (#109168) 2026-07-16 22:53:11 -07:00
browser-bundled-plugin-fixture.ts docs: document test helpers 2026-06-04 20:42:26 -04:00
bundled-runtime-sidecars.ts docs: document shared test helpers 2026-06-04 01:48:32 -04:00
captured-io.ts docs: document shared test helpers 2026-06-04 01:48:32 -04:00
CLAUDE.md
gateway-e2e-harness.test.ts chore(tooling): typecheck root test/** with a dedicated tsgo lane (#104475) 2026-07-11 06:15:41 -07:00
gateway-e2e-harness.ts refactor(state): move device identity into canonical SQLite state (#110392) 2026-07-18 17:43:56 +01:00
image-fixtures.ts refactor(deadcode): enforce repository hard zero (#108641) 2026-07-15 22:40:00 -07:00
live-image-probe.test.ts docs: document test helpers 2026-06-04 20:42:26 -04:00
live-image-probe.ts docs: document test helpers 2026-06-04 20:42:26 -04:00
normalize-text.ts docs: document test helpers 2026-06-04 20:42:26 -04:00
openclaw-test-instance.test.ts fix(test): kill openclaw test process groups 2026-06-17 22:58:03 +02:00
openclaw-test-instance.ts refactor(deadcode): enforce repository hard zero (#108641) 2026-07-15 22:40:00 -07:00
paths.ts docs: document test helpers 2026-06-04 20:42:26 -04:00
pattern-file.ts docs: document test helpers 2026-06-04 20:42:26 -04:00
process-wait.ts refactor: batch of independent dedup wins (#113535) 2026-07-25 02:56:05 -07:00
promise.ts perf(test): clear completed deadline timers (#108780) 2026-07-16 01:45:55 -07:00
session-manager-file-fixture.ts refactor(sessions): isolate legacy transcript fixtures (#115231) 2026-07-28 11:56:16 -04:00
sqlite-sessions-transcripts-flip-proof-assertions.ts refactor(sessions): remove file-era transcript runtime (#113233) 2026-07-27 22:33:24 -04:00
sqlite-sessions-transcripts-flip-proof.ts fix: prevent duplicate agent turns and slow Codex harness runs (#115474) 2026-07-28 22:56:12 -04:00
sqlite-statement-execution-counter.ts improve(sqlite): reuse synchronous prepared statements (#114777) 2026-07-28 03:53:16 -04:00
stt-live-audio.test.ts docs: document test helpers 2026-06-04 20:42:26 -04:00
temp-dir.test.ts fix(qa): restore package docker gates 2026-07-04 01:56:21 +02:00
temp-dir.ts refactor(deadcode): enforce repository hard zero (#108641) 2026-07-15 22:40:00 -07:00
temp-repo.ts docs: document test helpers 2026-06-04 20:42:26 -04:00
ui-style-fixtures.ts refactor(deadcode): enforce repository hard zero (#108641) 2026-07-15 22:40:00 -07:00
vitest-config-paths.ts docs: document test helpers 2026-06-04 20:42:26 -04:00
wizard-prompter.ts test: eliminate unchecked TypeScript casts (#105804) 2026-07-12 18:08:26 -07:00