Skip to content

[BACKPORT] fix(automations): let configured owners manage jobs from chat - #158372

Merged
sjf-oa merged 2 commits into
sjf_openclaw_2026-09-04from
sjf/backport-owner-cron-1
Sep 26, 2026
Merged

sjf-oa merged 2 commits into
sjf_openclaw_2026-09-04from
sjf/backport-owner-cron-1

Conversation

@sjf-oa

@sjf-oa sjf-oa commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Why This Change Was Made

The September 4 release predates the merged owner-management fix in #148790. A configured owner asking from another Slack conversation therefore sees only the caller-scoped automation inventory and cannot manage an existing job there.

What Problem This Solves

An owner listed in commands.ownerAllowFrom cannot manage a job created in another conversation from chat on this release branch. The Gateway treats that owner as an ordinary caller when listing or changing automations.

Backport

Apply the upstream owner-management entitlement to the authority and cron paths present in this release. Configured channel owners can list, inspect, update, run, and remove existing jobs across admitted conversations. Ordinary callers remain scoped, run history remains caller-scoped, and a job's scheduled execution authority does not change. The release's Control UI harness API is retained for compatibility. Requester-continuation changes in the upstream commit were omitted because that subsystem is absent from this release branch.

Evidence

  • Seven focused test files passed across four Vitest shards, covering configured owner identity, turn admission, management grants, cron tool behavior, and Gateway method validation.
  • pnpm tsgo:core and git diff --check passed on the rebuilt commit.
  • pnpm prompt:snapshots:check passed after regenerating the four snapshots changed by this backport.
  • The latest CI run has two unrelated baseline failures in src/agents/embedded-agent-runner/run/settled-turn-finalization.test.ts, which has the identical Git blob on the release base and this PR head. check-lint-core-1 reports File has too many lines (1046) at line 1120; check-test-types-core-1 reports TS2345 at line 341. Both exact failures also occurred on the previous PR head in run 36194068878. This backport does not change that file.
  • This is a source backport of the already merged fix(automations): let configured owners manage jobs from chat #148790 with only release-branch compatibility adjustments. No live channel claim is made for this rebuilt commit.

Backport-Of: #148790
Release-Target: sjf_openclaw_2026-09-04

@sjf-oa
sjf-oa requested a review from a team as a code owner September 25, 2026 21:50
@clawsweeper

clawsweeper Bot commented Sep 25, 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 Sep 25, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 25, 2026, 9:28 PM ET / September 26, 2026, 01:28 UTC (Revision 3).

ClawSweeper review

What this changes

The branch lets configured chat owners manage automations across conversations on the September 4 branch, with owner grant checks, documentation, tests, and refreshed Codex prompt snapshots.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this September 4 backport open. The upstream fix is on main and in v2026.9.6, but the target branch lacks it. This head still rejects configured owners on restricted operator profiles before their automation write requests reach the cron handler.

Priority: P2
Reviewed head: cd47e1d51e9a5839df6ce92c1f4c4f0d5a61a43e

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The backport has a focused implementation and useful tests, but a P1 authorization-path defect prevents its advertised behavior for restricted owners.
Proof confidence 🌊 off-meta tidepool Not applicable: The Repository State identifies this as a member-authored PR, so the external-contributor proof gate does not apply. The supplied direct-handler tests do not exercise the registered Gateway dispatch path implicated by the finding. No stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The Repository State identifies this as a member-authored PR, so the external-contributor proof gate does not apply. The supplied direct-handler tests do not exercise the registered Gateway dispatch path implicated by the finding. No stored-data contract changes.
Evidence reviewed 11 items Introduced owner grant: The PR creates a channel-owner entitlement for an admitted turn and rechecks the configured owner when the grant is used.
Pre-dispatch rejection: The unchanged release-branch dispatcher checks the registered method scope before invoking a handler; it has no exception for a valid cron management grant.
Admin scope on writes: The registered cron.update, cron.remove, and cron.run methods each require operator.admin.
Findings 1 actionable finding [P1] Admit valid owner grants at the Gateway method-scope gate
Security None None.

How this fits together

An admitted channel message starts an agent turn that can call the automation tool. The tool sends a grant through Gateway authorization to the scheduler, which reads or changes a job.

flowchart LR
  A[Channel message] --> B[Owner admission]
  B --> C[Agent automation tool]
  C --> D[One use management grant]
  D --> E[Gateway method authorization]
  E --> F[Automation job]
Loading

Before merge

  • Admit valid owner grants at the Gateway method-scope gate (P1) - The new channel-owner grant is bound to the automation tool, but registered Gateway dispatch still requires operator.admin for cron.update, cron.run, and cron.remove before the handler can redeem it. Configured owners on restricted operator profiles therefore cannot perform the advertised writes. Port the narrow method-bound exception used on main and test through handleGatewayRequest; the added direct-handler cases bypass this gate. This is the unresolved finding from the prior review.
  • Complete next step (P2) - Port the method-bound owner grant check into this release branch's registered Gateway scope gate and add restricted-owner and nonowner dispatch coverage.

Findings

  • [P1] Admit valid owner grants at the Gateway method-scope gate — src/agents/cron-creator-authority-context.ts:53-57
Agent review details

Security

None.

PR surface

Source +33, Tests +73, Docs 0. Total +106 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 5 51 18 +33
Tests 8 116 43 +73
Docs 1 2 2 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 169 63 +106

Review metrics

Metric Value Why it matters
Restricted owner writes 3 advertised write methods remain admin gated Configured owners without operator.admin cannot update, run, or remove jobs through registered Gateway dispatch.

Technical review

Best possible solution:

Carry the current-main method-bound grant check into the September 4 Gateway dispatcher, preserving admin access and proving both restricted-owner success and nonowner denial through registered dispatch.

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

Yes. On this PR head, a configured owner using a restricted operator profile can mint a grant, but a registered cron.update request reaches the operator.admin method-scope check before the handler can redeem it. This path was established from source, not executed here.

Is this the best way to solve the issue?

No. The grant and handler changes need the narrow pre-dispatch exception already present on main; direct-handler tests cannot establish the promised end-to-end behavior.

Full review comments:

  • [P1] Admit valid owner grants at the Gateway method-scope gate — src/agents/cron-creator-authority-context.ts:53-57
    The new channel-owner grant is bound to the automation tool, but registered Gateway dispatch still requires operator.admin for cron.update, cron.run, and cron.remove before the handler can redeem it. Configured owners on restricted operator profiles therefore cannot perform the advertised writes. Port the narrow method-bound exception used on main and test through handleGatewayRequest; the added direct-handler cases bypass this gate. This is the unresolved finding from the prior review.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 55ee0e0dfcea.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This bounded backport affects configured owners on an older release branch; current main and v2026.9.6 already contain the upstream behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The Repository State identifies this as a member-authored PR, so the external-contributor proof gate does not apply. The supplied direct-handler tests do not exercise the registered Gateway dispatch path implicated by the finding. No stored-data contract changes.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/gateway/server-methods.authorization.test.ts src/gateway/cron-creator-authority-grant.test.ts src/gateway/server-methods/cron.validation.test.ts.
  • [P1] pnpm tsgo:core.
  • [P1] git diff --check.

What I checked:

Likely related people:

  • Ayaan Zaidi: 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)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Port method-bound pre-dispatch grant admission and prove restricted-owner success plus nonowner denial through registered Gateway dispatch.

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 (2 earlier review cycles)
  • reviewed 2026-09-25T22:06:32.305Z sha bb0a532 :: needs changes before merge. :: [P1] Admit valid owner grants at the Gateway method-scope gate
  • reviewed 2026-09-25T22:47:15.686Z sha bb0a532 :: needs changes before merge. :: [P1] Admit valid owner grants at the Gateway method-scope gate

@sjf-oa sjf-oa changed the title fix(automations): owners can manage jobs across chats on September 4 [BACKPORT] fix(automations): let configured owners manage jobs from chat Sep 25, 2026
@sjf-oa sjf-oa added the backport Backport of an already-reviewed change to a release branch label Sep 25, 2026
Backport the applicable owner-management changes from #148790 onto sjf_openclaw_2026-09-04. Keep this release's existing Control UI harness API and omit requester-continuation code absent from this branch.

(cherry picked from commit d74277a)
@sjf-oa
sjf-oa force-pushed the sjf/backport-owner-cron-1 branch from bb0a532 to 23de8ec Compare September 26, 2026 01:16
@sjf-oa
sjf-oa merged commit b703217 into sjf_openclaw_2026-09-04 Sep 26, 2026
187 of 190 checks passed
@sjf-oa
sjf-oa deleted the sjf/backport-owner-cron-1 branch September 26, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling backport Backport of an already-reviewed change to a release branch docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants