Skip to content

fix(automations): let configured owners manage jobs from chat - #148790

Merged
roboclaw-bot merged 4 commits into
mainfrom
openclaw/investigate-failure-with-git-blame
Sep 15, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
openclaw/investigate-failure-with-git-blame

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #144814, #147241

What Problem This Solves

Configured Gateway owners cannot maintain an existing automation from Discord or another channel when the job belongs to a different session or was created by an operator.

User Impact

Fresh authenticated senders explicitly listed in commands.ownerAllowFrom can list, inspect, update, run, and remove any existing Gateway automation without switching to the Control UI. Ordinary channel users, channel allowlists, and wildcard entries do not gain this authority. No new configuration option, database migration, or dependency change is required.

Why This Change Was Made

Reuse the existing live, method-bound, one-use management grants rather than relaxing job visibility for every agent. Recheck the admitted owner against the current global owner list at use and before commit. Management preserves the job creator and scheduled execution authority.

Requester continuations retain management only, not creator execution privileges. Owner removal, a new direct user turn, session reset/archive, cancellation, or Gateway restart revoke the relevant authority. Existing Control UI administrator management remains supported.

Evidence

  • Review follow-up: restored the deprecated readonly controlUiAdmin SDK projection through 2026-10-12 with its original UI-only meaning. Both legacy and V2 public consumers are covered, and management-only scopes of both sources still reject creator grants. The regression failed before repair; 60 grant/continuation tests, scoped changed checks, and independent P0–P2 review pass.

  • Corrected the sibling WebSocket admission assertion for the new entitlement contract; all 51 tests in that file pass.

  • The new prepared-reply → automation-tool regression failed on the original production code because the configured Discord owner received no management grant.

  • A second regression demonstrated that new owner and non-owner channel messages did not retire a pending owner task; both now pass.

  • Focused coverage exercises all five management operations against foreign/trusted jobs, preserved stored execution authority, current-owner revocation during awaited validation and after yield, canonical owner aliases, non-owner/replay/heartbeat exclusions, and existing Control UI behavior. The final ingress/owner/lifecycle/persisted-continuation group passed 253 tests; additional Gateway, grant, and bundled Codex suites passed.

  • Independent autoreview: scoped-clean for P0–P2.

  • Build passed. Selected changed checks passed using the unchanged successful type/guard stages plus focused lint reruns and the remaining invariant checks. The five test-brace lint findings and a fixture-size limit were repaired without changing production behavior.

  • The four affected Codex construction cases passed on the final fixture layout. A broader post-build rerun timed out in existing MCP approval-mode cases and was stopped; the earlier complete Codex suite passed. Exact-head CI remains the landing gate.

The channel tests use synthetic inbound fixtures and real tool/grant/Gateway boundaries; this is not a live Discord-account test. There are no UI rendering changes.

Requested by @steipete.

OpenClaw session: https://team.openclaw.ai/chat/roboclaw/dashboard/bf6d93c4-a043-42d1-9e55-2770ac2b2230

Worked on by


View the OpenClaw team session

roboclaw-bot and others added 2 commits September 14, 2026 20:03
Reuse live method-bound management grants for explicit channel owners without transferring scheduled execution authority. Preserve ordinary caller isolation, owner revocation, and management-only requester continuations.

Related: #144814, #147241

Co-authored-by: steipete <[email protected]>
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 01f799e8-928d-4f62-b966-6768d35facf8
@clawsweeper

clawsweeper Bot commented Sep 15, 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 extensions: codex size: L maintainer Maintainer-authored PR labels Sep 15, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 15, 2026 05:16
@roboclaw-bot
roboclaw-bot requested a review from a team as a code owner September 15, 2026 05:16
@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: 🦐 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 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 1:57 AM ET / 05:57 UTC (Revision 3).

ClawSweeper review

What this changes

Lets explicitly configured channel owners manage existing automations across sessions using revocable grants, while preserving SDK compatibility and management-only subagent continuations.

Merge readiness

✅ Ready for maintainer review

The prior SDK compatibility blocker is resolved, and no introduced blocking defect was found. This maintainer-sponsored work remains useful because current main still restricts cross-session automation management to Control UI administrators.

Priority: P2
Reviewed head: 4f8ddcfeea348ea0e2c0dea988bb11cee66aab60

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused extension of the existing authority owner with meaningful boundary coverage and the previous compatibility blocker repaired.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer/bot contributor-proof exemption applies. Inspected production-boundary coverage exercises persisted updates, ordinary-caller rejection, and revocation during validation; the PR reports passing results, without claiming a live Discord run. No material unresolved authority-chain case was established.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer/bot contributor-proof exemption applies. Inspected production-boundary coverage exercises persisted updates, ordinary-caller rejection, and revocation during validation; the PR reports passing results, without claiming a live Discord run. No material unresolved authority-chain case was established.
Evidence reviewed 8 items Current main still lacks channel-owner management: The fetched main revision creates external creator capabilities without a management entitlement, and its conversational-management documentation explicitly limits management grants to Control UI administrator turns. The supplied latest release is v2026.9.4; its documentation object was unavailable locally, so no release implementation claim is made.
Previous compatibility finding addressed: The current scope retains readonly controlUiAdmin and projects true only for Control UI administrator entitlements. The added public legacy/V2 consumer checks cover that value and reject creator grants for either management-only source, satisfying the concrete prior finding and rank-up request.
Admission and revocation remain owner-bound: Fresh channel turns use the admitted command sender, channel, and account; the entitlement rechecks the current global owner list. New direct channel input revokes pending requester authority. Grant consumption and management assertions reject removed owners, expired grants, and inactive run authority.
Findings None None.
Security None None.

How this fits together

OpenClaw’s automation tool sends job-management requests to the Gateway scheduler. Authenticated turn admission supplies authority, which the Gateway checks before returning job data or committing changes.

flowchart TD
  A[Authenticated chat turn] --> B[Configured owner or UI administrator]
  B --> C[Run-bound management grant]
  C --> D[Automation tool request]
  D --> E[Current authority check]
  E --> F[Read or modify scheduled job]
  C --> G[Verified requester continuation]
  G --> E
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +59, Tests +512, Docs 0. Total +571 across 31 files.

View PR surface stats
Area Files Added Removed Net
Source 10 122 63 +59
Tests 20 624 112 +512
Docs 1 3 3 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 31 749 178 +571

Review metrics

Metric Value Why it matters
Production versus validation growth Production +59 net lines; tests and fixtures +512 net lines Production growth extends the existing grant owner, while most added code covers authority boundaries and compatibility.

Technical review

Best possible solution:

Keep one Gateway management-grant owner, preserve existing harness consumers, and retain current-owner checks through continuation admission and final job commits.

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

Not applicable as a defect reproduction: current main deliberately limits this authority to Control UI administrators, and the PR adds a supported channel-owner path.

Is this the best way to solve the issue?

Yes. Reusing method-bound, one-use grants avoids a competing authorization system, and the repaired SDK projection preserves the documented compatibility window.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded conversational-management improvement with existing Control UI and CLI alternatives.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer/bot contributor-proof exemption applies. Inspected production-boundary coverage exercises persisted updates, ordinary-caller rejection, and revocation during validation; the PR reports passing results, without claiming a live Discord run. No material unresolved authority-chain case was established.

Evidence

