Skip to content

feat: allow scoped operators to manage their automations - #188090

Merged
roboclaw-bot merged 3 commits into
mainfrom
openclaw/operator-cron-scope
Oct 31, 2026
Merged

roboclaw-bot merged 3 commits into
mainfrom
openclaw/operator-cron-scope

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Operators with write access cannot ask an agent to create and manage their own automations without Gateway administrator authority.

User Impact

Adds operator.cron for authenticated agent-turn automation access, implied by operator.write. Users can schedule and manage jobs within the existing conversation/account ownership boundary without receiving operator.admin. Cron-only access does not grant chat, general write, or global scheduler administration.

Why This Change Was Made

Reuse the existing requester grant and job ownership checks instead of treating every scheduler caller as an administrator. One runtime-method mapping covers creation, job management, history, and scratch access. Scheduled runs preserve the initiating operator scopes. Direct/global scheduler APIs, privileged binding, live revocation, and tool restrictions retain their existing checks.

Signed requester transports preserve private scoped-creation provenance without promoting it to local-owner or management authority. No new state owner or storage schema is introduced. The config baseline is regenerated for the accepted scope.

Evidence

  • Rebased onto main f8fe5864ab3aab29ffeab8b98fef51d3014e5349; current head is 01d2a7a7edda96784c97de77f5af43040223cfbc. The only rebase conflict was the generated configuration checksum, regenerated with pnpm config:docs:gen. git range-diff confirmed the feature and regression patches were unchanged by rebase. pnpm config:docs:check and git diff --check pass. All 145 focused post-rebase tests pass across scope implication, Gateway auth config, signed creator transports, Cron policy, and persisted scheduled continuation.
  • Rebased-head CI exposed two failures, repaired in the current head: the contained-symlink test now accepts the earlier symlink refusal while still requiring denial; usage.cost no longer gives a freshness TTL to a refreshing lower-cache result. Two cost-handler regressions fail before the fix and pass after it for single-agent and all-agent reads, without increasing timeouts. The cost repair reuses the existing cache completeness predicate (production +2 lines; no new owner).
  • CI repair validation: all 6 skill-read tests and all 44 cost/cache/consumer tests pass; formatting and diff checks pass. An independent P0–P2 review of all three repair files found no actionable issues. Current-head CI passed on 01d2a7a7edda96784c97de77f5af43040223cfbc, including all Android and PostgreSQL lanes, changed Node shards, clean-install type/lint checks, and both required openclaw/ci-gate checks. The real Gateway quarter-backfill regression passed in 10.809s on that head. Local full Gateway E2E setup, core typecheck, and lint preparation failed because the shared installation had fs-safe 0.26.13 versus lockfile 0.26.15 (missing native-asset pin/export); the shared installation was not modified. Those local environment failures are retained separately from the passing clean-install CI evidence.
  • Red/green regressions for scoped creation and signed requester grants. Both operator.cron and operator.write pass real token mint/verification, production in-process dispatch, owned-job persistence, foreign-conversation/account refusal, and revocation during validation before persistence. Refused mutations leave storage unchanged; no local-owner or management authority is added.
  • Reproduced the five stale CI consumer assertions and updated ingress/rejected-manager expectations without weakening their security checks. All 205 consumer tests and 9 transport tests pass. Scope implication, config, scheduled-scope preservation, grant/token, and prompt-stability suites also pass.
  • Before this rebase, core/source-test typechecks, focused lint/format, config checks, line-cap/test-line ratchets, and diff checks passed. Main f0586d2e3e0d73c was integrated only for a generated-config conflict; affected checks were rerun. These are prior-head results, not current-head clean-install evidence.
  • Pre-rebase local independent P0–P2 reviews of the implementation and the consumer/signed-effect repair found no actionable issues. The unchanged signed-token implementation was unavailable to the implementation reviewer; its changed regression tests and grant owner were reviewed.
  • Pre-rebase exact-head CI passed on 3eb0998e661ed1fd7681c0cfb01b16799cc552e0, including both Android lanes, all PostgreSQL lanes, changed Node shards, and required aggregate checks. The earlier Android emulator-setup failure did not recur.
  • ClawSweeper's completed review of current head 01d2a7a7edda96784c97de77f5af43040223cfbc has no actionable findings and no remaining before-merge items. CI was still pending when that review completed and is now green.
  • Gap: no live-provider Gateway turn or full WebSocket signed-request test was run. Proof uses production admission, dispatch, and Cron storage with mocked model execution.
Validation cost and change size

All changed test files were exercised with --maxWorkers=1; wall times include compilation/setup:

Suite Wall time
Creator authority context 38.20s
Gateway auth config 6.03s
Scheduled operator continuation 75.80s
Signed runtime identity 7.03s
Fresh operator admission 9.52s
Gateway Cron policy 18.75s
Scope implication 1.07s
Chat, requester authority, authenticated connection consumers 53.37s combined
Signed/embedded/CLI creator transports 53.20s
Authenticated connection consumer after assertion simplification 24.17s
Skill-read CI repair (6 tests) 47.17s
Cost freshness and cache consumers (44 tests) 80.09s

Transport execution itself takes about 14s; most wall time is compilation. The existing scheduled-continuation suite exercises real persistence/restoration and authority lifecycle, which helper-only tests cannot prove. The successful pre-rebase CI run's start-to-final-update window was 1,417 seconds (23m37s). The current-head CI run took 1,522 seconds (25m22s), including setup and parallel jobs; neither is summed runner time.

Production delta against integrated main: +65/-24 lines. Tests: +376/-73 lines. The original 284-line allocation covers distinct admission, signed final-effect, and continuation-scope regressions; the CI cost-cache repair adds 19 test lines in an existing suite. No shared test scalar was raised.

Requested by @VACInc.

Work sessions

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: M labels Oct 30, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 30, 2026 04:07
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 01d2a7a7edda96784c97de77f5af43040223cfbc
  • Maintainer: @roboclaw-bot
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/cron-creator-authority-grant.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/method-scopes.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/operator-scopes.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/cron-creator-authority-admission.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/method-authorization.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-plugin-in-process-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/shared/operator-scope-compat.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds operator.cron, implied by operator.write, for managing conversation-owned automations through authenticated agent turns.

Example: An operator.write user asks their agent to create a recurring “Check status” automation.

  • Before: The authenticated turn lacks the scheduling admission available to administrators.
  • After: The agent can create and manage the conversation’s automation while foreign conversation and account jobs remain inaccessible.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful and source-consistent, with meaningful authority proof through production owners; evidence remains harness-based and current-head CI is pending.
Proof confidence 🦐 gold shrimp (3/6) ✨ media proof bonus Sufficient (linked_artifact): For this maintainer-authored PR, supplied production-path harness execution covers scoped creation, persisted ownership, foreign conversation/account rejection, and revocation before storage writes; continuation tests preserve the original scope ceiling. The authority implementation is unchanged since the previous reviewed head. No live-provider turn or complete WebSocket signed-request scenario is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Users with write access cannot reliably ask an agent to schedule and manage their own automations without administrator authority.
Reason: The maintainer-authored direction provides useful least-privilege scheduling while retaining existing conversation, account, tool-policy, and administrator boundaries.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: it adds useful scoped scheduling, and no actionable introduced defect was found; current-head CI remains pending.

Priority: P2
Reviewed head: 01d2a7a7edda96784c97de77f5af43040223cfbc

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway admission turns authenticated operator scopes into run-bound grants; automation handlers enforce ownership and live authority before persisting jobs, and scheduled execution restores the initiating scopes.

flowchart TD
  A[Authenticated operator turn] --> B[Scope and creator admission]
  B --> C[Run-bound requester grant]
  C --> D[Gateway automation handlers]
  D --> E[Ownership and live authority checks]
  E --> F[Cron storage]
  F --> G[Scheduled scope restoration]
Loading

Technical review

Best possible solution:

Use the existing requester grants, ownership checks, and persistence guards to provide scoped scheduling while retaining separate administrator authority.

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

Current-main source establishes the missing scope and default admission restriction; supplied regressions report red/green results, but no target code was executed during this review.

Is this the best way to solve the issue?

The implementation extends existing admission, grant, dispatch, and ownership owners without adding a competing authorization or storage system.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1f088d23a1cc.

Provenance checked

  • Fresh requester creation keeps the original intent (fix: restore automation creation for remote administrators #151291: Remote administrators needed ordinary caller-scoped creation without receiving local-host or runtime-materialization authority.)
  • Runtime method admission changes intended behavior with a stated reason (feat: restrict model automation administration through Gateway policy #174580: Caller-management deployments needed model scheduling without global administrator control; this PR explicitly extends that scoped admission independently of deployment policy.)
  • Scheduled operator source capture keeps the original intent (d74a4ae: Scheduled follow-ups needed to retain authorized task access and revalidate it during execution.)
  • Automation tool availability keeps the original intent (c7bab50: Scoped tool exceptions use existing capabilities while other control-plane tools retain owner restrictions.)
  • Usage-cost cache completeness changes intended behavior with a stated reason (unknown: Path history identifies existing snapshot caching, but the symbol-history search stopped at an unavailable historical blob; the PR explains the concrete incomplete-result freshness defect and reuses the existing completeness contract.)
  • Contained-symlink rejection test keeps the original intent (fix(skills): load manual personal skills with workspace-only reads #144954: Selected skill resources must remain constrained by file-access boundaries; accepting either rejection stage preserves the denial invariant.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +41, Tests +303, Docs +15, Generated 0, Other +2. Total +361 across 27 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 11 65 24 +41
Tests 13 376 73 +303
Docs 1 27 12 +15
Config 0 0 0 0
Generated 1 2 2 0
Other 1 2 0 +2
Total 27 472 111 +361

Review metrics

Metric Value Why it matters
Permission surface 1 new operator scope operator.cron is added to the existing scope vocabulary and implied by operator.write; no new configuration key or storage schema is introduced.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a useful, bounded scheduling capability for authenticated operators.
  • merge-risk: 🚨 security-boundary: The maintainer-authored change deliberately expands scheduling admission for existing write grants and a new narrow scope; supplied final-effect scenarios cover ownership and revocation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-30T04:25:09.385Z sha 204713b :: needs real behavior proof before merge. :: [P2] Update ingress consumers for scoped scheduling admission | [P2] Update rejected-manager tests for the new authorization boundary
  • reviewed 2026-10-30T04:43:25.173Z sha 3eb0998 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-31T01:09:46.528Z sha 95425a3 :: needs maintainer review before merge. :: none

Reviewed October 30, 2026, 9:22 PM ET / October 31, 2026, 01:22 UTC (Revision 4).

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: applying reviewed decision.

I am applying the reviewed decision for this pull request: feat: allow scoped operators to manage their automations This is item 1/1 in the current shard. Shard 1/1.

This transient lease prevents a newer review from overlapping label, comment, or close mutations.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

Add operator.cron, implied by operator.write, for authenticated agent-turn scheduling within existing caller ownership. Preserve the initiating grant for scheduled work without granting global scheduler administration.

Co-authored-by: VACInc <[email protected]>
Update ingress and continuation consumer expectations for scoped scheduling. Exercise signed requester creation, cross-owner denial, and revocation before persistence.

Co-authored-by: VACInc <[email protected]>
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/operator-cron-scope branch from 3eb0998 to 95425a3 Compare October 31, 2026 00:58
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 31, 2026
Keep refreshing cost responses outside the freshness TTL and cover both agent scopes. Accept the current symlink denial message without weakening the rejection invariant.

Co-authored-by: VACInc <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 31, 2026
@roboclaw-bot
roboclaw-bot merged commit 1851659 into main Oct 31, 2026
154 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/operator-cron-scope branch October 31, 2026 01:41
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

roboclaw-bot added a commit that referenced this pull request Oct 31, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…8090)

* feat: allow scoped operators to manage their automations

Add operator.cron, implied by operator.write, for authenticated agent-turn scheduling within existing caller ownership. Preserve the initiating grant for scheduled work without granting global scheduler administration.

Co-authored-by: VACInc <[email protected]>

* test: prove scoped cron authority through persistence

Update ingress and continuation consumer expectations for scoped scheduling. Exercise signed requester creation, cross-owner denial, and revocation before persistence.

Co-authored-by: VACInc <[email protected]>

* fix: refresh incomplete usage cost snapshots

Keep refreshing cost responses outside the freshness TTL and cover both agent scopes. Accept the current symlink denial message without weakening the rejection invariant.

Co-authored-by: VACInc <[email protected]>

---------

Co-authored-by: VACInc <[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 docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: L 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