Skip to content

fix: keep local scheduled account reads authorized - #150311

Merged
shakkernerd merged 2 commits into
mainfrom
fix/scheduled-local-source
Sep 17, 2026
Merged

shakkernerd merged 2 commits into
mainfrom
fix/scheduled-local-source

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A local administrator can open the Control UI, ask OpenClaw to save an account-bound automation, and see creation succeed. When that unchanged automation runs later, its scheduled message read fails before the provider even though the saved job still has the correct tool cap and creator account. The creator's WebChat transport label had displaced the independently authenticated local source needed by the read policy.

User Impact

Locally created account automations can read supported provider state through their saved creator account after the creating turn has ended. An explicit toolsAllow edit from the same local source can reauthorize an older or previously edited job.

Description, display-label, and exact no-op edits preserve the valid source. Model-facing names, prompts, schedules, tools, and other executable changes clear it unless the editor supplies fresh source authorization. Remote management does not acquire local read authority, and legacy jobs without provable origins remain blocked. Existing provider restrictions and account matching still apply.

Why This Change Was Made

The authenticated local source already belonged to the creating administrator turn, but the later Gateway call could retain only its WebChat transport label. #150308 provides the existing one-shot creator capture and executable-lifecycle prerequisite. #150921 carries the original caller's currentness through canonical Cron calls, while the landed guarded-mutation prerequisite preserves an accepted write's result. This change carries the local source through those private requester and management grants and stores it in the existing private tool-provenance envelope, alongside an account policy that remains account-bound.

The scheduler's mutation owner reconciles the source against the saved executable revision and active occurrence. It removes stale source authority at the producer instead of relaxing provider checks or adding a public job, SDK, configuration, or storage field.

Evidence

Retained Testbox protocol proof exercised the real signed local Control UI/WebSocket chat, generated MCP automations.add, private persisted job, and an independent cron.run after the creator turn settled. Both external and bundled Discord plugin variants saved callerOrigin: local, left the definition unchanged, reached the provider's channel and message endpoints with the saved account, and returned its message. Testbox run.

The public creator-propagation source composes directly with the 17-file local-source contribution. Its original-currentness check reaches the same private Cron scope used to capture local source; the guarded mutation path already supplies the commit hook where this contribution invalidates stale provider results. Seventy-seven integrated Gateway/Cron cases pass on that composition, including both real creator transports, caller revocation, account matching, executable-edit revocation, explicit reauthorization, metadata/no-op preservation, active-occurrence revocation, and old-job non-promotion. Installed-provider final-effect cases show that a revoked local-source read cannot issue another provider request or return a response accepted before revocation.

A task-scoped fixture ran in the retained Testbox against public production source 361af20554f384709c35dc35540ad66d961525cd. The signed local Control UI turn completed both its immediate provider read and generated automation creation. The unchanged scheduled job retained local, issued its own authorized provider read after that turn settled, and kept its executable definition intact. A trusted-proxy remote Control UI then changed the job's prompt while another read was pending. The persisted origin changed from local to unknown; the pending provider response was not returned, and the next forced occurrence completed without issuing a provider request. The saved owner/account boundary remained intact: a fresh signed local Control UI turn explicitly set payload.toolsAllow; the origin returned to local and the next occurrence again returned the provider message.

{"remoteEdit":{"originAfter":"unknown","pendingResultDelivered":false,"nextReadSucceeded":false,"nextProviderRequests":0},"localReauthorization":{"originAfter":"local","nextReadSucceeded":true}}

The frozen local-source contribution also passed all 20 affected production/test type graphs, the selected affected runtime suite, strict build smoke, and six supplemental source-authority cases in the retained Testbox. A released v2026.9.4 CronService round trip exposed none of the private fields and preserved the owner/account policy while losing unsupported source authority, so current code failed closed until fresh local reauthorization. #150921 and its guarded-mutation prerequisite are landed on main. This child is their exact two-commit patch-ID replay with no behavior edit. Exact changed-path conflict, line-cap, max-line, assertion-safety, format, and lint checks pass. Its qualified source CI, CodeQL, Opengrep, and Platinum review are green.

@shakkernerd
shakkernerd requested a review from a team as a code owner September 16, 2026 21:16
@clawsweeper

clawsweeper Bot commented Sep 16, 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 maintainer Maintainer-authored PR labels Sep 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 17, 2026, 12:01 PM ET / 16:01 UTC (Revision 11).

ClawSweeper review

What this changes

Preserves authenticated local origin for account-bound automations, clears it after unauthorized executable edits, and supports explicit local reauthorization.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains useful, distinct work after its prerequisites merged. No actionable introduced defect was found; the documented reauthorization tradeoff has supporting behavior and compatibility evidence.

