Skip to content

feat(cron): let linked users schedule their own work - #198119

Open
dankarization wants to merge 7 commits into
openclaw:mainfrom
dankarization:fix-linked-user-reminders-20261113
Open

dankarization wants to merge 7 commits into
openclaw:mainfrom
dankarization:fix-linked-user-reminders-20261113

Conversation

@dankarization

@dankarization dankarization commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Related: #198415.

What Problem This Solves

Linked users should be able to schedule work they are already allowed to perform, without becoming Gateway owners.

User Impact

Adds one-shot and recurring Agent-turn jobs with explicit tool limits and later management by the original caller. The creation grant is currently Telegram-conversation-bound; other users, chats/topics and bot accounts remain isolated. Tool and sandbox denies still apply.

Why This Change Was Made

Keep the authenticated creator and permission limits through delegated work, persistence and timing edits instead of borrowing administrator authority. Personal jobs cannot redirect delivery or enable global failure alerts.

Evidence

  • Reviewed local repair: 282 tests across 10 full files passed, plus affected types, lint, formatting and build. Independent narrative review findings were reproduced and repaired; this is not a canonical helper-machine verdict.
  • The repair is not yet published: the PR still points to 175c140, which lacks the scheduled-source/revocation fixes. Source publication remains permission-blocked.
  • Live Telegram/model proof on the provided laptop is still pending, as are exact-head CI and applicable maintainer/security acceptance. Replays and older upgrade probes do not satisfy this live requirement.

Existing source-less jobs are not retroactively granted authority. Older builds cannot execute newly recorded channel-source envelopes; rollback must not strip that authority.

Implementation by @dankarization.

Work sessions

Linked for team reference; these sessions aren’t public.

@clawsweeper

clawsweeper Bot commented Nov 13, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-13T05:40:42.179070Z
We couldn’t complete this review. Comment @codex review to try again.
133ae32 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram gateway Gateway runtime agents Agent runtime and tooling size: XL labels Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Maintainer security review required

This external contributor PR changes sensitive security components. A maintainer must review these changes before merging.

Current SHA: 175c140ca9993435def527b50176078a268b4dc8

These sensitive security changes were made:

  • src/agents/agent-tools.policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/cron-creator-authority-context.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/cron-creator-authority-grant.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.

After reviewing the changes, post a new PR comment containing only approval commands, each on its own line:

/allow-security-sensitive-change

A later push requires a fresh approval comment.

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Adds caller-scoped one-shot and recurring Telegram automations with creator-bound tool caps and later-turn management.

Example: Alice has operator.write and requests a recurring read-only task every 60 seconds in Telegram topic 99.

  • Before: Her non-owner channel turn cannot obtain automation creation authority.
  • After: Her admitted turn can create and manage the task in topic 99, while another participant cannot access it.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The source change is coherent and no new P0–P2 code finding was established, but required behavior proof is incomplete and feature direction remains undecided.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Partial
User problem: Linked non-owner Telegram users cannot schedule work they may already perform interactively without an owner handoff.
Reason: The capability has concrete value, but expands intentional authorization behavior and leaves the linked cross-channel and autonomous-agent requests partly unaddressed.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open: this PR supplies a concrete Telegram scheduling capability absent from current main, but the expanded authorization contract still needs an owner decision.

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

Decision needed

  • Question: Should linked Telegram callers with operator.cron eligibility receive recurring, tool-using own-job scheduling and management, including managed-child delegation after parent settlement?
  • Recommendation: Approve bounded caller scheduling: Approve creator-owned scheduling within the caller's effective tool ceiling and original conversation, subject to the separately tracked validation and security gates.
  • Why: This expands intentional channel authorization behavior, and the inspected discussion contains contributor intent but no maintainer approval of this expanded contract.

Before merge

  • Add real behavior proof - Current-head evidence exercises Telegram admission and cron/SQLite management through separate in-process compositions. The body additionally reports real CLI/Gateway persistence probes, including cold loading of a spawn-produced personalReminderSurface=true row, but supplies no real linked-user Telegram/model scheduling-and-firing trace. Upgrade evidence starts at 2026.11.1 rather than latest stable v2026.11.3; compatibility validation for the persisted personalReminderSurface field is therefore incomplete. Redact IPs, API keys, phone numbers and non-public endpoints from supplied logs, terminal output or recordings. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve security concern: Remove private work-session links - The public PR description includes non-public team chat/session URLs; remove these locations and retain public, redacted evidence instead.
  • Resolve merge risk - Contributor: remove private team-session links from the public PR description before merge.
  • Await maintainer action - A maintainer must review and approve the security-sensitive changes on head 175c140 through the enforced approval gate.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [low] Remove private work-session links

Tests

  • Low-value test src/gateway/server-methods/agent-run-local-operator-authority.test.ts: Remove the added child-after-parent-settlement case: the stronger registered spawn case already exercises the same admission, retained human source, cancellation/revocation and release behavior; this previously noted duplication remains unchanged.
  • Missing end-to-end proof: Supply redacted real Telegram/model evidence for recurring tool-using creation, original-topic firing, fresh-turn management and peer rejection, plus latest-stable upgrade validation with existing settings and data intact.
Agent review details

How this fits together

Telegram ingress supplies authenticated human and conversation facts; agent and child-run grants carry those facts into Gateway cron handlers, which authorize and persist jobs for execution and original-conversation delivery.

flowchart TD
  A[Telegram human message] --> B[Ingress authority]
  B --> C[Caller and conversation grant]
  C --> D[Agent or managed child]
  D --> E[Gateway cron handlers]
  E --> F[SQLite automation job]
  F --> G[Original Telegram conversation]
Loading

Technical review

Best possible solution:

Extend the existing cron authority and persistence owners with an approved caller-bound scheduling contract that preserves human, tool-cap and conversation isolation.

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

Current-main source confirms the missing non-owner Telegram admission path; this review executed no target code, and the custom-deployment lifecycle report does not identify this head as its source.

Is this the best way to solve the issue?

The implementation coherently extends existing grants, session facts and cron handlers; broader channel and autonomous-agent requests remain outside its Telegram admission contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 18892937f802.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Extend the existing cron authority and persistence owners with an approved caller-bound scheduling contract that preserves human, tool-cap and conversation isolation.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Provenance checked

Testing

Proof path: in-process harness.

Security

Needs attention: No concrete runtime authority bypass was established, but the public description exposes private work-session locations.

Evidence

Security concerns:

  • [low] Remove private work-session links
    The public PR description includes non-public team chat/session URLs; remove these locations and retain public, redacted evidence instead.
    Confidence: 1

What I checked:

  • Reviewed PR introduction: Inspected the pinned introduced diff, distinguishing it from base movement; no target code or tests were executed, and the checkout remained clean. (175c140ca999)
  • Current-main capability boundary: Current main issues fresh channel cron authority to owner turns; its separate direct-operator admission already supports scoped scheduling and does not provide this Telegram ingress path. (src/auto-reply/reply/get-reply-run-execute.ts, 18892937f802)
  • Explicit human admission: The new origin requires matching requester and operator profiles, operator.cron eligibility, and the admitted Telegram session and reply route; operator.write satisfies that scope through the existing compatibility contract. (src/auto-reply/reply/personal-reminder-origin.ts:23, 175c140ca999)
  • Gateway confinement: Creation and update validation require an explicit finite tool cap and original Telegram route; access checks additionally require the recorded human creator, owner, session and account. (src/gateway/server-methods/cron-caller-scope.ts:69, 175c140ca999)
  • Boundary coverage and prior repairs: The Gateway lifecycle cases cover recurring read-tool jobs, fresh-turn management, rejected tool-cap expansion and other-human/topic/account isolation; registered Telegram ingress coverage and correctly run-bound validation fixtures retain both earlier code repairs. (src/gateway/server-methods/cron.gateway-policy.integration.test.ts:775, 175c140ca999)
  • Full discussion and proof inspected: The full REST body reports current-candidate integration and persistence checks, explicitly excludes live Telegram/model firing and latest-stable upgrade coverage, and includes private work-session links that should be removed. No recorded maintainer approval of the expanded permission model was found in the inspected discussion or reviews. (175c140ca999)