What I checked:

  • Current main still lacks channel-owner management: The fetched main revision creates external creator capabilities without a management entitlement, and its conversational-management documentation explicitly limits management grants to Control UI administrator turns. The supplied latest release is v2026.9.4; its documentation object was unavailable locally, so no release implementation claim is made. Public docs: docs/automation/cron-jobs/managing-jobs.md. (docs/automation/cron-jobs/managing-jobs.md:77, c657a10e11da)
  • Previous compatibility finding addressed: The current scope retains readonly controlUiAdmin and projects true only for Control UI administrator entitlements. The added public legacy/V2 consumer checks cover that value and reject creator grants for either management-only source, satisfying the concrete prior finding and rank-up request. (src/gateway/cron-creator-authority-grant.ts:38, 4f8ddcfeea34)
  • Admission and revocation remain owner-bound: Fresh channel turns use the admitted command sender, channel, and account; the entitlement rechecks the current global owner list. New direct channel input revokes pending requester authority. Grant consumption and management assertions reject removed owners, expired grants, and inactive run authority. (src/auto-reply/reply/get-reply-run-execute.ts:584, 4f8ddcfeea34)
  • Final-effect coverage: The inspected integration coverage uses real requester lifecycle, Gateway handlers, CronService, and stored-job readback. It checks permitted updates, denied ordinary continuations, preserved creator/runtime authority, and owner removal while update validation awaits. The PR reports this coverage passing; this read-only review did not execute tests. (src/gateway/server-methods/requester-cron-authority.integration.test.ts:333, 4f8ddcfeea34)
  • Codex dependency signal and boundary: The changed Codex runtime predicate controls whether an attempt can capture configured-MCP creator authority. It now excludes both management-only entitlement sources; the bundled construction regression covers the new channel-owner case. This establishes the dependency-related inspection signal, while the entitlement itself remains an OpenClaw host capability. (extensions/codex/src/app-server/run-attempt-runtime.ts:194, 4f8ddcfeea34)
  • Dependency source inspected: The sibling checkout’s cache origin identifies openai/codex. Its dynamic-tool response adapter receives client results and forwards them to the conversation; OpenClaw’s management entitlement is not part of this response contract. The MCP status processor was also inspected for the runtime catalog boundary. (codex-rs/app-server/src/dynamic_tools.rs:18, 6b9826e3aa83)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • openclaw/openclaw-secops: 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 (2 earlier review cycles)
  • reviewed 2026-09-15T05:25:06.993Z sha d8c236a :: blocked before merge. :: [P1] Preserve compatibility for the exported harness capability
  • reviewed 2026-09-15T05:36:16.099Z sha 5e76236 :: blocked before merge. :: [P1] Preserve compatibility for the exported harness capability

roboclaw-bot and others added 2 commits September 15, 2026 05:29
Preserve the authenticated Control UI owner boundary while checking the new management entitlement contract.

Co-authored-by: steipete <[email protected]>
Retain the deprecated readonly controlUiAdmin field with its original UI-only meaning through the documented SDK compatibility window. Management entitlements remain the sole authority source; legacy and V2 consumers are covered without permitting creator grants from management-only scopes.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Addressed the SDK compatibility finding: the deprecated readonly controlUiAdmin field is restored as a UI-admin-only projection of managementEntitlement, through the documented 2026-10-12 compatibility window. No grant validation reads the deprecated field. Public legacy/V2 consumer regressions verify its old value and reject creator grants for management-only scopes of both sources. The regression failed before the fix; 60 focused tests, the scoped changed checks, and independent P0–P2 review pass. The separate websocket admission assertion is also corrected (51 tests pass).

@clawsweeper clawsweeper Bot added 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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 15, 2026
@roboclaw-bot
roboclaw-bot merged commit d74277a into main Sep 15, 2026
202 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/investigate-failure-with-git-blame branch September 15, 2026 06:59
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
…aw#148790)

* fix(automations): let configured owners manage jobs from chat

Reuse live method-bound management grants for explicit channel owners without transferring scheduled execution authority. Preserve ordinary caller isolation, owner revocation, and management-only requester continuations.

Related: openclaw#144814, openclaw#147241

Co-authored-by: steipete <[email protected]>

* fix(automations): let configured owners manage jobs from chat

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 01f799e8-928d-4f62-b966-6768d35facf8

* test(automations): align websocket admission entitlement assertion

Preserve the authenticated Control UI owner boundary while checking the new management entitlement contract.

Co-authored-by: steipete <[email protected]>

* fix(automations): preserve the public harness admin projection

Retain the deprecated readonly controlUiAdmin field with its original UI-only meaning through the documented SDK compatibility window. Management entitlements remain the sole authority source; legacy and V2 consumers are covered without permitting creator grants from management-only scopes.

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>
sjf-oa pushed a commit that referenced this pull request Sep 26, 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 added a commit that referenced this pull request Sep 26, 2026
…hat (#158372)

* fix(automations): backport configured owner job management

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)

* test(automations): refresh owner management prompt snapshots

---------

Co-authored-by: Sarah Fortune <[email protected]>
obviyus added a commit that referenced this pull request Oct 17, 2026
Related: #168823 (this fixes fresh channel-owner messages queued for followup/collect execution, not every parent-resumption path).

## What Problem This Solves

Fixes: an authenticated channel owner sees only the current conversation's automations when their message waits in the followup queue.

## User Impact

Owners retain their existing ability to manage gateway-wide automations after a queued message starts; revoked ownership and non-owner or internal messages remain restricted. No configuration changes or migration are required.

## Why This Change Was Made

The original ingress capability expires before queued execution starts with a new run identity. Preserve a source-bound capability factory through queue collection and overflow, then enter a fresh scope for that queued run. The original sender, transport identity, current-owner check, and run-settlement/abort revocation remain authoritative; presentation defaults cannot supply another turn's capability.

## Related work and scope

Related: #148790 (merged channel-owner automation management) and #160018 (merged owner-authority preservation after a child reply). #148294 tracks the broader distinction between admission authority, continuation ownership, and delivered completion. This PR fixes fresh authenticated channel-owner messages crossing the followup/collect queue. The Control UI parent-resumption report #168823 enters through a different path; neither that entire issue nor the broader completion contract is claimed resolved here.

## Reproduction and environment

Observed on macOS with packaged OpenClaw 2026.10.2 and a configured Telegram channel owner. The controlled comparison restored the exact original versions of the three affected runtime modules, then applied the qualified fix; the installation also contained disclosed unrelated backports. The isolated Gateway cases used synthetic external Telegram/model endpoints. The separate October 15 Telegram check used the normal channel and provider. These runtime results belong to the earlier qualified patch, not to a new deployment of the October 16 integration head.

1. Configure an explicit owner in `commands.ownerAllowFrom` and use a Gateway with automation jobs belonging to multiple conversations. Confirm a fresh owner request can list the full inventory.
2. Start owner request A with a bounded wait. While A is still running, send a separate owner request B asking the native `automations` tool for `action=list, includeDisabled=true`, with the inline `/queue followup` directive at the end of B's message.
3. Confirm B arrives while A runs and executes afterward with a different run identity. Inspect the actual native tool result, not just the model's answer or a CLI list.
4. Before the fix, the exact-original control returns `scope=caller` with 1 of 6 jobs. After the fix, it returns `scope=gateway` with all 6; the separate real Telegram run returned all 73 jobs with `hasMore=false` and matching operator-inventory IDs.

The non-owner, foreign-source and authenticated-cancellation controls and the deferred-revocation limitation are linked below. This reproduction makes no mutation-race claim.

## Evidence

- October 16 integration: merged frozen main `0fd8396314714ed4251d802502a072ec558b9f5e` into this branch to resolve the actual import conflict. Head `534dce6504ba0438f0f76e111f09f852769b9a9e` retains both imports, and the PR's added/removed lines across all seven files are identical to the previously reviewed patch. Formatting and the diff check pass. A focused four-file test attempt stopped before tests in the borrowed compiler installation (`Symbol.dispose`); type-aware lint also refused dependencies outside this checkout. The borrowed compiler/test-runner versions differ from the new base and were not modified. [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/38876614603) completed successfully on `534dce6504ba0438f0f76e111f09f852769b9a9e`; the current check rollup has 69 successful, 56 skipped and 1 neutral check, with no failing or pending checks. This hosted result verifies the new integration head; the earlier runtime proof retains its stated version boundary. No local full core build or production change.

- Reproduced the loss through real ingress preparation, queue draining, followup execution, and the native cron tool before the fix, then verified gateway scope after it. External model execution and gateway transport are isolated fixtures; the capability and grant checks are real.
- On pre-integration head `e5691d669a93ada9b8dd75099d76a12292510b9c`, 130 focused tests passed: 112 prepared-reply tests, 3 queued-callback tests, and 15 queue-authority tests. The 36 new cases cover both queue modes, batching, overflow, mixed sources, current-owner revocation, sender aliases, and internal/replayed/spawned/non-owner inputs.
- On the pre-integration head above, targeted typed lint, formatting, whitespace checks, and the repository-required autoreview passed. CI exposed that a whole-object queue type annotation rejected existing private ingress metadata; the factory was captured before object construction to preserve the inferred shape. All 130 focused tests passed after this adjustment. The changed 112-test file also passed after narrowing the native tool result and preserving all real typing-module exports; two obsolete mock allowances were removed, and the mock-export ratchet passed.
- The complete [PR CI run](https://github.com/openclaw/openclaw/actions/runs/38639828076) passes on e5691d6, including production/test declarations, lint, extension-package boundaries, and baseline ratchets. Local declaration checks could not use the borrowed dependency installation; CI provides that verification. No local full core build. The packaged-Gateway negative controls below use synthetic external services; the additional real Telegram check uses the normal channel and model provider.

- Additional packaged-Gateway proof: with exact-original negative control, a queued owner returns `caller/1` before and `gateway/6` after; fixed output IDs exactly match the global inventory, including foreign-agent jobs. Native ingress, queue, tool, grants, Gateway transport and handlers are real; only external Telegram/model endpoints are fixtures.
- Nearest forbidden paths: non-owner tool surface excludes automations; a different local agent-RPC source without channel-owner/Control UI management entitlement returns `caller/1` and no foreign jobs; authenticated `/stop` after queued tool binding prevents automation execution or result. Config-only owner removal was deferred by channel reload and is not counted as applied-revocation proof. No mutation-race claim. [The evidence comment](#172539 (comment)) contains the redacted native trace and boundaries.


- Real Telegram owner-channel check (October 15): B arrived while A was executing a bounded command and ran afterward with its own run identity using a per-message followup directive. Its actual native `automations` list result was `scope=gateway`, `total=73`, 73 returned, `hasMore=false`, with every job ID matching the operator inventory. The reply was delivered to Telegram; persistent queue mode stayed unchanged. This proves the production read path, not a new revocation or mutation-commit race.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…aw#172539)

Related: openclaw#168823 (this fixes fresh channel-owner messages queued for followup/collect execution, not every parent-resumption path).

## What Problem This Solves

Fixes: an authenticated channel owner sees only the current conversation's automations when their message waits in the followup queue.

## User Impact

Owners retain their existing ability to manage gateway-wide automations after a queued message starts; revoked ownership and non-owner or internal messages remain restricted. No configuration changes or migration are required.

## Why This Change Was Made

The original ingress capability expires before queued execution starts with a new run identity. Preserve a source-bound capability factory through queue collection and overflow, then enter a fresh scope for that queued run. The original sender, transport identity, current-owner check, and run-settlement/abort revocation remain authoritative; presentation defaults cannot supply another turn's capability.

## Related work and scope

Related: openclaw#148790 (merged channel-owner automation management) and openclaw#160018 (merged owner-authority preservation after a child reply). openclaw#148294 tracks the broader distinction between admission authority, continuation ownership, and delivered completion. This PR fixes fresh authenticated channel-owner messages crossing the followup/collect queue. The Control UI parent-resumption report openclaw#168823 enters through a different path; neither that entire issue nor the broader completion contract is claimed resolved here.

## Reproduction and environment

Observed on macOS with packaged OpenClaw 2026.10.2 and a configured Telegram channel owner. The controlled comparison restored the exact original versions of the three affected runtime modules, then applied the qualified fix; the installation also contained disclosed unrelated backports. The isolated Gateway cases used synthetic external Telegram/model endpoints. The separate October 15 Telegram check used the normal channel and provider. These runtime results belong to the earlier qualified patch, not to a new deployment of the October 16 integration head.

1. Configure an explicit owner in `commands.ownerAllowFrom` and use a Gateway with automation jobs belonging to multiple conversations. Confirm a fresh owner request can list the full inventory.
2. Start owner request A with a bounded wait. While A is still running, send a separate owner request B asking the native `automations` tool for `action=list, includeDisabled=true`, with the inline `/queue followup` directive at the end of B's message.
3. Confirm B arrives while A runs and executes afterward with a different run identity. Inspect the actual native tool result, not just the model's answer or a CLI list.
4. Before the fix, the exact-original control returns `scope=caller` with 1 of 6 jobs. After the fix, it returns `scope=gateway` with all 6; the separate real Telegram run returned all 73 jobs with `hasMore=false` and matching operator-inventory IDs.

The non-owner, foreign-source and authenticated-cancellation controls and the deferred-revocation limitation are linked below. This reproduction makes no mutation-race claim.

## Evidence

- October 16 integration: merged frozen main `c126b7a2c67a794183f4674cdc2a144ce7c2f8cb` into this branch to resolve the actual import conflict. Head `534dce6504ba0438f0f76e111f09f852769b9a9e` retains both imports, and the PR's added/removed lines across all seven files are identical to the previously reviewed patch. Formatting and the diff check pass. A focused four-file test attempt stopped before tests in the borrowed compiler installation (`Symbol.dispose`); type-aware lint also refused dependencies outside this checkout. The borrowed compiler/test-runner versions differ from the new base and were not modified. [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/38876614603) completed successfully on `534dce6504ba0438f0f76e111f09f852769b9a9e`; the current check rollup has 69 successful, 56 skipped and 1 neutral check, with no failing or pending checks. This hosted result verifies the new integration head; the earlier runtime proof retains its stated version boundary. No local full core build or production change.

- Reproduced the loss through real ingress preparation, queue draining, followup execution, and the native cron tool before the fix, then verified gateway scope after it. External model execution and gateway transport are isolated fixtures; the capability and grant checks are real.
- On pre-integration head `e5691d669a93ada9b8dd75099d76a12292510b9c`, 130 focused tests passed: 112 prepared-reply tests, 3 queued-callback tests, and 15 queue-authority tests. The 36 new cases cover both queue modes, batching, overflow, mixed sources, current-owner revocation, sender aliases, and internal/replayed/spawned/non-owner inputs.
- On the pre-integration head above, targeted typed lint, formatting, whitespace checks, and the repository-required autoreview passed. CI exposed that a whole-object queue type annotation rejected existing private ingress metadata; the factory was captured before object construction to preserve the inferred shape. All 130 focused tests passed after this adjustment. The changed 112-test file also passed after narrowing the native tool result and preserving all real typing-module exports; two obsolete mock allowances were removed, and the mock-export ratchet passed.
- The complete [PR CI run](https://github.com/openclaw/openclaw/actions/runs/38639828076) passes on e5691d6, including production/test declarations, lint, extension-package boundaries, and baseline ratchets. Local declaration checks could not use the borrowed dependency installation; CI provides that verification. No local full core build. The packaged-Gateway negative controls below use synthetic external services; the additional real Telegram check uses the normal channel and model provider.

- Additional packaged-Gateway proof: with exact-original negative control, a queued owner returns `caller/1` before and `gateway/6` after; fixed output IDs exactly match the global inventory, including foreign-agent jobs. Native ingress, queue, tool, grants, Gateway transport and handlers are real; only external Telegram/model endpoints are fixtures.
- Nearest forbidden paths: non-owner tool surface excludes automations; a different local agent-RPC source without channel-owner/Control UI management entitlement returns `caller/1` and no foreign jobs; authenticated `/stop` after queued tool binding prevents automation execution or result. Config-only owner removal was deferred by channel reload and is not counted as applied-revocation proof. No mutation-race claim. [The evidence comment](openclaw#172539 (comment)) contains the redacted native trace and boundaries.


- Real Telegram owner-channel check (October 15): B arrived while A was executing a bounded command and ran afterward with its own run identity using a per-message followup directive. Its actual native `automations` list result was `scope=gateway`, `total=73`, 73 returned, `hasMore=false`, with every job ID matching the operator inventory. The reply was delivered to Telegram; persistent queue mode stayed unchanged. This proves the production read path, not a new revocation or mutation-commit race.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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