Skip to content

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

Merged
omarshahine merged 12 commits into
mainfrom
omarshahine/automations-tool-identity
Jul 30, 2026
Merged

omarshahine merged 12 commits into
mainfrom
omarshahine/automations-tool-identity

Conversation

@omarshahine

@omarshahine omarshahine commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The product and user model for scheduled work is "Automations", but the agent tool is literally named cron, so the assistant sees and repeats "cron" in every conversation about scheduling. This is the tool-identity slice of RFC 0026 (Phase 1, PR A of the stack): rename the tool once, through a canonical identity, without breaking persisted config, saved transcripts, external callers, or the wire protocol.

Why This Change Was Made

The tool name is a runtime identifier with behavioral consumers keyed on the exact string, so the rename ships as an identity migration in three commits:

  1. Behavior-neutral refactor (f6c0e2d0869): AUTOMATIONS_TOOL_NAME + isAutomationsToolName() in src/agents/tools/automations-tool-name.ts, with every exact-name consumer converted — factory descriptors, deferred-followup scheduler detection, successful-add counting, subagent/sandbox/local-model deny lists, mutation + replay-safety classification, trusted media set, catalog id, system-prompt tool order and tool-line map, delegation capability map, and MCP loopback probes. Constant still resolved to "cron", proving no scattered literals remained.
  2. The flip (bdbf8fa86ec): constant becomes "automations". TOOL_NAME_ALIASES gains cron -> automations (same shipped mechanism as bash -> exec) so persisted toolsAllow/toolsDeny, tool groups, and creator allowlists keep matching with no doctor rewrite; isAutomationsToolName() and MUTATING_TOOL_NAMES accept legacy names so saved transcripts keep their mutation/replay-safety classification.
  3. Review follow-ups (84592f0e928, addressing ClawSweeper P1 + Codex P1): inbound legacy calls are canonicalized at both external dispatch boundaries — MCP loopback tools/call resolves cron to the published tool without re-advertising it in tools/list, and gateway POST /tools/invoke canonicalizes before core-id checks and dispatch. This also surfaced and fixed a security regression: src/security/dangerous-tools.ts keyed the owner-only HTTP deny and control-plane lists on the literal "cron", so the renamed tool had silently lost default-deny protection on the invoke surface; the 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 and MCP serve allowlists follow the canonical name.

User Impact

The scheduler tool appears as automations in the tool list, transcripts, permission prompts, and tool-call UI. Existing configs (toolsAllow: ["cron"], gateway.tools.allow: ["cron"]), persisted jobs with legacy creator allowlists, saved transcripts, and external MCP//tools/invoke callers that still send cron all keep working. Gateway RPC (cron.*), config keys, schedule {kind:"cron"}, and state paths are untouched.

Evidence

Live behavior proof (source-run gateway, isolated OPENCLAW_STATE_DIR, port 19777, token auth; token redacted):

Phase 1 — no gateway.tools.allow (default deny must hold for both names):

== tools/invoke name=automations ==
{"ok":false,"error":{"type":"not_found","message":"Tool not available: automations"}}   HTTP 404
== tools/invoke name=cron ==
{"ok":false,"error":{"type":"not_found","message":"Tool not available: automations"}}   HTTP 404   <- legacy name canonicalized

Phase 2 — legacy-spelled gateway.tools.allow: ["cron"] (must lift the deny for the renamed tool):

== tools/invoke name=automations ==
{"ok":true,"result":{...,"details":{"enabled":true,"storage":"sqlite","jobs":1,...}}}   HTTP 200
== tools/invoke name=cron ==
{"ok":true,"result":{...,"details":{"enabled":true,"storage":"sqlite","jobs":1,...}}}   HTTP 200   <- legacy caller reaches renamed tool

Focused test runs (local, trusted checkout), all green:

  • tools-invoke-http.cron-regression.test.ts + tools-invoke-http.test.ts + tool-resolution.test.ts — 53 passed: default deny for both names, legacy allow lifts deny, non-owner protection, spawned-session deny inheritance
  • mcp-http.test.ts — new tests: legacy cron tools/call resolves to automations; still rejected when the tool isn't exposed
  • tool-policy, tool-mutation, cron-tool suites incl. creator-cap — legacy allow/deny matching, replay classification, creator allowlist normalization
  • run.tools-allow, service.jobs, store, openclaw-tools.session-status — 218 tests pass unchanged, proving persisted legacy job payloads flow through the alias

Pre-existing failures on clean main (proven via stash, unrelated): agent-tools.policy.test.ts (#47487 case) and the timing-sensitive mcp-http.test.ts "withdraws a closing runtime" race.

Reviews: Codex autoreview (gpt-5.4) P1 and ClawSweeper P1 both addressed by 84592f0e928 (owner decision taken: preserve inbound compatibility). Full suite/typecheck fan-out on hosted CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WhJ8EiMXue6ADLmHfb7FL6

Combined end-to-end verification (dev gateway)

All five stack PRs were merged into one integration build over current main and run side-by-side on an isolated dev gateway (:19001, own state dir) against real prod-synced state (post-2026.7.2-beta.5 doctor migration). Production stayed untouched on :18789. RFC 0026 accepted and merged: https://github.com/openclaw/rfcs/blob/main/rfcs/0026-automations-terminology.md

  • Wire proof: the openai-transport request log shows tools=count=20 sample=agents_list,automations,edit,exec,... — no cron tool in the model-facing schema.
  • A live model turn (gpt-5.6-terra) invoked automations to create a one-shot job; the run executed (status: ok, summary: "ping"), and its sessionKey agent:lobster:cron:<jobId>:run:<uuid> retains the internal cron: key contract.
  • POST /tools/invoke: automations stays default-denied (Tool not available: automations); the legacy name cron canonicalizes before the deny check and returns the same canonical-name error — the alias cannot bypass the owner-only gate.

Stack: cron -> automations rename (RFC 0026)

Landing order: A + B together, then D, then E; C is independent.

Combined-payload upgrade proof (Crabbox, 2026-07-30)

Live user-path upgrade on a Blacksmith Testbox (Linux x64, Node 24), using the combined integration branch omarshahine/openclaw automations-e2e-v2 (all five stack PRs merged onto current main, head a00f8348):

  1. Released install first: npm install -g openclaw@latest (2026.7.1-2), gateway up on :19801, two legacy jobs (daily-report, morning-wake) created through the released openclaw cron add gateway-RPC path.
  2. Upgrade in place: self-contained tarball built with scripts/package-openclaw-for-docker.mjs (package tarball integrity check green), npm install -g over the released install → OpenClaw 2026.7.2 (a00f834).
  3. Post-upgrade CLI against the live upgraded gateway, same state dir: pre-upgrade jobs listed by openclaw automations list --all; openclaw cron list --all output identical (token parity); renamed help (Usage: openclaw cron|automations, "Manage automations (via Gateway)"); openclaw automations add post-upgrade-proof round-trips and appears under the cron token; openclaw doctor completes with no rename-related findings.
  4. Legacy tool-name alias live: config deliberately kept the pre-rename spelling "gateway": { "tools": { "allow": ["cron"] } }. /tools/invoke on the upgraded gateway returned ok:true for both {"tool":"cron","action":"status"} (permanent inbound alias) and {"tool":"automations","action":"list"} (legacy allow-list entry governs the renamed tool) — no config migration required.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Jul 28, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 3:00 AM ET / 07:00 UTC.

ClawSweeper review

What this changes

This PR renames OpenClaw’s scheduler tool from cron to automations across agent, Gateway, MCP, prompt, and tool-policy surfaces while permanently accepting legacy cron policy entries and inbound calls.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this PR open for maintainer review rather than cleanup. The supplied diff consistently publishes automations, preserves cron at persisted-policy and inbound-call boundaries, and includes strong live upgrade proof; however, it is a protected maintainer-labeled, stacked identity migration whose GitHub merge state is behind current main and needs a refreshed merge-result check before landing.

Priority: P2
Reviewed head: bc9e5bc973898e936bdc414483e1cde792a1da5f
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong real upgrade evidence and focused compatibility coverage support a good patch, with the current-main merge refresh remaining the material pre-merge confidence step.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides redacted live Gateway and combined in-place upgrade evidence showing canonical calls, legacy calls, legacy allowlist compatibility, and retained default denial for the scheduler tool.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides redacted live Gateway and combined in-place upgrade evidence showing canonical calls, legacy calls, legacy allowlist compatibility, and retained default denial for the scheduler tool.
Evidence reviewed 6 items Canonical scheduler identity: The PR adds a single canonical scheduler tool identity, publishes automations, and keeps cron as a documented permanent legacy alias for persisted policy, saved transcripts, and inbound calls.
Gateway authorization compatibility: The changed Gateway invoke path canonicalizes the legacy name before core-id checks, while the Gateway allowlist comparison normalizes both names so a released allow: ["cron"] entry continues to govern the renamed tool.
Default-deny boundary retained: The HTTP default-deny and control-plane lists are switched to the canonical tool name, avoiding a renamed scheduler tool becoming unintentionally callable through Gateway HTTP.
Findings None None.
Security None None.

How this fits together

The scheduler tool is assembled into agent tool lists and then exposed through Gateway and MCP dispatch. Its identifier also controls tool policy, owner-only authorization, persisted allowlists, transcript replay classification, and model-facing tool descriptions.

flowchart LR
  A[Agent and MCP callers] --> B[Tool-name resolution]
  C[Persisted allow and deny lists] --> B
  B --> D[Automations scheduler tool]
  D --> E[Gateway scheduler RPC]
  B --> F[Authorization and transcript safety]
  F --> G[Gateway and MCP responses]
Loading

Decision needed

Question Recommendation
After a current-main merge-result refresh, should the repository accept cron as the permanent inbound and persisted-policy alias for the newly published automations scheduler tool? Approve permanent alias contract: Refresh the merge result, rerun the focused boundary checks, and land the canonical-name migration with cron retained at the documented compatibility boundaries.

Why: The PR changes a user-visible tool identity and intentionally establishes an indefinitely supported compatibility contract across policy, Gateway, MCP, and saved state; the maintainer label requires explicit human handling even though the RFC and PR discussion support the direction.

Before merge

  • Resolve merge risk (P1) - The PR is cleanly mergeable but behind current main; regenerate the actual merge result and rerun the focused policy, Gateway, MCP, prompt-snapshot, and security-boundary checks against that result before landing.
  • Resolve merge risk (P1) - This is the foundational PR in a five-PR terminology stack. The dependent agent-string PR at feat(agents): rename model- and user-facing scheduler strings to automations #114852 assumes this canonical tool identity, so land order and the preserved inbound alias remain merge-critical.
  • Complete next step (P2) - A protected maintainer-labeled, stacked public tool-identity contract needs an explicit human acceptance after its current-main merge result is refreshed; there is no discrete mechanical repair finding to dispatch.
Agent review details

Security

None.

PR surface

Source +89, Tests +79. Total +168 across 56 files.

View PR surface stats
Area Files Added Removed Net
Source 29 133 44 +89
Tests 27 190 111 +79
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 56 323 155 +168

Review metrics

Metric Value Why it matters
Compatibility identity paths 1 canonical tool name added; 1 permanent legacy alias retained The rename reaches persisted policy, external dispatch, and saved transcript classification, so the alias contract is more consequential than a display-only terminology change.

Stored data model

Persistent data-model change detected: serialized state: src/agents/tool-policy.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: canonical
Canonical: #114841
Summary: This PR is the foundational scheduler-tool identity change in the RFC terminology stack; sibling PRs address dependent wording, UI, CLI, and documentation surfaces.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Refresh and validate the merge result (recommended)
    Rebase or merge current main into this branch, then rerun the focused tool-policy, Gateway invoke, MCP, prompt-snapshot, and security boundary checks before merging.
  2. Accept the permanent alias scope
    Maintainers may land the PR as written if they explicitly accept that cron remains supported in persisted policy and inbound dispatch paths indefinitely.
  3. Pause for a narrower contract
    Pause this stack if maintainers do not want an indefinite alias across external calls, persisted configuration, and transcript safety handling.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Refresh against current main and rerun focused policy, Gateway invoke, MCP, prompt-snapshot, and security-boundary validation on the resulting head.

Technical review

Best possible solution:

Land the canonical automations identity only after refreshing it onto current main and confirming that legacy cron policy entries and external calls still pass through the same owner-only and default-deny protections; then land the dependent wording work in the stated stack order.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR is a planned tool-identity and terminology change rather than a report of a currently failing behavior. The supplied live proof does exercise the post-change user and upgrade paths.

Is this the best way to solve the issue?

Yes, conditionally: one canonical published tool name plus a tested compatibility alias is more maintainable than exposing duplicate scheduler tools. The remaining requirement is to validate the current-main merge result before accepting the permanent alias contract.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against e4e7f37d246e.

Labels

Label justifications:

  • P2: This is a bounded but cross-cutting scheduler-tool identity migration affecting agent, Gateway, MCP, and persisted compatibility paths.
  • merge-risk: 🚨 compatibility: Existing allow/deny configuration and external callers may continue to use cron, which this PR intentionally maps to the new published tool name.
  • merge-risk: 🚨 session-state: Saved transcripts and scheduled-job creator allowlists retain tool identifiers that affect replay-safety and subsequent agent execution.
  • merge-risk: 🚨 security-boundary: The renamed tool controls persistent scheduled work and must remain behind the Gateway HTTP default-deny and owner-only controls.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides redacted live Gateway and combined in-place upgrade evidence showing canonical calls, legacy calls, legacy allowlist compatibility, and retained default denial for the scheduler tool.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides redacted live Gateway and combined in-place upgrade evidence showing canonical calls, legacy calls, legacy allowlist compatibility, and retained default denial for the scheduler tool.

Evidence

What I checked:

  • Canonical scheduler identity: The PR adds a single canonical scheduler tool identity, publishes automations, and keeps cron as a documented permanent legacy alias for persisted policy, saved transcripts, and inbound calls. (src/agents/tools/automations-tool-name.ts:1, bc9e5bc97389)
  • Gateway authorization compatibility: The changed Gateway invoke path canonicalizes the legacy name before core-id checks, while the Gateway allowlist comparison normalizes both names so a released allow: ["cron"] entry continues to govern the renamed tool. (src/gateway/tools-invoke-shared.ts:177, bc9e5bc97389)
  • Default-deny boundary retained: The HTTP default-deny and control-plane lists are switched to the canonical tool name, avoiding a renamed scheduler tool becoming unintentionally callable through Gateway HTTP. (src/security/dangerous-tools.ts:32, bc9e5bc97389)
  • MCP legacy-call coverage: The PR resolves legacy MCP tools/call requests to the canonical published tool without re-listing the legacy name, with dedicated positive and unavailable-tool tests in the changed suite. (src/gateway/mcp-http.handlers.ts:98, bc9e5bc97389)
  • Real upgrade evidence: The PR body reports an in-place upgrade from released 2026.7.1-2 state, verifies old scheduler jobs through the new CLI surface, and shows both cron and automations working with an unmigrated legacy Gateway allowlist. (bc9e5bc97389)
  • Current review continuity: The latest completed ClawSweeper cycle reported no remaining line-level findings, and the contributor subsequently added combined-payload upgrade proof; the current head remains bc9e5bc973898e936bdc414483e1cde792a1da5f. (bc9e5bc97389)

Likely related people:

  • omarshahine: Authored the complete scheduler-identity change sequence and the linked RFC stack, including the Gateway/MCP compatibility and authorization follow-ups. (role: feature author and recent area contributor; confidence: high; commits: 914a4fc5fb33, 33ed5d98c362, 1e272930564a; files: src/agents/tools/automations-tool-name.ts, src/gateway/tools-invoke-shared.ts, src/security/dangerous-tools.ts)
  • giodl73-repo: The PR timeline records an assignment during the active review cycle, making this person the clearest available routing candidate for the protected maintainer review. (role: assigned reviewer; confidence: medium; files: src/gateway/tools-invoke-shared.ts, src/security/dangerous-tools.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh the branch against current main and rerun the focused policy, Gateway invoke, MCP, prompt-snapshot, and security-boundary checks on the resulting merge head.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-28T02:33:09.209Z sha b58a361 :: found issues before merge. :: [P1] Migrate legacy tool names outside normal runtime
  • reviewed 2026-07-28T02:52:37.133Z sha f5ada1e :: found issues before merge. :: [P1] Migrate legacy tool-policy names before runtime
  • reviewed 2026-07-28T03:01:22.979Z sha 9570801 :: found issues before merge. :: [P1] Move legacy policy normalization into Doctor
  • reviewed 2026-07-28T04:33:23.643Z sha a4a383e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T12:53:00.799Z sha a777a3f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T00:52:15.673Z sha bc9e5bc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T06:21:30.264Z sha bc9e5bc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T06:40:12.858Z sha bc9e5bc :: needs maintainer review before merge. :: none

@omarshahine

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@omarshahine
omarshahine marked this pull request as ready for review July 28, 2026 02:20
@omarshahine
omarshahine requested a review from a team as a code owner July 28, 2026 02:20
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 28, 2026
@omarshahine

Copy link
Copy Markdown
Contributor Author

Owner decision (maintainer: @omarshahine), resolving the open ClawSweeper finding on legacy policy names:

cron is a permanently accepted alias for the scheduler tool — in persisted allow/deny lists, saved transcripts, and inbound calls at every dispatch boundary. Nothing is being retired: cron.* config keys, cron.* RPC methods, the {kind:"cron"} schedule syntax, and the openclaw cron CLI token all keep the name indefinitely. The tool-name alias therefore follows the same shipped, permanent TOOL_NAME_ALIASES contract as bash -> exec and apply-patch -> apply_patch, which have never required a doctor migration. A doctor --fix rewrite exists to retire legacy shapes; there is no legacy shape here to retire, so no doctor step applies.

a4a383e2d08 updates the alias-site comments to state this permanent contract instead of a deprecation window.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 28, 2026
…al 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.
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.
…ns 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.
…er 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.
…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.
…name

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.
… 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.
@omarshahine
omarshahine force-pushed the omarshahine/automations-tool-identity branch from a4a383e to a777a3f Compare July 29, 2026 04:51
…d 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.
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Jul 30, 2026
@omarshahine

Copy link
Copy Markdown
Contributor Author

Thanks — all findings addressed on bc9e5bc9738:

  • [P1] Fallback guidance: buildOpenClawToolFallbackText now teaches - automations: interpolated from AUTOMATIONS_TOOL_NAME, with new coverage in src/agents/prompt-surface.test.ts asserting the canonical tool appears and no - cron/"cron job" wording survives (c12976b).
  • [P1] Cron-scope test: the stub and assertion now pin AUTOMATIONS_TOOL_NAME, so the test fails if the canonical rename is lost while the internal cron trigger id stays (c12976b).
  • [P2] Identity source reuse: src/mcp/openclaw-tools-serve.ts and src/talk/client-voice-confirmation.ts now import the constant instead of spelling the name (c12976b, import placement fixed in bc9e5bc).
  • Restack: done earlier — the branch is rebased onto current main (a777a3f6a6e ancestry) and GitHub reports it MERGEABLE with green CI.

@omarshahine
omarshahine requested a review from giodl73-repo July 30, 2026 01:25
@omarshahine

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

New evidence since the last review: a live combined-payload upgrade proof on a Blacksmith Testbox has been added to the PR body ("Combined-payload upgrade proof" section) — released 2026.7.1-2 install, legacy cron jobs created via released gateway RPC, in-place upgrade to the integration build (all five stack PRs on current main), token parity, renamed help, doctor, and live /tools/invoke with both the legacy cron and new automations tool names under an unmigrated "allow": ["cron"] config.

@omarshahine
omarshahine merged commit 364d8be into main Jul 30, 2026
129 checks passed
@omarshahine
omarshahine deleted the omarshahine/automations-tool-identity branch July 30, 2026 14:16
@omarshahine

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 30, 2026
* origin/main: (99 commits)
  docs(automation): rename scheduled-tasks feature wording to Automations (#114855)
  feat(ui): finish cron -> Automations rename in visible strings (#114853)
  feat(cli): add openclaw automations alias and reword cron display prose (#114854)
  feat(agents): rename scheduler agent tool cron -> automations (#114841)
  fix(tui): preserve session state across switches and reconnects (#116399)
  feat(agents): report CLI command outcomes in channel progress
  fix(cli): preserve explicit option intent (#116389)
  fix(release): trust update restart harness (#116301)
  test(reef): remove false-green live guard smoke (#116393)
  test(comfy): evaluate live guards after setup (#116388)
  fix(heartbeat): serialize wake lifecycle state (#116351)
  test: remove redundant extension boundary wrapper (#116385)
  fix(test): bound Testbox agentic and extension suites (#115696)
  fix(ui): show the correct Threads page size (#116349)
  test(discord): align progress timing expectations (#116377)
  feat(ui): add composable skill references (#116330)
  fix(qa): prevent Slack cleanup from stalling profile runs (#116361)
  fix(ci): validate frozen release candidates faithfully (#116357)
  improve(ci): fail_fast option for release validation, off by default (#116352)
  fix(agents): compare shell tool names case-insensitively and stop re-parsing tool labels
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 31, 2026
…aw#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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants