Skip to content

fix: keep accepted automation runs revocable after turn completion - #188530

Open
roboclaw-bot wants to merge 3 commits into
mainfrom
roboclaw/team-r3-queued-run-authority
Open

roboclaw-bot wants to merge 3 commits into
mainfrom
roboclaw/team-r3-queued-run-authority

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #168568. Builds on #188513; does not claim the broader Matrix report is resolved.

What Problem This Solves

Fixes: an accepted immediate automation can still perform work after its requesting turn is explicitly canceled or its authenticated source is revoked.

User Impact

Owner/administrator requests retain main's after-turn execution behavior while remaining bound to the original live source and exact executable job. Cancellation, source/device revocation, and changed or ineligible jobs produce a visible terminal outcome. No configuration or storage migration is required.

The standalone proof covers authenticated Control UI administrator authority. Configured external-channel owner removal and literal owner metadata reassignment were not exercised; the public job-update API does not expose owner reassignment. The provider is deterministic local HTTP. Target command processes and provider HTTP I/O are real; isolated-agent, script and trigger consumers have focused tests and source review rather than standalone effect campaigns.

Why This Change Was Made

Main #188513 independently supplies the after-turn handoff. Caller admission still consumes its one-use management grant with the original exact-run and 60-second expiry checks. Once durable, the scheduler retains a separate source check for that one request and executable definition. Ordinary settlement differs from cancellation, and the existing execution owners recheck the retained source after asynchronous preparation and before effects.

The actual merge conflict was resolved against main bf2284a636c6ecd5b07f1de531a35f7fe93fbf23: ordinary caller-scoped manual work keeps main's handoff; event and on-exit custody keep their existing guards. The queue owns disable/delete eligibility and its specific terminal messages. Fresh review found the initial launch-only check insufficient; its source assertion now reaches the existing executor/admitted-run checks and completion delivery. No receipt schema, policy setting or credential flow changed.

Evidence

  • Pinned main base bf2284a636c6ecd5b07f1de531a35f7fe93fbf23, real Gateway/agent regression: 1 failed, 1 passed. The authenticated management cancellation case makes the fourth provider call and records ok instead of skipped; the caller-scoped control passes. The focused post-await source contract is 36 passed, 4 failed on that base.
  • Standalone base process proof: actual model-tool grant issuance and accepted cron.run receipt → successful actual chat.abort → queue opens → one unwanted child-process effect. Separate base preparation proof: accepted receipt → normal caller settlement → public cron started while the real target session remains busy → actual device-token revocation → target release → one unwanted provider HTTP request, ok history. Both fail their zero-effect assertions; these are product failures, not setup failures.
  • Source-verified production commit a9473dd6d46ee7f2df8c33c607c9d1831692a6db: 2 Gateway E2E rows pass; 14/14 real-effect cases pass; all four container exits are 0. Settlement/disconnect produce exactly one intended child effect; actual chat.abort, device/origin revocation, disable/delete and agent retarget produce zero. The forbidden command request is refused before receipt/history/effect. After public cron start and a genuinely blocked target session, settlement/disconnect produce one target provider HTTP request; actual abort/device/origin revocation produce zero and terminal error history. Independent audit matched every receipt/history ID, effect artifact and trace ordering. The published head differs only in the occurrence test consolidation; all 20 production files and the unchanged E2E input are byte-identical, so this effect proof is reused with its original head identity.
  • 292 focused contract/consumer checks pass on the repair, including the unchanged post-reservation zero-main-thread-SQL contract, caller scoping, prefix stability, script admission, command timeouts, plugin schedules and webhook delivery. Targeted production/test typechecks, type-aware lint, formatting and git diff --check pass. pr-simplify removes the guard alias and duplicate eligibility checks and shares repeated acknowledgement fixtures: 88 added / 90 deleted test lines (net −2); production +172/−45 (net +127) against the pinned main base. No test allocation or baseline exception was added.
  • Fresh installed autoreview: scoped-clean, no actionable P0–P2 findings after repairing its preparation-source finding and correcting the test consolidation. The final matrix retains all 32 healthy rows, all 32 paused rows, occurrence identity/release assertions and aggregate executor reachability. childParent destructuring removes repeated lookups to satisfy the existing file-line limit; typecheck, lint and affected consumers pass.
  • Exact published head fb8514aba1678f3df007bb047730b0c19138605d: CI run 41114327223, attempt 1, completed failed. The only failed test job, 124265221440, has three cron fallback failures: the stored-session explicit/own-model fallback cases (line 160) and timeout fallback transcript (line 137). All three match the exact path, line, title and complete failure message in scheduled main job 124239591861, main head 9e8a058de8afcdaf03f5774979e7d2e494b80a1c, where the executor is unchanged by this PR. The aggregate gate also failed; every other job succeeded or was skipped. A focused Node replay passes those three cases, but CI uses Bun and remains red; no repair or CI success is claimed. The tested merge is 281da785c79c743d1f358245f4e2a4073c76c05e (base c0c068e1ecd9ec78a75ad6847e032f4d0f5b1241). This PR remains ready for lead inspection; no merge or auto-merge has been requested.
  • Earlier exact-head CI 41091825411 at 0ee9c5794264d050ff4c0635f91f0b9cd22cebc7 remains failed: two Bun chat.history pagination assertions and the aggregate gate. Both exact signatures also occur in scheduled main job 124149135009. This attributes that old head only; it does not turn red CI green.
  • An earlier focused Doctor prompt-update test produced an ownership refusal. Exact-order original-base/candidate replays and the current focused suite passed; the original refusal remains unattributed and no Doctor repair is claimed.
  • Crabbox capacity was queued and the owned allocation stopped. Proof used authorized rootless Podman with an exclusive loop lock, four CPUs, 8 GiB, task-owned state and no network. Base setup failures were investigated and retained; the supported private dependency projection and integrity-verified public archive cache allowed the actual baseline to run. No production Gateway/job/state was changed.

Requested by @steipete.

Work sessions

Transfer durably accepted management requests to scheduler custody while retaining live source, cancellation, policy and job checks.

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

clawsweeper Bot commented Oct 30, 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 Oct 30, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 30, 2026 16:39
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: fb8514aba1678f3df007bb047730b0c19138605d
  • Maintainer: @roboclaw-bot
  • Repository role: maintain

These security sensitive changes were made:

  • 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.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 0ee9c5794264d050ff4c0635f91f0b9cd22cebc7, but the PR head is now fb8514aba1678f3df007bb047730b0c19138605d. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-10-30T16:59:28.437Z sha 0ee9c57 :: needs real behavior proof before merge. :: none

Integrate the actual main conflict while preserving ordinary caller-scoped after-turn execution. Transfer one accepted request's source guard through the scheduler and the existing executor admission checks, including checks after asynchronous preparation.

Co-authored-by: steipete <[email protected]>
Combine the duplicate healthy matrix executions while retaining every row's occurrence identity and release checks plus aggregate executor reachability. Keep the four awaited-source refusal regressions and the existing paused matrix.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot roboclaw-bot changed the title fix: immediate automation runs are skipped after the owner turn ends fix: keep accepted automation runs revocable after turn completion Oct 30, 2026
@clawsweeper clawsweeper Bot 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. labels Nov 2, 2026
@clawsweeper clawsweeper Bot removed merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 2, 2026

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 docs Improvements or additions to documentation gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. security-sensitive-changed size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant