Skip to content

refactor(gateway): keep operator authority fixed per request - #201334

Merged
obviyus merged 3 commits into
mainfrom
refactor/check-once-operator-role
Nov 18, 2026
Merged

obviyus merged 3 commits into
mainfrom
refactor/check-once-operator-role

Conversation

@obviyus

@obviyus obviyus commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A role edit during an admitted Gateway operator turn aborts the turn through operator-run-authority's policy subscription. The failed source assertion then retires its run claim and downstream runtime effects report agent runtime authority is no longer active (T01).

Rule

Check the original person's authority when a request starts, and keep its captured role, scopes and effective model ceiling until that request ends. Role, device, membership and policy changes govern the next request. Ordinary socket closure is not revocation. Explicit cancellation, release, exact run/turn/claim closure, independent source assertions, data fences and secret boundaries remain effective.

Queued work starts another request: reauthorize once at adoption against the original person's current authority, never socket liveness. Refuse a changed effective model-policy membership, narrowing or widening, rather than mutating the captured ceiling. This includes sourceAgent model changes even when the role's configured policy object is unchanged.

Change

  • Limit the policy cut to the Gateway operator authority owner: remove its post-admission role/profile/device/membership subscriptions and repeated policy/source-identity reads; preserve capture-time checks and supplied source/cancellation guards.
  • Capture role facts and prepared model policy once. The role-policy reader distinguishes an explicitly captured unrestricted policy from an absent snapshot.
  • Carry reauthorize through the existing admitted-authority contract and invoke it at canonical queued adoption. Permanent refusals retire only that input through the existing pending-input and abandonment owners; transient unavailability remains retryable.
  • A returned child result starts a new requester turn. Reauthorize at its Gateway admission after staging the input; a refusal uses the existing durable run-failure notice owner (withheld:), keeps the child's result in the cancelled input record, and never starts parent inference. Only host-bound private-completion or returned-delivery facts select this path.
  • Keep the runtime approval owner, run registry and runtime effect guard unchanged. Admit prepared sharing policy facts at accepted chat admission (or when carrying an already-admitted run), while retaining requester, physical-source and profile-identity fences.

Production: +232 / −148 (net +84) across eleven files. Deleting the implicit lifetime revocation checks requires explicit queued, returned-result and injected-input admission, plus a terminal refusal for the affected input. The live T01 failure also requires fixing prepared-sharing policy facts at admission while preserving their identity/source fences. Runtime effect, registry and approval validation are not changed.

Threat model

A captured grant never widens, switches person or adopts a replacement membership. A revoked identity cannot start another queued request. Finishing already-admitted work after a role/device/policy change is intentional. Caller-supplied assertions and abort signals remain opaque and enforced; this does not remove physical-session, credential, plugin lifecycle or exact claim fences.

Prepared-sharing admission freezes policy facts, not the physical store or person. Consumption still checks requester identity, source settlement and the identity-only profile selection; a merge cannot redirect the admitted authority.

Deferred: separate subsystem PRs

  1. Runtime effect guard: source-policy admission versus in-flight lifecycle settlement.
  2. Run registry: explicit source-policy/lifecycle assertion scopes.
  3. Runtime approvals: lifecycle-only delegated-authority validation, after the registry contract is settled.

No schema, stored-row, configuration or protocol change. Two-way door: reverting restores the former operator lifetime behavior; no persisted migration is involved. Blast radius is Gateway operator-derived turns and their queued starts, not all authority owners.

Tests

  • On this head, 148 tests across nine suites pass: prepared sharing, worker data/config fences, method authorization, native profile-merge steering, operator owners, and queued admission/lifecycle.
  • Queued sourceAgent regressions: refused after the source agent's model membership narrows or widens; both fail on the previous head.
  • ACP custody 3/3: a returned child result after device revocation does not start parent inference; one visible withheld: notice; the child's result stays in the cancelled input record.
  • Consumer coverage: direct importers of the changed owners and the 18 files that failed on the earlier broad branch (81 files run locally; CI runs the rest). Obsolete mid-request revocation expectations were rewritten to "finishes; next request refused".
  • Inherited, unchanged: the five subagent-spawn.production-boundary "consumed-*" Stop cases also fail locally on base c2ca162a9230 (and in CI on unrelated fix: avoid repeated model setup before fallback attempts #201216); the session-notify allowed-path case and native-facade explicit-empty-scopes case also fail on that base.
  • Test-line ratchet +390 / 400, no allocation. Tier full: ocx build --dts and the packed tarball installed into a clean prefix (CLI, doctor).

Evidence

This is a new cut initially tested against c2ca162a9230, then rebased onto main c4549b7f5596; the broader branch remains untouched. Live proof on 2cadbe5521e6 showed that the operator owner alone was insufficient: a profile-verification refusal aborted the turn before the resumed adapter's canonical runtime check. Prepared sharing still vetoed its captured policy revision. The repair now admits those policy facts explicitly, but keeps source and identity checks; the runtime guard and run registry retain their existing validators. The same real message handoff succeeds on a73eded68c45, and explicit Stop still refuses it.

Representative old-head failure Boundary implicated by its stack Narrow-cut treatment
OpenAI-compatible runs Operator authority membership/role assertions Keep admitted work; refuse another start
In-process requester continuation Retained operator device assertion and queue custody Keep admitted policy; preserve release/receiver closure
Method authorization Prepared session-sharing readSource contract Avoid eager source reads when preparing identity facts; retain physical-source checks on stale-policy consumption
Recursive subagent production boundary Child command/Stop custody after parent cleanup and a foreign Stop Keep registry, runtime guard and approval validation unchanged; retain the existing negative assertions
HTTP tool cancellation Operator membership assertion after HTTP settlement Keep admitted membership; preserve disconnect/abort and exact admission closure

Gateway disposal remains a resource fence: an unavailable captured resolver refuses effects, while replacing a context object alone does not revoke the request's admitted policy. Explicit Stop and child-command lifetime proof use the existing production-boundary tests unchanged.

Source-tier live-provider observations on frozen a73eded68c45, using real isolated Gateways (ocx src), a real model, synthetic operators, and task-owned adapters/latches; no substituted authority predicate or Gateway handler. All task processes, state, and disposable snapshots were removed. These are not full-build claims.

Real-Gateway flow Observed on a73eded68c45 Result
Real model → builtin message → real message.action; users.setRole(writer → denied) while channel handoff awaits message_action_entered, hasHandoff=true, hasPlatformDispatch=true; after role mutation: local_mailbox_delivered, receipt 3ed50fb6-a3a2-4a57-8791-849e95509b4b; tool settles success; agent.wait.status=ok, terminal reply S1_TURN_FINISHED; mailbox contains S1_LOCAL_DELIVERY. Next fresh request: FORBIDDEN: missing scope: operator.write. PASS: admitted handoff delivers and turn finishes after the role change; fresh admission refuses.
Same real message.action handoff, explicit chat.abort while awaiting chat.abort: ok=true, aborted=true; resumed handoff: TypeError: agent runtime authority is no longer active; tool settles error; agent.wait.status=error, stopReason=rpc; no mailbox artifact/delivery. PASS: explicit Stop still fences the effect.
Queued chat.send follow-up; lose write while first turn is busy First turn: state=final, S1_QUEUED_RUNNING_FINISHED. Queued run: one state=error, seq=1 event per observer, Your operator role changed; reconnect before continuing.; queuedToolStarted=false; no queued-tool start/retry observed before cleanup. Fresh send: FORBIDDEN: missing scope: operator.write. Gateway diagnostic: user transcript persistence failed: SessionMutationAuthorizationChangedError: Your operator role changed; reconnect before continuing. PARTIAL: first turn finishes and queued input is visibly refused, but the earlier transcript-persistence guard wins; no withheld: notice or queued-adoption refusal was observed.

CI consumer repair

  • Injection is new input: its admission now reauthorizes both the incumbent and incoming operator grants, without changing the running turn's captured authority or the existing different-profile negatives.
  • The failing reconnect assertion was committed-source invalidation, not the earlier profile-switch assertion. Production supplies that predicate in src/gateway/server/ws-connection/authenticated-request-dispatch.ts:289–315; src/gateway/server/ws-policy-close.ts:33–58,110–127 publishes committed invalidation. The socket's connectionSignal is a separate argument at dispatcher line 257. Reauthorization reads only classified committed-source authority; the raw transport fallback is never consulted. A socket-close-only control remains accepted.
  • In the continuation fixture, ordinary requester cleanup leaves a continuation hold. Already-started child work settles after device revocation; the transferred authority refuses the new parent turn. Its startTurn mock stops at dispatch, so real returned-turn refusal remains covered by the ACP custody regression. Gateway disposal still prevents dispatch and settles the flow.
  • The maintainer's canonical agents.entries.source fixture correction and reduced session-identity allowance are included unchanged.
  • Vitest-source: 67 tests pass across reply-tool authority, in-process continuation and queued authority. Session-identity ratchet passes; all 29 tsgo:core:test shards pass. Test-line ratchet: +400/400, no allocation credit.
  • CI repair committed as 90ae7f2c6621935930d8d948d215cc2b5af794e7. The admission check and existing lifecycle assertion share the existing inbound-authority module, keeping the caller-policy module within its line cap without weakening any guard.

- Capture operator policy once and reauthorize queued and returned-result starts.
- Preserve lifecycle and physical-source fences and publish refused returned inputs.
- Compare effective source-agent model membership at queued admission.
- Admit prepared chat/run profile policy facts without dropping identity or physical-source fences.
- Preserve the requester snapshot for admitted work and reject fresh restricted reads.
- Keep native merge refusals and explicit Gateway disposal coverage.
@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 gateway Gateway runtime agents Agent runtime and tooling size: XL labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 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: 90ae7f2c6621935930d8d948d215cc2b5af794e7
  • Maintainer: @obviyus
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/admitted-run-operator-authority.types.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/device-revocation.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/operator-role-policy.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/operator-run-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/agent.caller-authority.test-utils.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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. 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 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 freezes Gateway operator permissions during an admitted request and rechecks them when queued or returned-result work starts.

Example: A writer loses operator.write while an admitted message action awaits delivery.

  • Before: The turn can abort with “agent runtime authority is no longer active.”
  • After: The admitted delivery finishes, while a fresh request is forbidden.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful direction with real evidence for the central flow, blocked by a new-request authorization gap and incomplete consumer cutover.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
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 agent turn can unexpectedly fail when its operator's role changes during execution.
Reason: The maintainer-authored direction follows the repository's request-start authority rule and addresses demonstrated interrupted work.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: this maintainer-authored PR addresses interrupted turns, but one returned-result path misses reauthorization, and consumer tests and documentation still require updates.

Priority: P2
Reviewed head: a73eded68c456db39249d2a737f979f376f4decc

Before merge

  • Reauthorize one-way child results before starting requester inference (P1) - A one-way sessions_send result uses sourceTool=subagent_announce in sessions-send-tool.a2a.ts and defaults to runAgentStep, which sets neither privateCompletion nor a returnedResult receipt. With a supported in-memory source whose recovery snapshot is unavailable, captureGatewayOperatorContinuation reuses the inherited authority. After device revocation, assertCurrent now succeeds, this condition skips reauthorize, and the result can start another requester turn. Carry a host-held completion fact through this path and use the existing admission check; do not classify authority from contributor-controlled provenance strings. The exact-head continuation CI failure also shows this path no longer reports the former device refusal.
  • Update reconnect-steering tests for the request-start contract (P2) - Removing device-source checks from admitted assertCurrent changes this existing consumer test: aborting reconnectedRevocation now produces accepted rather than the expected tool_authority_mismatch. Exact-head CI reports the failure in three variants. Update the test to distinguish an already-admitted authority from a new steering/adoption start, retaining refusal coverage at the production admission boundary instead of relying on the removed lifetime check.
  • Document the new admitted-turn revocation behavior (P2) - The public queue guide still promises that revoked devices and removed role permissions stop subsequent actions by accepted children, and later says revoking access cancels an admitted collected turn. This PR intentionally allows those admitted turns to finish. Update those passages and the corresponding operator-scope guidance to distinguish future admissions from active work and explain explicit Stop, so administrators do not rely on revocation to cancel work that will continue.
  • Resolve security concern: Revoked source can initiate a requester continuation - The principal is the original operator of a one-way child request; the protected effect is a new requester inference after its device authority has been revoked.

Findings

  • [P1] Reauthorize one-way child results before starting requester inference — src/gateway/agent-turn/agent-turn-source-admission.ts:126-134
  • [P2] Update reconnect-steering tests for the request-start contract — src/auto-reply/reply/reply-tool-authority.test.ts:473-474
  • [P2] Document the new admitted-turn revocation behavior — docs/concepts/queue.md:68-71
  • [medium] Revoked source can initiate a requester continuation — src/gateway/agent-turn/agent-turn-source-admission.ts:126

Tests

  • Missing end-to-end proof: Supply redacted Gateway output exercising the new queued-adoption refusal itself, since the recorded role-loss case is intercepted by transcript persistence; returned-result refusal currently has test-only coverage.
Agent review details

How this fits together

Gateway admission converts authenticated caller identity and policy into authority carried through agent turns, queued inputs, child results, and runtime effects.

flowchart TD
 A[Authenticated operator] --> B[Gateway admission]
 B --> C[Captured authority]
 C --> D[Running turn]
 C --> E[Queued adoption]
 C --> F[Returned result admission]
 E --> G[Model and tool effects]
 F --> G
 D --> G
Loading

Technical review

Best possible solution:

Keep admitted permissions fixed, route every returned-result start through existing reauthorization, and align consumer tests and operator documentation.

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

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

Is this the best way to solve the issue?

The existing authority and adoption owners are appropriate, but returned-result classification must cover the one-way child path before removing its former lifetime check.

Full review comments:

  • [P1] Reauthorize one-way child results before starting requester inference — src/gateway/agent-turn/agent-turn-source-admission.ts:126-134
    A one-way sessions_send result uses sourceTool=subagent_announce in sessions-send-tool.a2a.ts and defaults to runAgentStep, which sets neither privateCompletion nor a returnedResult receipt. With a supported in-memory source whose recovery snapshot is unavailable, captureGatewayOperatorContinuation reuses the inherited authority. After device revocation, assertCurrent now succeeds, this condition skips reauthorize, and the result can start another requester turn. Carry a host-held completion fact through this path and use the existing admission check; do not classify authority from contributor-controlled provenance strings. The exact-head continuation CI failure also shows this path no longer reports the former device refusal.
    Confidence: 0.93
  • [P2] Update reconnect-steering tests for the request-start contract — src/auto-reply/reply/reply-tool-authority.test.ts:473-474
    Removing device-source checks from admitted assertCurrent changes this existing consumer test: aborting reconnectedRevocation now produces accepted rather than the expected tool_authority_mismatch. Exact-head CI reports the failure in three variants. Update the test to distinguish an already-admitted authority from a new steering/adoption start, retaining refusal coverage at the production admission boundary instead of relying on the removed lifetime check.
    Confidence: 0.98
  • [P2] Document the new admitted-turn revocation behavior — docs/concepts/queue.md:68-71
    The public queue guide still promises that revoked devices and removed role permissions stop subsequent actions by accepted children, and later says revoking access cancels an admitted collected turn. This PR intentionally allows those admitted turns to finish. Update those passages and the corresponding operator-scope guidance to distinguish future admissions from active work and explain explicit Stop, so administrators do not rely on revocation to cancel work that will continue.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

Needs attention: Returned-result admission has a reachable gap for revoked retained in-memory operator sources.

Evidence

Security concerns:

  • [medium] Revoked source can initiate a requester continuation — src/gateway/agent-turn/agent-turn-source-admission.ts:126
    The principal is the original operator of a one-way child request; the protected effect is a new requester inference after its device authority has been revoked.
    Confidence: 0.93

What I checked:

  • Pinned introduction and policy: Reviewed the complete merge-base-to-head diff and applicable root, agents, and Gateway instructions; the maintainer-notes directory is absent. (AGENTS.md:11, a73eded68c45)
  • Returned-result admission excludes one-way replies: The new reauthorization branch requires privateCompletion or a host-held returnedResult receipt; one-way sessions_send uses subagent_announce, and runAgentStep supplies neither marker. (src/gateway/agent-turn/agent-turn-source-admission.ts:126, a73eded68c45)
  • Supported live-source fallback: When recovery facts are unavailable, continuation capture reuses inherited live authority; that authority now tolerates device revocation until reauthorize is called. (src/gateway/operator-run-recovery.ts:603, a73eded68c45)
  • Exact-head CI failure traces: GitHub annotations identify the device-revoked sessions_send continuation failure and three reconnect-steering failures expecting rejection but receiving acceptance; test-type and session-identity checks also failed, but their available annotations do not establish a cause. (src/auto-reply/reply/reply-tool-authority.test.ts:474, a73eded68c45)
  • Supplied production proof: The full PR body records real isolated-Gateway model/message-action success after demotion and refusal after explicit Stop; its queued scenario explicitly stops at transcript persistence before the new adoption check. (a73eded68c45)
  • Documented revocation contract: The public queue guide still says revoked devices and removed role permissions stop subsequent accepted-child actions and cancel an admitted collected turn. Public docs: docs/concepts/queue.md. (docs/concepts/queue.md:69, a73eded68c45)

Likely related people:

  • Josh Lehman: Raw commit 07c8e14 adds src/gateway/operator-run-authority.ts:396 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 07c8e1411b79; files: src/gateway/operator-run-authority.ts)

PR surface

Source +52, Tests +398. Total +450 across 40 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 189 137 +52
Tests 32 588 190 +398
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 40 777 327 +450

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.

Root-cause cluster

Relationship: canonical
Canonical: #201334
Summary: This PR is the author's explicit replacement for the closed broader authority refactor.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: The original interruption requires a policy or authority change during an active Gateway turn.
  • add merge-risk: 🚨 security-boundary: A returned child result can start another requester turn under a revoked retained in-memory source.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦐 gold shrimp 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 original interruption requires a policy or authority change during an active Gateway turn.
  • merge-risk: 🚨 security-boundary: A returned child result can start another requester turn under a revoked retained in-memory source.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦐 gold shrimp and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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, 11:35 AM ET / 16:35 UTC.

@obviyus
obviyus marked this pull request as draft November 18, 2026 16:39
- Check incumbent and incoming grants against committed source policy at new-input admission.
- Keep socket liveness separate and preserve different-profile and grant-closure refusals.
- Correct continuation lifetime expectations and include canonical agent fixture and ratchet fixes.
@obviyus
obviyus marked this pull request as ready for review November 18, 2026 17:36
@obviyus
obviyus merged commit 04cb817 into main Nov 18, 2026
212 of 215 checks passed
@obviyus
obviyus deleted the refactor/check-once-operator-role branch November 18, 2026 17:57
obviyus added a commit that referenced this pull request Nov 18, 2026
)

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 #201334.