Priority: P2
Reviewed head: 328c6e69d8f9e19c59296b2b8629ae2d9db98409

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with strong retained authority and recovery proof and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Retained Testbox evidence exercises signed local creation, persisted origin, independent scheduled reads, remote executable-edit revocation before further requests or pending-result delivery, and successful local reauthorization. All seven changed production modules match the recorded proof revision; raw-log download was blocked by the reviewer’s network policy.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Retained Testbox evidence exercises signed local creation, persisted origin, independent scheduled reads, remote executable-edit revocation before further requests or pending-result delivery, and successful local reauthorization. All seven changed production modules match the recorded proof revision; raw-log download was blocked by the reviewer’s network policy.
Evidence reviewed 9 items Current main still lacks local requester-origin retention: The fetched main normalizer retains authenticated-requester provenance only when channelRequester exists; a local-only capture is discarded. The merged prerequisites therefore do not replace this contribution.
Capture remains bound to live authenticated authority: Local provenance comes from the private creator scope. Grant resolution checks scope, operation, issuer currentness, and run identity; consumption remains one-use. Management-origin access checks the exact active management identity.
Mutation owner reconciles persisted and active authority: Executable revision and authored trigger state determine preservation or recapture. Committed authority changes invalidate active message access through the existing receipt hooks; account-policy matching remains required.
Findings None None.
Security None None.

How this fits together

OpenClaw’s scheduler saves automations created through authenticated agent turns and later runs them through the saved creator account. Private origin records and live occurrence checks determine whether scheduled message reads may reach a channel provider.

flowchart TD
  A[Authenticated creator turn] --> B[Private one-use grant]
  B --> C[Saved automation and account]
  D[Automation edit] --> E{Fresh authorization or unchanged execution?}
  E -->|Yes| C
  E -->|No| F[Clear saved origin and revoke active reads]
  C --> G[Live occurrence and provider checks]
  G --> H[Authorized account read]
Loading

Before merge

  • Resolve merge risk (P1) - Existing origin-bearing jobs stop account reads after executable edits without fresh authorization; older writers can also discard origin and require explicit local reauthorization. These operator consequences are intentional and covered by the supplied recovery evidence.
Agent review details

Security

None.

PR surface

Source +129, Tests +203, Docs +8. Total +340 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 7 169 40 +129
Tests 9 235 32 +203
Docs 1 11 3 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 415 75 +340

Review metrics

Metric Value Why it matters
Production versus regression coverage production +129 net lines; tests +203 net lines Production growth extends existing authority owners to retain local provenance and invalidate it after executable changes.

Merge-risk options

Maintainer options:

  1. Retain the documented reauthorization contract (recommended)
    Accept executable-edit revocation and older-writer origin loss with the demonstrated fresh local reauthorization recovery.

Technical review

Best possible solution:

Keep authorization in the existing creator, scheduler, and provider owners, with the documented local reauthorization path and retained released-writer compatibility proof.

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

Yes, from source: current main discards local-only requester provenance, and WebChat transport can displace local origin before scheduled reads. This reviewer did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes. The patch repairs provenance capture and invalidation at existing owners while preserving account matching and provider checks; retained proof covers both authorized reads and remote-edit revocation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 95f5b3220a71.

Labels

Label justifications:

  • P2: Restores a bounded scheduled-account read workflow without evidence of an emergency or broad outage.
  • merge-risk: 🚨 compatibility: Executable edits and older writers can require operators to explicitly reauthorize previously origin-bearing jobs.
  • 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): Retained Testbox evidence exercises signed local creation, persisted origin, independent scheduled reads, remote executable-edit revocation before further requests or pending-result delivery, and successful local reauthorization. All seven changed production modules match the recorded proof revision; raw-log download was blocked by the reviewer’s network policy.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained Testbox evidence exercises signed local creation, persisted origin, independent scheduled reads, remote executable-edit revocation before further requests or pending-result delivery, and successful local reauthorization. All seven changed production modules match the recorded proof revision; raw-log download was blocked by the reviewer’s network policy.

Evidence

