Skip to content

refactor(cron): keep occurrence authority fixed after admission - #201377

Merged
obviyus merged 10 commits into
mainfrom
refactor/check-once-cron-occurrence
Nov 18, 2026
Merged

obviyus merged 10 commits into
mainfrom
refactor/check-once-cron-occurrence

Conversation

@obviyus

@obviyus obviyus commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A cron occurrence restores its owner's authority successfully, then restoreGatewayOperatorSnapshot subscribes to role/profile/device/shared-auth/OCID/access-policy changes and revokes that same running occurrence. A real isolated Gateway reproduction demoted the owner while a model-requested exec command slept: the base occurrence immediately failed with Session event execution aborted (recorded as errorReason: timeout). That observed failure is not relabeled as a different log family.

Root cause on base: the role-assignment subscription in operator-run-recovery.ts:275–289 calls revoke at line 285, whose abort is at :98–105. Shared-auth/device listeners (:182–199) and profile notifications (:375) feed the same lifetime owner. The occurrence marker's independent repeated generation/map comparison is active-jobs.ts:127; its explicit removal/cancellation branches (:128–129) remain.

The logged T10 string is followup queue: input withheld; refusing replay: Cron occurrence source authority is no longer active (12 baseline events). It was not reproduced by the real cron/yield or role-change probes. On base, captureCronJobSourceAuthority emits its inner literal when the current marker differs (including generation retirement), when the job is removed without accepted self-removal, or when cancellation was requested. A standing-grant owner failure is forwarded separately. On this change, the captured callback no longer compares the active-marker map/generation; removal and explicit cancellation can still emit the exact literal. Fresh capture still requires an active occurrence. Historical T10 causation remains unproven.

The original tool-caller/T05 investigation was stopped by the lead after three current-main real-Gateway compaction flows passed. Its chronology, proof limits and watch after next deploy finding are retained at ../refactor-check-once-tool-caller/body.md; this branch does not claim a T05 fix.

Rule

Each occurrence checks its owner's current authority once when the occurrence starts. A running occurrence keeps its captured identity, scope/model ceiling and tool surface. Role/policy changes and job-definition edits apply to the next occurrence. Queued or replayed work checks again at its own start. Deleting/disabling a job or explicit Stop still cancels. Resource release, exact write ownership and command approvals remain authoritative.

Change

  • Stop post-restoration device, shared-auth-generation, role/config, profile, OCID and access-grant notifications from revoking an admitted recovered operator. Keep all original restore-time authentication, identity, role, access-grant and paired-device checks.
  • Capture role facts and the prepared model ceiling after restoration. Do not refresh the running occurrence's model policy or publish model-policy change subscriptions.
  • Supply reauthorize for fresh queued/replayed starts through PR 1's shared authority contract. It reruns the saved policy check without subscribing or aborting other holders when admission is refused. A configured model-policy object that differs from its captured copy at the new start, widening included, refuses that queued start; the user re-sends and a fresh request gets a fresh ceiling. This rare, visible, recoverable refusal avoids wildcard-subset machinery and never mutates an in-flight ceiling.
  • Remove active-map/generation comparisons from captured occurrence/source/standing-grant guards. Keep job-removal/cancellation, exact admitted-run binding/release, and physical-store/agent-owner checks.
  • Stop committed job edits from retiring the occurrence's already-captured message grant. Remove the obsolete action-revocation flag/notifier and its now-unused equality helper. Preserve the source-mutation flag used by queued on-exit launch admission, and preserve schedule/trigger accounting and CAS predicates.
  • Remove the additional device-change subscription on already-restored detached continuations. Keep the original source identity and scope intersection, independent retention/release, and fresh restoration before a new continuation.

Non-cron callers: restoreGatewayQueuedOperatorRecovery's Gateway-source branch uses the same recovered owner, so queued native/restart work gets the same check-once rule; captureGatewayOperatorContinuation uses that path too. The separate channel-source recovery branch is intentionally unchanged per scope. No schema, stored-row or protocol change.

Obsolete tests now let admitted writes and captured message grants finish, then refuse fresh restoration/readmission after revoked authority. Stop/release/deletion, pending admission and exact self-removal ownership remain covered. The accepted-child real-write regression moved from the oversized recovery test into its existing effects-test owner; its boundary coverage was retained. The scheduled-message transport matrix now exercises explicit admission closure/cancellation rather than using a policy edit as a synthetic Stop.

Threat model

  • Rows 1–2 (reachability and whose data): restore and every fresh occurrence still validate the original authenticated profile/device/grant and current role. Captured scopes, role facts, model ceiling, requester and source identity never widen. Removing post-admission policy subscriptions accepts only the documented risk that one admitted request finishes after a change.
  • Row 3 (secrets): credential resolution/redaction and private recovery snapshots are unchanged; no credential is copied into logs or proof arguments. Data/source/physical-store predicates still flow through existing assertion composition.
  • Row 4 (execution): sandbox, per-command approvals, execution budgets, tool caps and abort signals are unchanged. Removing an occurrence's permission-mutation flag does not approve another command or adopt another requester's capability.
  • Row 5 (fresh starts): new cron occurrences re-restore current owner authority. Replayed/queued starts use PR 1's explicit reauthorize call sites; a refused new start does not abort another running holder. Queued on-exit source-change admission remains intact.
  • Kept fences/cancellation: transcript writer binding, expected session/CAS, physical state ownership, plugin leases, exact admitted-run release, explicit Stop, disable/remove cancellation, exact self-removal ownership and target-chat deletion watches remain.

Remaining lifetime checks

The combined plugin-ingress recovery listener stays in this PR. restoreIngressPrincipalRecovery combines the ingress owner's service/Gateway/plugin-disposal signal with consent-grant and principal-admission policy signals. The owner signal includes real stop/close/dispose cancellation (service-control-ui-ingress.ts:38–43,59–63), so removing the combined listener wholesale would lose cancellation. Per the lead's explicit scope decision, ingress consent/admission signals can therefore still revoke a restored run; no logged refusal here was attributed to that path. The separately scoped next step is to expose the owner cancellation signal independently in remote-ingress-principal-recovery.ts, then stop forwarding policy invalidation into already-admitted work.

Shared-auth-generation invalidation can include rotation of the Gateway authentication secret, including a rotation after a leak. Its post-admission subscription is deliberately removed under the same next-request rule: one already-admitted request may finish. Initial restoration and explicit queued-start reauthorization still check the recorded generation against the current required generation, so the old credential cannot start another request. Secret storage, redaction and credential ownership are unchanged.

Evidence

Source tier; real isolated Gateways launched with ocx src, a real model via exec SecretRef, unique named profiles and loopback ports. The real model created an authenticated conversation-linked recurring automation through the real automations tool; cron.run started its occurrence. No authority predicate, Gateway handler or refusal was substituted.

Flow Base 6ec27bd739c7 This change
Owner demoted with users.setRole while real model-requested exec sleeps Occurrence failed immediately: Session event execution aborted; no S1_CRON_FINISHED Command and subsequent real sessions_list completed; occurrence status: ok, summary: S1_CRON_FINISHED
Next occurrence under demoted owner Refused during fresh restoration: The operator authority that created this automation was refused ... Cause: Restart recovery operator identity changed. Same refusal; no model work admitted
Next direct request from demoted operator FORBIDDEN: missing scope: operator.write Same admission refusal
Cron parent spawns child, yields, and resumes from completion Completed successfully; exact T10 absent Not claimed as a failing-base comparison

Each occurrence waits for the previous one's terminal result before the next one starts. Earlier attempts where the model skipped the probe command, or where the harness asked for the next occurrence too early, are not counted as proof. All test Gateways and state were removed afterwards.

Integration and checks

Builds on #201334 (merged as 04cb8179ccd66c88f2b32eb8bca8c53d2e8b9cb5).

Rebased the eight cron-only commits off a8e5504847bb onto narrowed PR 1, added the typed-refusal correction, then rebased all nine commits onto merged main 04cb8179ccd66c88f2b32eb8bca8c53d2e8b9cb5; all rebases were conflict-free. Current head: 9db9ccc8dcc9ac7a25832832b00908b7fa792290, including the CI consumer-contract corrections. The narrowed base's runtime-guard, registry and approval ownership remains unchanged; none of the old PR 1-only lifecycle scope changes was reintroduced.

  • Production relative to merged main 04cb8179ccd66c88f2b32eb8bca8c53d2e8b9cb5: +57 / −144 (net −87; 201 lines touched) across eight runtime files.
  • Deleted symbols/state: noteActiveCronJobMessageActionAuthorityMutation, cronJobMessageToolAuthorityInputsEqual, messageActionAuthorityRevoked, recovered-policy subscription recheck, detached deviceRevocation / stopDeviceRevocation.
  • Start-check ownership: the first prepared runtime admission is cached and checks once across retries/fallbacks. A returned-result or queued turn can also traverse PR 1's earlier start hook, so the same start can check reauthorize redundantly. Both check current person authority, not socket liveness, before execution; neither installs a running-request policy check. Per the lead's explicit decision, this admission-time redundancy is retained rather than adding per-start deduplication/ownership machinery. The shared authority contract has no safe recovery-owner discriminator.

Rebased-head proof

Proof tier: vitest-source, explicit files through ocx test --maxWorkers=2; no build, push or autoreview. The CI repair replay ran all 19 affected/owner files, 307 cases: 305 passed, with one new expected-message mismatch and one paired-device Template Add timeout. After correcting the expected message, the final complete provider/Template Add replay passed 24/24. All 247 owner-suite cases below passed in the broad replay.

Owner suite Result
All five operator-run-recovery*.test.ts files 64/64 passed: main 43, effects 6, access-policy 7, native 6, channel 2
session-event-handoff.test.ts 22/22 passed
server-cron-failure-repair.final-effect.test.ts 12/12 passed
admitted-run-context.test.ts 20/20 passed
active-jobs.test.ts 48/48 passed
message-tool.scheduled-lifetime.test.ts 18/18 passed
run.operator-continuation.test.ts 35/35 passed in the final full-file replay, including both corrected before-effect refusals
commands-plugin.scheduled-turns.test.ts 28/28 passed in the final original-order infra replay, including the authorized queued child

The recovery owner's closed-socket / explicit Stop / revoked-person table passes unchanged, as do pending preparation, retained accepted children and fresh continuation restoration.

Rebase integration findings

  • Refusal stage assertion corrected: without the old runtime-guard lifecycle scope, first admission can refuse after the synthetic runner wrapper was entered. The test now counts successful model admissions rather than wrapper invocations; it still requires zero model admissions, zero protected reads/writes and the specific refusal reason. No safety assertion was removed.
  • Typed refusal presentation fixed: GatewayOperatorRecoveryAuthorizationError from first admission could enter provider-auth string classification and display an unrelated AI-service sign-in instruction. The execution error handler now routes that existing error type before provider classification. Both before-effect allowlist/auth-mode cases pass with specific reasons. Both passed unchanged on base a73eded68c45; this was an integration regression, not inherited red.
  • Authorized queued child: the first full batch timed out waiting for queued → terminal; the same case passed alone on base and corrected head. Subsequent full infra replays passed, including all 50 handoff/commands cases on the merged-main head, with this child passing in 6.7 seconds. All 35 continuation cases also pass on that head. Its channel recovery branch is unchanged by this PR. Passing replay does not establish a production cause or a fix; no timeout increase, weakened assertion or speculative queue change was added.

Static checks on merged main

  • tsgo:core: passed after the typed-refusal correction.
  • Full tsgo:core:test: 29/29 shards passed for the CI consumer repair. Subsequent changes were formatting and an expected error string only. The inherited queue.authority.test.ts typing errors on a73eded68c45 were corrected in refactor(gateway): keep operator authority fixed per request #201334 before merge.
  • Oxfmt and Oxlint passed all seven CI consumer-repair files; the formatter correction and final expected-message change were rechecked.
  • Raw Oxlint reports only inherited handoff max-lines debt: 707/700 counted, 741 physical lines on both base and head. The enforced max-lines ratchet passes: 388 grandfathered suppressions; OPENCLAW_ 462/462*. No unrelated extraction or suppression was added.
  • check:session-identity-ratchet: passed, 1615 files / 6415 grandfathered pins. The inherited operator-run-authority.ts baseline shrink was corrected in refactor(gateway): keep operator authority fixed per request #201334 before merge.
  • Default/main check:test-lines-ratchet: passed, +278 / 400.
  • Default/main check:lifetime-check-ratchet: passed, 24 inventoried checks, no per-file growth against 04cb8179ccd66c88f2b32eb8bca8c53d2e8b9cb5.

CI consumer contract corrections

CI run 44371699265 exposed additional consumers of the changed recovery contract:

  • Access, native Template Add and serialized OCID recovery: policy changes happened after authority restoration. Tests now retain admitted Access/model ceilings and current work, then require fresh restoration/readmission to refuse. Exact release still invalidates the held authority.
  • Native stream processes: the existing process keeps its captured OCID/app/shared-auth grant through revocation and payload edits. Natural exit still releases its supervised scope; shutdown still cancels; a fresh process start refuses the revoked source. Ordinary explicit reauthorization remains covered.
  • Control UI child automation: the device is revoked only after runtime admission. That occurrence completes; released target guards fail, and its next occurrence is refused before model work.
  • Queued CLI: device removal and role changes happen before start and remain refusals. Tests now match the existing, more specific source-policy/identity diagnostics; production messages are unchanged.
  • Provider allocation reply: returning an allocation completes the same admitted createWithRequest, rather than starting queued/replayed work. The test now requires that creation to finish, fresh source restoration to refuse, and explicit destruction to clean the allocation after the original authority is released. Lost-reply and bootstrap-cleanup tests retain their strict cleanup requirements.

Consumer-file proof: Access 9/9, Template Add 12/12, OCID persistence 14/14, stream 2/2, child 7/7, CLI 4/4, provider recovery 12/12. The first paired-device Template Add replay timed out at the existing 120-second limit; its final full-file replay passed unchanged. That replay is not claimed as a timeout fix, and no timeout or assertion was weakened. Provider cleanup passed, including explicit destruction after release and the unchanged lost-reply/bootstrap-cleanup scenarios. No additional production change was necessary.

- Capture recovered operator policy once while retaining cancellation, release and physical-source fences.
- Recheck recovered policy only at explicit queued starts and refuse changed model-policy snapshots.
- Remove in-flight occurrence generation and message-policy mutation vetoes; preserve queued on-exit admission.
- Checkpoint before stacking on the admitted-authority reauthorization contract; final validation follows integration.
- Keep the mixed ingress signal listener because it includes service stop, Gateway closure and plugin disposal.
- Leave separation of ingress policy signals outside this occurrence-authority change.
- Update explicit scope-closure refusals to the owning released capabilities.
- Keep captured occurrence grants across marker retirement while refusing a fresh capture.
- Preserve exact self-removal fencing of replacement markers.
… work

- Check current shared-auth generation at recovered readmission and reauthorize distinct continuation starts.
- Preserve admitted writes while rejecting future starts after durable device and policy revocation.
- Update obsolete recovery expectations and explicit resource-release coverage.
- Reauthorize recovered operator authority once before the first runtime admission starts.
- Keep cached retries and fallbacks on their original admitted authority.
- Extend the fallback regression to reject a revoked fresh request without aborting the running holder.
- Verified the owner unit suite and all twelve cron failure-repair final-effect cases, including queued device revocation.
- Reauthorize the current principal policy without invoking an expired origin-claim assertion.
- Keep normal start assertions and explicit origin Stop cancellation before runtime admission.
- Prove a closed original connection can start, while Stop and role revocation refuse; preserve origin-scope closure checks.
- Verified seven focused recovery cases and isolated snapshot/authorized queued-child controls.
- Keep abandonment as generic fallback so recorded admission failures remain visible.
- Let in-flight merges finish after role changes while fresh restoration refuses.
- Check published policy changes without depending on a prior restoration to invalidate cached role policy.
- Treat the not-admitted placeholder as generic fallback, like abandonment.
- Both principal early-refusal regressions retain their specific reasons on parent and head.
- Route recovered operator authorization failures before provider auth heuristics.
- Measure model admission rather than synthetic runner entry in continuation refusal proof.
@clawsweeper

clawsweeper Bot commented Nov 18, 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 labels Nov 18, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR preserves admitted cron and recovered operator authority until completion and rechecks authority when new work starts.

Example: An automation's owner is demoted while its model-requested exec command sleeps.

  • Before: The occurrence aborts with “Session event execution aborted.”
  • After: The admitted occurrence finishes with S1_CRON_FINISHED, while the next occurrence is refused.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful direction with production observations, blocked by a fresh-start model authorization gap and incomplete consumer updates.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The full PR body records a real model and isolated Gateway exercising owner demotion during cron exec: the changed occurrence finishes with status ok and S1_CRON_FINISHED, while subsequent occurrence and direct-request admissions are refused.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An accepted automation can abort when its owner's role or policy changes during execution.
Reason: The maintainer-authored direction follows the repository's request-start authority rule and addresses a demonstrated interruption.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: this maintainer-authored PR addresses demonstrated interruptions, but recovered queued starts can retain newly forbidden models, and the consumer tests and documentation need a complete cutover.

Priority: P2
Reviewed head: 78d14ce0db161ccd564bb42ad3ce12129909f5cb

Before merge

  • Compare resolved model membership at recovered starts (P1) - With modelPolicy: { sourceAgent: "source" }, restore authority while that agent permits fixture/a and fixture/b, then remove fixture/b from the source agent's fallbacks before queued adoption. The role's modelPolicy object remains identical, and sourceRolePolicy excludes model policy, so reauthorize succeeds. Because this PR also freezes authority.modelPolicy, the new request can still use fixture/b. Base recovery dynamically intersected current model permissions. Prepare current policy and compare its resolved membership using the existing prepareOperatorModelPolicy/readOperatorModelPolicyMembership pattern from operator-run-authority.ts; cover both sourceAgent narrowing and widening.
  • Update the remaining recovery consumers for the new contract (P2) - Freezing assertPolicy changes consumers beyond the edited suites. Exact-head CI reports obsolete cancellation assertions in cron-stream-source-authority.test.ts:145/229, openclaw-id/scheduled-source.persistence.test.ts:388, isolated-agent/run.operator-source-child.test.ts:305, worker-environments/provider-create-recovery.test.ts:417, and operator-access-program.worker.test.ts:204. CLI prepare.scheduled-handoff.test.ts:147 also expects the former generic refusal instead of the new identity/source-policy refusal. Update these consumers to distinguish admitted completion from fresh-start refusal, retaining their explicit Stop and release checks rather than dropping coverage.
  • Remove the contradictory occurrence-revocation promise (P2) - The updated page says definition edits apply to the next occurrence, but lines 181–185 still promise that withdrawing message capability or revoking caller authority stops pending reads from the active occurrence. The removed mutation notifier and captured guards no longer provide that behavior. Update this passage to identify which changes affect future work and which explicit cancellation actions stop the running occurrence, so operators do not rely on a permission edit to cancel it.
  • Resolve security concern: A restricted operator can start work on a removed model - The principal is the original recovered operator, the request is a later queued turn, and the protected effect is inference on a model removed from its source agent's allowed membership.

Findings

  • [P1] Compare resolved model membership at recovered starts — src/gateway/operator-run-recovery.ts:366-368
  • [P2] Update the remaining recovery consumers for the new contract — src/gateway/operator-run-recovery.ts:340-344
  • [P2] Remove the contradictory occurrence-revocation promise — docs/automation/cron-jobs/payloads.md:152-154
  • [medium] A restricted operator can start work on a removed model — src/gateway/operator-run-recovery.ts:368
Agent review details

How this fits together

Cron and Gateway recovery restore authenticated operator snapshots into authority used by agent admission, queued turns, model selection, and tool effects.

flowchart TD
 A[Stored operator snapshot] --> B[Recovery admission]
 B --> C[Captured authority]
 C --> D[Running occurrence]
 D --> E[Model and tool effects]
 C --> F[Queued request]
 F --> G[Start reauthorization]
 G --> E
Loading

Technical review

Best possible solution:

Keep admitted authority fixed, compare resolved model membership at recovered starts using the existing model-policy owner, and finish the consumer cutover.

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

Current-main subscriptions explain the reported interruption, and the supplied isolated-Gateway observations exercise it; this review executed no target code.

Is this the best way to solve the issue?

The existing recovery and admission owners are appropriate, but comparing configured policy alone misses derived model restrictions that the direct Gateway owner already handles.

Full review comments:

  • [P1] Compare resolved model membership at recovered starts — src/gateway/operator-run-recovery.ts:366-368
    With modelPolicy: { sourceAgent: "source" }, restore authority while that agent permits fixture/a and fixture/b, then remove fixture/b from the source agent's fallbacks before queued adoption. The role's modelPolicy object remains identical, and sourceRolePolicy excludes model policy, so reauthorize succeeds. Because this PR also freezes authority.modelPolicy, the new request can still use fixture/b. Base recovery dynamically intersected current model permissions. Prepare current policy and compare its resolved membership using the existing prepareOperatorModelPolicy/readOperatorModelPolicyMembership pattern from operator-run-authority.ts; cover both sourceAgent narrowing and widening.
    Confidence: 0.97
  • [P2] Update the remaining recovery consumers for the new contract — src/gateway/operator-run-recovery.ts:340-344
    Freezing assertPolicy changes consumers beyond the edited suites. Exact-head CI reports obsolete cancellation assertions in cron-stream-source-authority.test.ts:145/229, openclaw-id/scheduled-source.persistence.test.ts:388, isolated-agent/run.operator-source-child.test.ts:305, worker-environments/provider-create-recovery.test.ts:417, and operator-access-program.worker.test.ts:204. CLI prepare.scheduled-handoff.test.ts:147 also expects the former generic refusal instead of the new identity/source-policy refusal. Update these consumers to distinguish admitted completion from fresh-start refusal, retaining their explicit Stop and release checks rather than dropping coverage.
    Confidence: 0.99
  • [P2] Remove the contradictory occurrence-revocation promise — docs/automation/cron-jobs/payloads.md:152-154
    The updated page says definition edits apply to the next occurrence, but lines 181–185 still promise that withdrawing message capability or revoking caller authority stops pending reads from the active occurrence. The removed mutation notifier and captured guards no longer provide that behavior. Update this passage to identify which changes affect future work and which explicit cancellation actions stop the running occurrence, so operators do not rely on a permission edit to cancel it.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

Needs attention: Recovered model admission misses a current-policy restriction when allowed models change through sourceAgent.

Evidence

Security concerns:

  • [medium] A restricted operator can start work on a removed model — src/gateway/operator-run-recovery.ts:368
    The principal is the original recovered operator, the request is a later queued turn, and the protected effect is inference on a model removed from its source agent's allowed membership.
    Confidence: 0.97

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f7e2eed adds src/gateway/operator-run-recovery.ts:268 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f7e2eed98468; files: src/gateway/operator-run-recovery.ts)
  • Dallin Romney: Raw commit 961f5c0 adds src/gateway/operator-run-recovery.ts:173 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 961f5c0b7099; files: src/gateway/operator-run-recovery.ts)
  • Josh Lehman: Raw commit 59b8a11 adds src/gateway/operator-run-recovery.ts:190 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 59b8a114bf6d; files: src/gateway/operator-run-recovery.ts)

PR surface

Source -87, Tests +137, Docs 0. Total +50 across 18 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 57 144 -87
Tests 9 379 242 +137
Docs 1 12 12 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 448 398 +50

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:

  • add P2: The reported interruption requires an authority change during an active scheduled run and has limited blast radius.
  • add merge-risk: 🚨 security-boundary: Recovered queued work can start with a captured model permission that current sourceAgent policy no longer grants.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🐚 platinum hermit and patch quality is 🧂 unranked krab.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The reported interruption requires an authority change during an active scheduled run and has limited blast radius.
  • merge-risk: 🚨 security-boundary: Recovered queued work can start with a captured model permission that current sourceAgent policy no longer grants.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🐚 platinum hermit and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

Reviewed November 18, 2026, 1:54 PM ET / 18:54 UTC.

@obviyus
obviyus marked this pull request as draft November 18, 2026 18:57
- Let admitted Access, Template Add, OCID, stream and child work finish after policy revocation; refuse fresh starts.
- Preserve queued CLI refusals using their specific identity/source-policy diagnostics.
- Keep provider reply settlement in its admitted creation request and verify explicit cleanup remains available after revocation.
@obviyus
obviyus marked this pull request as ready for review November 18, 2026 19:46
@obviyus
obviyus merged commit ad550e9 into main Nov 18, 2026
204 of 215 checks passed
@obviyus
obviyus deleted the refactor/check-once-cron-occurrence branch November 18, 2026 20:06
steipete added a commit that referenced this pull request Nov 19, 2026
The Goal product test waited for role revocation to cancel an admitted
provider request, which #201377 correctly keeps alive under #197557.
Release that response, prove it persists while the next Goal turn is
refused, and separately verify Stop closes the provider and pauses the
Goal with its interruption note. Preserve disclosure and scope checks.

Production behavior is unchanged. Thanks @obviyus for #201377.

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

Problem: a running cron occurrence was aborted when its owner's role, device or membership changed (base: "Session event execution aborted"), because the restored operator authority subscribed to those changes and the occurrence re-checked its marker on every effect.

Fix: a cron occurrence checks its owner's authority once when it is restored and starts; the running occurrence keeps that authority until it ends. Each new occurrence, queued child and replayed follow-up re-checks once at its own start (`reauthorize`, the person's current authority, never socket liveness). Job removal, explicit Stop, cancellation and release still end the occurrence. Refusals keep their specific reason instead of a generic "abandoned"/sign-in message.

User impact: editing a job or the owner's role while an occurrence runs applies to the next occurrence instead of killing the current one; a revoked owner's next occurrence is refused with a clear reason.

Proof: real Gateway from source with a real model: owner demoted while the occurrence's exec sleeps aborts it on base and finishes it on head; the next occurrence is refused on both. Regression tests cover first-start reauthorization, closed-connection starts, Stop, revocation, refusal reasons and the rewritten in-flight expectations. Builds on openclaw#201334.

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

The Goal product test waited for role revocation to cancel an admitted
provider request, which openclaw#201377 correctly keeps alive under openclaw#197557.
Release that response, prove it persists while the next Goal turn is
refused, and separately verify Stop closes the provider and pauses the
Goal with its interruption note. Preserve disclosure and scope checks.

Production behavior is unchanged. Thanks @obviyus for openclaw#201377.

Co-authored-by: Ayaan Zaidi <[email protected]>
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Nov 19, 2026
…ducers (O4a)

🌊's O4 ruling (a) pins, carried to the pure candidate (stage 2) from
e88f3a9 (hop-2 -> hop-3 revocation through real Gateway wakes) and
9d8c242 (channel saved/live source and scheduled producers), both
verbatim except the producer precondition below.

Post-b894 upstream openclaw#201377 (ad550e9) changed the restored scheduled
source: its admission is fixed once started (assertCurrent no longer sees a
role change) and it now carries a reauthorize that re-checks the owner's
current policy. The scheduled cases therefore assert reauthorize is present;
the channel cases still assert it is absent, with assertCurrent live.

Negative control on this tree: removing the wake's
custody.operatorAuthority.reauthorize?.() call (5bd2723) turns the
scheduled "role changed" and "device revoked" wakes into dispatched turns
(expected failed) and reds the product file's revoked gate; the channel
cases stay green. So for restored scheduled sources the wake-time
reauthorize is now the load-bearing refusal, not assertCurrent.

Producers 9/9, product file 3/3, durable-7 and session-reset-cleanup green.

(cherry picked from commit e88f3a9)
(cherry picked from commit 9d8c242)
Refs openclaw#129388

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
Release adaptation: extract the independent mixed-requester repair and its queue regression. Stable already strips display/owner flags but copies requester origin and the private owner capability. The wider saved-requester cutover needs the newer fixed-request and Cron occurrence authorities and the durable queue owner; do not replace the stable custody or restart contract.

Companions: #203468 and #203521 are separate selected start-grant repairs. #201334, #201377, #200533 and #202318 are missing full-cutover prerequisites; #203516, #202522 and #202520 are later distinct lifetime refactors, not needed by the isolated mixed-requester repair.

(cherry picked from commit 3ad2cce)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit a26e1e7b02425b94d31c3e6bc6add8d417dc3fda)
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 merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL 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.

1 participant