Repository navigation
fix: keep local scheduled account reads authorized - #150311
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 17, 2026, 12:01 PM ET / 16:01 UTC (Revision 11). ClawSweeper reviewWhat this changesPreserves 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 Review scores
Verification
How this fits togetherOpenClaw’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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +129, Tests +203, Docs +8. Total +340 across 17 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
4675e9c to
dda36c9
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
ce6cc1f to
bf1b37f
Compare
dda36c9 to
81bfefa
Compare
bf1b37f to
ceefa83
Compare
81bfefa to
fbbda90
Compare
ceefa83 to
c4bb6a4
Compare
14cb7b9 to
4c38fdf
Compare
361af20 to
6736445
Compare
6736445 to
328c6e6
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Fixed: Locally created account automations retain authorized provider reads until an executable edit revokes their saved source. |
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
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
messageread 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
toolsAllowedit 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 independentcron.runafter the creator turn settled. Both external and bundled Discord plugin variants savedcallerOrigin: 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 retainedlocal, 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 fromlocaltounknown; 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 setpayload.toolsAllow; the origin returned tolocaland 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.