What I checked:

  • Current main still lacks local requester-origin retention: The fetched main normalizer retains authenticated-requester provenance only when channelRequester exists; a local-only capture is discarded. The merged prerequisites therefore do not replace this contribution. (src/cron/tools-allow-provenance.ts:53, 95f5b3220a71)
  • Capture remains bound to live authenticated authority: Local provenance comes from the private creator scope. Grant resolution checks scope, operation, issuer currentness, and run identity; consumption remains one-use. Management-origin access checks the exact active management identity. (src/gateway/cron-creator-authority-grant.ts:183, 328c6e69d8f9)
  • Mutation owner reconciles persisted and active authority: Executable revision and authored trigger state determine preservation or recapture. Committed authority changes invalidate active message access through the existing receipt hooks; account-policy matching remains required. (src/cron/service/jobs-tool-policy.ts:117, 328c6e69d8f9)
  • Retained final-effect proof: The supplied complete PR body records Testbox execution at 361af20: signed local chat created an unchanged scheduled job that read through its saved account; a remote prompt edit suppressed the pending result and produced zero subsequent provider requests; explicit local toolsAllow reauthorization restored reads. Evidence: https://github.com/openclaw/openclaw/actions/runs/35228416264. The job endpoint reports success, but this reviewer could not download raw logs because the redirected artifact host is blocked. (361af20554f3)
  • Proof source matches all changed production modules: GitHub’s complete recursive tree for the retained proof revision and local HEAD have identical blob IDs for all seven changed production modules: creator context, provenance, types, mutation owner, job policy, private grants, and caller scope. This establishes source continuity independently of the PR’s replay claim. (328c6e69d8f9)
  • Upgrade and recovery behavior is explicit: Documentation distinguishes harmless metadata edits from executable edits requiring fresh authorization. The supplied body additionally records a v2026.9.4 writer round trip preserving owner/account policy and public-field privacy while discarding unsupported origin, followed by fail-closed behavior until local reauthorization. This is compatibility evidence, not evidence that the fix shipped in v2026.9.4. Public docs: docs/automation/cron-jobs/payloads.md. (docs/automation/cron-jobs/payloads.md:95, 328c6e69d8f9)

Likely related people:

  • shakkernerd: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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-09-17T02:09:24.455Z sha dda36c9 :: blocked before merge. :: none
  • reviewed 2026-09-17T05:40:11.402Z sha 81bfefa05f07faa90ebd0af98e9a9d89a362cd46 :: blocked before merge. :: none
  • reviewed 2026-09-17T06:09:52.307Z sha fbbda90 :: blocked before merge. :: none
  • reviewed 2026-09-17T10:01:11.462Z sha fbbda90 :: blocked before merge. :: none
  • reviewed 2026-09-17T13:42:12.385Z sha 361af20 :: blocked before merge. :: none
  • reviewed 2026-09-17T13:52:41.573Z sha 361af20 :: blocked before merge. :: none
  • reviewed 2026-09-17T14:36:10.463Z sha 673644563b79d5ae49ce9386e7d8353d2e12b1b8 :: blocked before merge. :: none
  • reviewed 2026-09-17T15:36:58.282Z sha 328c6e6 :: blocked before merge. :: none

@shakkernerd
shakkernerd force-pushed the fix/scheduled-local-source branch from 4675e9c to dda36c9 Compare September 17, 2026 01:28
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 17, 2026
@shakkernerd
shakkernerd force-pushed the fix/scheduled-channel-requester branch from ce6cc1f to bf1b37f Compare September 17, 2026 05:16
@shakkernerd
shakkernerd force-pushed the fix/scheduled-local-source branch from dda36c9 to 81bfefa Compare September 17, 2026 05:28
@shakkernerd
shakkernerd force-pushed the fix/scheduled-channel-requester branch from bf1b37f to ceefa83 Compare September 17, 2026 05:38
@shakkernerd
shakkernerd force-pushed the fix/scheduled-local-source branch from 81bfefa to fbbda90 Compare September 17, 2026 05:59
@shakkernerd
shakkernerd force-pushed the fix/scheduled-channel-requester branch from ceefa83 to c4bb6a4 Compare September 17, 2026 09:19
Base automatically changed from fix/scheduled-channel-requester to main September 17, 2026 09:53
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord and removed size: M labels Sep 17, 2026
@shakkernerd
shakkernerd force-pushed the fix/scheduled-local-source branch from 6736445 to 328c6e6 Compare September 17, 2026 15:28
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@shakkernerd shakkernerd self-assigned this Sep 17, 2026
@shakkernerd
shakkernerd merged commit 4a35a21 into main Sep 17, 2026
368 of 370 checks passed
@shakkernerd
shakkernerd deleted the fix/scheduled-local-source branch September 17, 2026 17:21
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: Locally created account automations retain authorized provider reads until an executable edit revokes their saved source.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
Locally created account automations now retain their authenticated local source after the creating turn, so later executions can perform provider-permitted reads through the saved account. Metadata-only and exact no-op edits preserve that source; executable changes revoke it until fresh local reauthorization. Remote management and unverifiable legacy jobs do not acquire local read authority.

Refs openclaw#140978
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 maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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.

1 participant