Skip to content

fix: stop retained sends after device revocation - #200353

Merged
RomneyDa merged 2 commits into
mainfrom
fix/retained-device-revocation
Nov 17, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
fix/retained-device-revocation

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes retained in-process sends continuing after their originating device is revoked when the continuation is reconstructed from tokenless saved facts. Found while qualifying the release after #200313.

User Impact

Revoked work is refused and reports the refusal instead of delivering. Allowed work still finishes after its accepting request ends. No configuration or stored-credential changes.

Why This Change Was Made

Preserve the existing device revocation owner across authority wrappers and subscribe detached continuations to that owner. Do not inherit the accepting request/turn lifetime or add a device credential to tokenless recovery snapshots. The product fixture also keeps loopback mock traffic out of inherited HTTP proxies without changing external proxy routing.

Evidence

  • New regression fails on the unmodified release source at the post-revocation assertion, then passes with the fix.
  • Full operator-run recovery suite: 39/39 passes, including accepting-request completion and tokenless recovery cases.
  • Real Gateway retained-send product test passes both allowed and revoked cases: allowed has one delivery; revoked has zero deliveries and one refusal notice.
  • Canonical type-aware lint passes on the three runtime/regression files; formatting and diff checks pass.
  • Exact pushed main-context head a689b8f: all 40 recovery tests and the real Gateway allowed/revoked product test pass (two shards, exit 0); canonical type-aware lint passes on all four changed files.
  • Head 13f53fd changes only the refusal text to “Gateway device authorization was revoked.” The current session-identity ratchet and formatting pass; the earlier full product proofs remain applicable to the unchanged behavior. The prior generic “no longer active” text triggered the ratchet in run 44001214982, job 133766215772; this PR-caused failure was repaired, not bypassed.
  • Independent review waived by the release owner; focused self-review preserves the existing revocation owner and avoids persisted authority or parent-lifetime changes.

Preserve the existing device revocation owner across detached authority reconstruction without inheriting accepting-turn lifetime or persisting an incidental token.

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

clawsweeper Bot commented Nov 17, 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 size: S labels Nov 17, 2026
@RomneyDa
RomneyDa marked this pull request as ready for review November 17, 2026 02:12
@github-actions

github-actions Bot commented Nov 17, 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: 13f53fd890abdb261a59b9a2eb54c6889d4f8d90
  • Maintainer: @RomneyDa
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/operator-run-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@RomneyDa
RomneyDa enabled auto-merge (squash) November 17, 2026 02:18
@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. labels Nov 17, 2026
@RomneyDa
RomneyDa disabled auto-merge November 17, 2026 02:24
Use the actual revocation cause rather than a generic lifecycle refusal. Authority behavior is unchanged; current session-identity ratchet and format checks pass.

Co-authored-by: RomneyDa <[email protected]>
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves device revocation when retained sends reconstruct their authority from tokenless saved facts.

Example: Bob's tokenless device starts a retained send, its accepting request ends, and an administrator revokes the device before replay admission.

  • Before: The reconstructed continuation can deliver despite the device revocation.
  • After: The continuation refuses delivery; an otherwise identical allowed send still completes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with useful regression coverage; confidence remains bounded by reported harness results and pending CI.
Proof confidence 🦐 gold shrimp (3/6) This MEMBER-authored PR is outside the repository contributor-proof gate; supplied evidence reports a real Gateway harness with allowed delivery and revoked refusal, but contains no independently inspectable live runtime artifact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Revoking a tokenless device can leave its retained send authorized to deliver later.
Reason: This restores an existing authorization contract through a narrow maintainer-approved repair.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs a concrete device-revocation gap still present on current main; no actionable introduced defect was found.

Priority: P2
Reviewed head: 13f53fd890abdb261a59b9a2eb54c6889d4f8d90

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied runtime artifact demonstrates the tokenless retained-send scenario with a real agent and model outside the product-test harness.
Agent review details

How this fits together

Gateway admission captures the authenticated operator's authority, and detached work reconstructs it from saved facts before later execution; the device-revocation owner supplies the live revocation signal.

flowchart LR
  A[Authenticated device] --> B[Operator authority]
  B --> C[Saved facts]
  C --> D[Detached continuation]
  E[Device revocation owner] --> B
  E --> D
  D --> F[Replay admission]
  F --> G[Delivery or refusal]
Loading

Technical review

Best possible solution:

Carry the existing device-revocation owner through authority wrappers and detached continuations while keeping tokenless snapshots credential-free.

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

Current-main source exposes the missing original-device subscription, and the PR supplies a focused red/green regression report; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch uses the existing revocation owner and shared continuation boundary, preserves scope narrowing and request independence, and adds one distinct regression without new persistent state.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Detached continuation authority keeps the original intent (f4fa17a: Use saved authorization facts so accepted work survives parent edits and request completion while current policy and revocation still apply.)
  • Operator authority wrappers and recovery keeps the original intent (961f5c0: Preserve authenticated authority during recovery without granting broader scopes or retaining reusable credentials.)
  • Shared product-test child fixture keeps the original intent (ed40c47: Share isolated product-test process setup and cleanup while retaining the real continuation and revocation scenarios.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Dallin Romney: Raw commit 961f5c0 adds src/gateway/operator-run-recovery.ts:163 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)
  • Ayaan Zaidi: Raw commit f4fa17a adds src/gateway/operator-run-recovery.ts:593 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f4fa17a710be; files: src/gateway/operator-run-recovery.ts)
  • Shakker: Raw commit 715077a adds src/gateway/operator-run-authority.ts:41 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 715077a3befb; files: src/gateway/operator-run-authority.ts)

PR surface

Source +17, Tests +40. Total +57 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 17 0 +17
Tests 2 40 0 +40
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 57 0 +57

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: A concrete authorization defect affects retained sends from tokenless devices, with limited demonstrated scope and no reported active exploitation.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A concrete authorization defect affects retained sends from tokenless devices, with limited demonstrated scope and no reported active exploitation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 16, 2026, 9:42 PM ET / November 17, 2026, 02:42 UTC.

@RomneyDa
RomneyDa merged commit f57dbb4 into main Nov 17, 2026
140 checks passed
@RomneyDa
RomneyDa deleted the fix/retained-device-revocation branch November 17, 2026 02:55
@RomneyDa

Copy link
Copy Markdown
Member Author

Merged via squash.

RomneyDa added a commit that referenced this pull request Nov 17, 2026
Backport main f57dbb4. Preserve the release line session-identity implementation while retaining device-revocation custody across detached recovery. Release recovery 39/39 and real Gateway allowed/revoked proof retained; main exact-head CI passed before merge.

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
* fix: stop retained sends after device revocation

Preserve the existing device revocation owner across detached authority reconstruction without inheriting accepting-turn lifetime or persisting an incidental token.

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

* fix: name device revocation in continuation refusal

Use the actual revocation cause rather than a generic lifecycle refusal. Authority behavior is unchanged; current session-identity ratchet and format checks pass.

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

---------

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: S 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