PR surface

Source +618, Tests +1578, Docs +18, Other +2. Total +2216 across 56 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 39 765 147 +618
Tests 15 1620 42 +1578
Docs 1 18 0 +18
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 56 2405 189 +2216

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A useful scheduling capability for linked channel users, with limited scope and an unresolved authorization-policy decision.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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 (2 earlier review cycles)
  • reviewed 2026-11-13T05:45:39.693Z sha 133ae32 :: needs real behavior proof before merge. :: [P2] Move Telegram authority assertions onto an allowed test boundary | [P2] Bind cron validation fixtures to the grant's operational run
  • reviewed 2026-11-14T07:44:49.792Z sha f03801c :: needs real behavior proof before merge. :: none

Reviewed November 14, 2026, 6:59 AM ET / 11:59 UTC (Revision 3).

Copy link
Copy Markdown
Contributor Author

Thanks — both concrete CI findings are addressed in 5f6f737.

The Telegram assertions now run through the registered plugin in a core-owned Gateway integration test; the extension no longer imports those private core modules. Cron fixtures use the grant’s actual run ID, with mismatched-run and revoked-grant rejection still covered. All 188 selected tests, the extension boundary check, three affected type graphs, scoped lint and formatting pass locally.

One correction to the decision question: the implementation checks the linked profile’s operator.write permission, not operator.cron. It still needs an explicit maintainer decision and security approval. The requested live Telegram firing and existing-state upgrade proof remain outstanding; I am not treating these test fixes as that proof. New-head CI is running.

Worked on by:
- @dankarization

Co-authored-by: dankarization <[email protected]>
OpenClaw-Publication: 32289693-b031-4179-80f5-a3c563b25e5c
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Small correction on scope from the person whose deployment raised this.

The narrow framing in this PR — one-shot, tool-free reminders with a fixed delivery route — is not actually what the use case needs, and I asked for it that way earlier. My mistake.

What I really want: a linked, non-owner person should be able to create and manage their own automations with the same effective rights they already have as a caller. They can already do plenty of things; the only thing they cannot do is anything inside automations. That looks like an upstream gap rather than a config mistake on my side, because an ordinary allowlist never lifts the owner-only deny.

Concretely, for a caller-scoped job:

  • the job should carry the caller's own tool surface (bounded by their role and the agent's policy), not a fixed empty list;
  • creator, agent, account and original conversation/session should be bound by the runtime;
  • only that caller can list, read, update, cancel or run their own jobs, and nobody else's;
  • recovery and restart should keep the same scope;
  • no grant of global job administration, other people's jobs, arbitrary destinations or cross-session wakes.

The one-shot reminder path here is a reasonable first step, but please treat the general caller-scoped case (#187264, #168389, #141201) as the actual target. I am testing that behaviour on a sub-production Gateway with real users.

Related: #187264, #198415.

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Nov 14, 2026
@dankarization dankarization changed the title feat: add caller-scoped personal reminders feat(cron): let linked users schedule their own work Nov 14, 2026
roboclaw-bot and others added 2 commits November 14, 2026 11:23
Worked on by:
- @dankarization

Co-authored-by: dankarization <[email protected]>
OpenClaw-Publication: 28c614f8-49be-4489-9ffd-f7411e203b2c
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Copy link
Copy Markdown
Contributor Author

I ran a live scheduled-tools check with the 992ab02f snapshot in my integration build.

An agent created a one-shot job limited to read and exec. The parent's terminal result was saved before the scheduled run started. The scheduled turn returned unique file contents that were absent from its prompt and created the expected command marker. I checked both independently, then removed the job and archived the test session.

This used owner authority. Live employee/nonowner acceptance is still outstanding; no owner role was added for this test.

The branch has since advanced to 175c140c. These results cover the earlier snapshot, not that newer head. I'm leaving the code untouched while the ongoing work continues.

Copy link
Copy Markdown
Contributor Author

I tested the repair packet against 175c140c (resulting tree a8ba1d19) and found another revocation case:

  1. A linked member creates a job with a captured operatorSource.
  2. An admin changes only its interval, from one hour to two hours. The update succeeds, but the stored job loses operatorSource.
  3. Revoke the creator's role and force-run that same job.

The run still finishes ok: model requests increase from 3 to 6, read returns the test file contents, and exec writes a fresh marker. I removed the marker before each probe and checked the tool results in the QA database. With the original source intact, the revoked job correctly stops before inference: 0 → 0 requests and no marker.

An admin change from the current session target to an isolated target also drops the source and lets the changed job run. That second probe used a member creator; the revoked-creator result above is the schedule-only case.

The positive checks also passed: 46 focused tests, plus one member job surviving a cold restart and firing naturally with working read and exec. These used an isolated Gateway with local Telegram/model replay, not live employee accounts. The supplied E2E needed only a private temporary-directory location to get past the fixture's permissions check.

I haven't changed the product code or this branch. The repair needs to preserve or safely revalidate the creator's authority on these edits, rather than falling back to a job without a source. I'm holding this packet out of our deployment until that case is fixed and retested. These results cover the supplied repair tree, not the current unmodified PR head.

dankarization commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Correction after an actual built-runtime test: the source-loss probe below placed the new job in an old-initialized schema-40 fixture. It was a persisted-format probe, not the previous executable opening a real newer store. We have now run the actual built f521fcf Gateway against a main-created schema-41 SQLite fixture containing a channel-source job: it exited 78 with the specific newer-schema refusal before cron RPC, and the job rows remained unchanged.

The existing 41/40 schema boundary therefore fences this tested executable downgrade. The earlier probe does not establish an executable path through that boundary, and requiring a new format bump solely from that probe was too strong. An executable-only rollback still cannot use the newer store; matched state restoration before new traffic or a compatible forward-recovery runtime is required. This is not acceptance of the pending personal-reminder port, published 175c140c, rejected a8ba1d19, or real non-owner Telegram behavior. The earlier observations follow for transparency:


Additional independent compatibility result from the current-main adaptation (not a qualification of published head 175c140c):

The narrow repair passed four Gateway handler checks and an isolated real-Gateway negative test: an interval-only edit retains the source and revision, incompatible target changes are rejected without mutation, and revocation prevents provider/tool effects. One job also survived a cold restart and fired through the natural timer with bounded read/exec effects. That last probe used a synthetic command-owner linked-member profile; it is not proof of non-owner creation or live employee Telegram acceptance.

The downgrade probe is still unsafe. The previous operator runtime f521fcf refuses a read of the newer channel-source principal, but accepts an interval-only update and removes operatorSource. Refusing reads alone therefore does not establish safe compatibility. An executable-only rollback must not be advertised as safe, and stripping source authority is not a rollback strategy.

We are excluding this repair from the new production candidate. The published 175c140c and the previously rejected a8ba1d19 packet are not substitutes. Required next work is an explicit persisted-format compatibility contract and a downgrade test that preserves the envelope or rejects the mutation before writing, followed by exact corrected-source checks and the separate real non-owner acceptance.

Legacy source-less jobs remain a separate compatibility problem; these results do not authorize deriving a grant from an identifier or silently assigning owner authority. No production roles or jobs were changed for these probes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram clawtributors PR from a clawtributor docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. security-review-required security-sensitive-changed size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants