Skip to content

fix: restore scheduled reads for creator accounts - #150278

Merged
shakkernerd merged 1 commit into
mainfrom
fix/scheduled-account-reads
Sep 17, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/scheduled-account-reads

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

An automation created by an authenticated agent turn can retain permission to use message but fail to read channel messages when it runs later without an inbound conversation. This builds on the scheduled lifetime boundary in #150166 and enables account-created reads using the creator identity already recorded on the job.

An omitted account also needs a stable meaning. Following the provider's current default can select a different account after configuration changes, even though the job still belongs to its original creator.

User Impact

Account-created scheduled turns can perform supported reads allowed by their recorded creator account and provider policy. Discovery uses that account's available actions and schema. When a read omits accountId, the message tool and Gateway select the saved creator account before resolving credentials or making provider requests.

A different account remains denied. Jobs created in an external channel stay restricted to that provider. Missing or unknown creator origin cannot authorize these reads; older jobs require recreation or explicit reauthorization from an authenticated creator turn. Current tool policy, provider action and destination restrictions, job withdrawal, and caller/plugin revocation continue to apply. Delivery settings do not grant access.

Why This Change Was Made

The scheduler already records account ownership and creator origin. This consumer uses those facts through the existing private grant and live occurrence owner. Canonical permission comparisons include creator origin so changing it revokes the active occurrence, while explicitly bounded tool lists retain the authenticated provenance needed by later runs.

Account selection reaches discovery, credential preparation, and provider dispatch together. The change preserves configuration, storage schemas, plugin capability declarations, and delegated read restrictions.

Evidence

The real CLI and embedded scheduler paths pass with authenticated automations.add and actual cron.run. They omit accountId, use distinct creator/default credentials and opposite action flags, and verify both the advertised schema and provider requests select the creator account. Focused discovery, Gateway, dispatch, receipt/policy, revocation and registry checks pass; independent review found no actionable code defects.

A retained remote recovery control on 6ff0de6c4cf0 exercises the unchanged authenticated MCP creator path with synthetic Discord transport. It loads an older stored account job without proven origin, observes denial, explicitly reauthorizes that same job, and verifies the next scheduled read:

legacy origin=unknown: read denied; provider requests=0; authority unchanged
reauthorization: authenticated automations.update; same job; toolsAllow=[message]; origin=local
recovered run: read succeeded; provider requests=2; creator credentials and action schema matched
preserved: account=default; provider default=other; policy=account; tool cap=[message]
probe exit=0; source restoration=0; source diff=clean

CI passes on 0b628f7ae48. The exact-head review rates overall readiness, proof, and patch quality Platinum with no actionable findings. The integration preserves this account change and the SDK implementation landed in #150182. Account production matches the reviewed combined version used by the retained eight-case integration run; focused review also verifies the later test-import merge preserves both sets of assertions.

A fresh CLI and embedded runtime bridge passes all four operator/account journeys on this PR composed with main 9a4468148bc. The tested tree 6011f69f78b preserves the selected model, advertised action schema, creator credentials, provider results, and run completion. The tested source was unchanged, and the Testbox lease was released. Stopping that lease cancelled its carrier workflow after the test commands had exited successfully.

@shakkernerd
shakkernerd requested a review from a team as a code owner September 16, 2026 20:14
@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: L 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. 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. 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, 1:09 AM ET / 05:09 UTC (Revision 10).

ClawSweeper review

What this changes

Restores scheduled channel reads using the creator’s recorded account and origin across tool discovery, credential selection, and Gateway dispatch.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains useful work missing from current main. No actionable patch defect was found; the earlier legacy-job concern is addressed by explicit maintainer-authored documentation and retained recovery evidence.

Priority: P2
Reviewed head: 0b628f7ae481339e07cba3ae261326727bf13ecc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with useful runtime evidence, explicit upgrade behavior, and no actionable correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Retained CLI/MCP and embedded runs exercise authenticated creation, actual scheduling, creator-account schema and credential selection, and provider results through real production owners with synthetic HTTP peers. The legacy recovery trace shows denial before I/O followed by authenticated reauthorization and successful reads; focused boundary coverage checks mismatched principals and revocation. Raw bridge logs were inaccessible through this reviewer’s network route.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Retained CLI/MCP and embedded runs exercise authenticated creation, actual scheduling, creator-account schema and credential selection, and provider results through real production owners with synthetic HTTP peers. The legacy recovery trace shows denial before I/O followed by authenticated reauthorization and successful reads; focused boundary coverage checks mismatched principals and revocation. Raw bridge logs were inaccessible through this reviewer’s network route.
Evidence reviewed 9 items Pinned contribution: The verified introduction is 08918c6..0b628f7. The supplied test merge preserves the same contribution against its recorded main parent; unrelated backup and activation changes are base work.
Still necessary on main: Fetched main still mints scheduled message grants only for trusted operator policies. The merged operator prerequisite explicitly leaves account-created reads separate. The latest published release remains v2026.9.4; no merged account-read replacement is established.
Account authority and provider boundary: Scheduled access checks the live grant, selected creator account, and recorded origin; external origins cannot select another provider. Account reads remain delegated, and account grants cannot acquire operator channel administration. Plugin callbacks receive no private authorization object.
Findings None None.
Security None None.

How this fits together

Scheduled agent turns invoke the shared message tool without an inbound conversation. The scheduler’s live permission grant supplies creator identity, while channel plugins enforce access and return provider data.

flowchart LR
 A[Authenticated creator] --> B[Stored automation and tool cap]
 B --> C[Live scheduled occurrence]
 C --> D[Creator account selection]
 D --> E[Account and origin checks]
 E --> F[Channel access and provider request]
 F --> G[Recheck authority and return data]
Loading

Before merge

  • Resolve merge risk (P1) - Older account jobs without recorded creator origin can lose previously provider-permitted bundled reads until authenticated reauthorization or recreation; this intentional upgrade tradeoff is documented and has retained recovery proof.
Agent review details

Security

None.

PR surface

Source +119, Tests +550, Docs +8. Total +677 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 9 162 43 +119
Tests 8 591 41 +550
Docs 2 16 8 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 769 92 +677

Review metrics

None.

Root-cause cluster

Relationship: canonical
Canonical: #150278
Summary: This PR owns creator-account scheduled reads; the related contributions cover prerequisites or distinct consumers.

Members:

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

Merge-risk options

Maintainer options:

  1. Retain the documented recovery contract (recommended)
    Accept the explicitly documented legacy-origin restriction with the retained authenticated reauthorization proof.

Technical review

Best possible solution:

Use the existing live occurrence grant for creator-scoped reads, retaining delegated provider restrictions and the documented, demonstrated reauthorization path for legacy jobs.

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

Yes, from source: current main excludes account policies from scheduled message-grant issuance, leaving official-plugin reads without the required context. This review did not execute a reproduction.

Is this the best way to solve the issue?

Yes. The patch extends the existing scheduler authority and account-selection owners, preserves provider restrictions, and supplies a demonstrated recovery path without adding a public configuration or SDK contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 92fdb4bfe91e.

Labels

Label justifications:

  • P2: Restores a bounded scheduled-read workflow without evidence of an emergency or broad outage.
  • merge-risk: 🚨 compatibility: Legacy account jobs missing creator origin may require authenticated reauthorization before their reads resume.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Retained CLI/MCP and embedded runs exercise authenticated creation, actual scheduling, creator-account schema and credential selection, and provider results through real production owners with synthetic HTTP peers. The legacy recovery trace shows denial before I/O followed by authenticated reauthorization and successful reads; focused boundary coverage checks mismatched principals and revocation. Raw bridge logs were inaccessible through this reviewer’s network route.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained CLI/MCP and embedded runs exercise authenticated creation, actual scheduling, creator-account schema and credential selection, and provider results through real production owners with synthetic HTTP peers. The legacy recovery trace shows denial before I/O followed by authenticated reauthorization and successful reads; focused boundary coverage checks mismatched principals and revocation. Raw bridge logs were inaccessible through this reviewer’s network route.

Evidence

What I checked:

  • Pinned contribution: The verified introduction is 08918c6..0b628f7. The supplied test merge preserves the same contribution against its recorded main parent; unrelated backup and activation changes are base work. (0b628f7ae481)
  • Still necessary on main: Fetched main still mints scheduled message grants only for trusted operator policies. The merged operator prerequisite explicitly leaves account-created reads separate. The latest published release remains v2026.9.4; no merged account-read replacement is established. (src/cron/isolated-agent/run-admission.ts:56, 92fdb4bfe91e)
  • Account authority and provider boundary: Scheduled access checks the live grant, selected creator account, and recorded origin; external origins cannot select another provider. Account reads remain delegated, and account grants cannot acquire operator channel administration. Plugin callbacks receive no private authorization object. (src/channels/plugins/message-action-dispatch.ts:183, 0b628f7ae481)
  • Revocation and replay controls: The Gateway fixture checks mismatched accounts, providers, missing origins, and unknown origins without additional provider requests. It also checks fresh same-key reads, denial after revocation, and rejection of pending data after authority expires. These assertions supplement the retained runtime evidence. (src/gateway/server-methods/send.scheduled-reads.integration.test.ts:267, 0b628f7ae481)
  • Real runtime coverage: The captured PR body reports successful CLI/MCP and embedded scheduler journeys, including the four-journey bridge at https://github.com/openclaw/openclaw/actions/runs/35179192688. Source inspection confirms authenticated automation creation, actual cron.run, real HTTP transport, creator-specific credentials, schema assertions, and returned provider data; model decisions and provider responses are synthetic. The fixture exercises OpenClaw and Anthropic CLI paths, without a Codex dependency signal. (test/cron-message-read.integration.test.ts:647, 0b628f7ae481)
  • Legacy recovery and review continuity: The captured body records zero provider requests for an unknown-origin legacy job, authenticated reauthorization of that same job, then successful creator-account reads. The historical jobs-tool-policy source was retrieved through GitHub and retains the same provenance reconciliation used by the reviewed head. The previous completed review covered this exact head, reported no findings, and already acknowledged this recovery evidence. (src/cron/service/jobs-tool-policy.ts:156, 6ff0de6c4cf0)

Likely related people:

  • Shakker: Raw commit e3e3a34 adds src/cron/isolated-agent/run-admission.ts:70 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e3e3a349b905; files: src/cron/isolated-agent/run-admission.ts)

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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-16T20:34:15.512Z sha 6ff0de6 :: blocked before merge. :: none
  • reviewed 2026-09-17T01:38:35.438Z sha 2c85b0f2d65de5c38c3acab497c4b0f61bdb765d :: blocked before merge. :: none
  • reviewed 2026-09-17T02:48:19.880Z sha 2c85b0f2d65de5c38c3acab497c4b0f61bdb765d :: blocked before merge. :: none
  • reviewed 2026-09-17T02:58:59.787Z sha 4ce184f6a47d3cf27daea48b4a75da32a8b890f6 :: blocked before merge. :: none
  • reviewed 2026-09-17T03:32:15.710Z sha 4ce184f6a47d3cf27daea48b4a75da32a8b890f6 :: blocked before merge. :: none
  • reviewed 2026-09-17T04:16:12.303Z sha 4ce184f6a47d3cf27daea48b4a75da32a8b890f6 :: blocked before merge. :: none
  • reviewed 2026-09-17T04:32:28.477Z sha 3dcd846 :: blocked before merge. :: none
  • reviewed 2026-09-17T04:45:21.890Z sha 0b628f7 :: blocked before merge. :: none

@shakkernerd shakkernerd self-assigned this Sep 16, 2026
@shakkernerd
shakkernerd changed the base branch from fix/scheduled-message-reads to fix/scheduled-channel-admin September 16, 2026 20:26
@shakkernerd
shakkernerd force-pushed the fix/scheduled-account-reads branch from e11ccea to 6ff0de6 Compare September 16, 2026 20:26
@shakkernerd
shakkernerd changed the base branch from fix/scheduled-channel-admin to fix/scheduled-message-reads September 17, 2026 01:30
@shakkernerd
shakkernerd force-pushed the fix/scheduled-account-reads branch from 6ff0de6 to 2c85b0f Compare September 17, 2026 01:30
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 17, 2026
Base automatically changed from fix/scheduled-message-reads to main September 17, 2026 02:37
@shakkernerd
shakkernerd force-pushed the fix/scheduled-account-reads branch from 2c85b0f to 4ce184f Compare September 17, 2026 02:51
@shakkernerd
shakkernerd force-pushed the fix/scheduled-account-reads branch from 4ce184f to 3dcd846 Compare September 17, 2026 04:24
@shakkernerd
shakkernerd force-pushed the fix/scheduled-account-reads branch from 3dcd846 to 0b628f7 Compare September 17, 2026 04:37
@shakkernerd
shakkernerd merged commit 1f9df21 into main Sep 17, 2026
213 checks passed
@shakkernerd
shakkernerd deleted the fix/scheduled-account-reads branch September 17, 2026 05:21
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: account-created automations read supported channel data using their recorded creator account.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
Account-created automations can read supported channel data using their recorded creator account. Discovery and execution preserve account selection, recorded origin, provider restrictions, and live job authority.
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: 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.

1 participant