Co-authored-by: Ayaan Zaidi <[email protected]>
steipete added a commit that referenced this pull request Nov 18, 2026
Keep role changes scoped to the next request as established by #197557 and #201334. Prove admitted guest writes and checkpoint settlement, next-request refusal, and explicit source cancellation across late committed receipts. Credit @obviyus for the admission contract; production behavior is unchanged.
roboclaw-bot added a commit that referenced this pull request Nov 18, 2026
The old rejection expectation predates #201334. Assert that the admitted inventory completes with its captured role and that a fresh inventory applies the edited role without returning the other owner’s transcript. No production authority change.

Co-authored-by: vincentkoc <[email protected]>
steipete added a commit that referenced this pull request Nov 18, 2026
Apply the request-start authority contract from #197557 and @obviyus’s #201334. Remove the obsolete per-effect source check while preserving next-consult denial and explicit Stop. Follow #201473 for the stale in-process session-read expectation.
steipete added a commit that referenced this pull request Nov 19, 2026
Apply the request-start authority contract from #197557 and @obviyus’s #201334. Remove the obsolete per-effect source check while preserving next-consult denial and explicit Stop. Follow #201473 for the stale in-process session-read expectation.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…w#201334)

Problem: a role edit during an admitted Gateway operator turn aborted that turn. The operator authority subscribed to role, profile, device and membership changes and revoked the running request, so downstream effects failed with "agent runtime authority is no longer active" (25 logged on one host in four days).

Fix: operator authority is checked once when a request starts and stays fixed for that request (role, scopes, model ceiling, session-sharing policy facts). Role, device, membership and policy changes apply to the next request. Every new start re-checks once through `reauthorize`: queued input at adoption, a returned child result at admission, and input injected into a running turn; it checks the person's current authority and committed source, never socket liveness. A refused queued or returned input stops once with a visible notice. Explicit Stop, release, Gateway shutdown, profile-merge identity, credential and data fences are unchanged.

User impact: a turn that started finishes even if the operator's role changes meanwhile; the next request reflects the change. Work that starts later (queued, returned, injected) is refused if authority was revoked.

Proof: real Gateway from source: role change during a real message.action handoff fails with the logged error on base and delivers on head; explicit Stop still refuses; the next fresh request is refused. Regression tests cover queued, returned-result and injected starts, model-policy and sourceAgent changes, profile switches and socket-close-only reconnects.

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
…aw#201473)

Keep role changes scoped to the next request as established by openclaw#197557 and openclaw#201334. Prove admitted guest writes and checkpoint settlement, next-request refusal, and explicit source cancellation across late committed receipts. Credit @obviyus for the admission contract; production behavior is unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…aw#201527)

Apply the request-start authority contract from openclaw#197557 and @obviyus’s openclaw#201334. Remove the obsolete per-effect source check while preserving next-consult denial and explicit Stop. Follow openclaw#201473 for the stale in-process session-read expectation.
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Nov 19, 2026
…continue_work wakes

Upstream openclaw#201334 (04cb817) keeps operator authority fixed for the
request that admitted it: role, device, membership and policy changes no
longer revoke a running holder, and each later start (queued input at
adoption, a returned child result, injected input) re-checks once through
the authority's `reauthorize`. The fork's continue_work wake is such a
later start, but it only called `custody.assertCurrent()`, which no
longer sees a role change. After the absorb, a wake whose operator was
revoked (or whose email moved to another profile) ran a turn under the
retained authority instead of failing closed.

The wake now calls the retained authority's `reauthorize` once before it
runs. A refusal ends the work row "Retained operator authority revoked"
as before, and system (non-operator) work is unchanged. The request type
names the one member the wake uses (`Pick<AdmittedRunOperatorAuthority,
"reauthorize">`) instead of `unknown`.

Regression (real Gateway, real wake): server.continuation-finished-child-
wake.product "keeps a restricted operator's agent-RPC continue_work
custody through its wake": green at chain head fa212db (3/3), red at
8e63e3d (revoked: wake-prepared, one hop-two turn), green here; the
durable-7 operator-wake cases and sibling suites stay green (5 files,
36 tests).

Carried to the pure candidate (stage 2): the pure wake path is the same
code, and openclaw#201334 (04cb817) arrives with the 41bdde2 merge.
Reproduced on the merged head ddd0ec7: the "revoked" gate runs a turn
(hopTwoTurns 1, order run-ended + wake-prepared). With the fix, the product
file is 3/3.

(cherry picked from commit 429cb8b)
Refs openclaw#129388

Co-Authored-By: Claude Opus 5.5 <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
Problem: a role edit during an admitted Gateway operator turn aborted that turn. The operator authority subscribed to role, profile, device and membership changes and revoked the running request, so downstream effects failed with "agent runtime authority is no longer active" (25 logged on one host in four days).

Fix: operator authority is checked once when a request starts and stays fixed for that request (role, scopes, model ceiling, session-sharing policy facts). Role, device, membership and policy changes apply to the next request. Every new start re-checks once through `reauthorize`: queued input at adoption, a returned child result at admission, and input injected into a running turn; it checks the person's current authority and committed source, never socket liveness. A refused queued or returned input stops once with a visible notice. Explicit Stop, release, Gateway shutdown, profile-merge identity, credential and data fences are unchanged.

User impact: a turn that started finishes even if the operator's role changes meanwhile; the next request reflects the change. Work that starts later (queued, returned, injected) is refused if authority was revoked.

Proof: real Gateway from source: role change during a real message.action handoff fails with the logged error on base and delivers on head; explicit Stop still refuses; the next fresh request is refused. Regression tests cover queued, returned-result and injected starts, model-policy and sourceAgent changes, profile switches and socket-close-only reconnects.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 04cb817)

Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
Apply the request-start authority contract from #197557 and @obviyus’s #201334. Remove the obsolete per-effect source check while preserving next-consult denial and explicit Stop. Follow #201473 for the stale in-process session-read expectation.

(cherry picked from commit ac17452)

Co-authored-by: RomneyDa <[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 gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. security-sensitive-changed 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