Skip to content

feat(reef): add host-approved remote session prompts - #137300

Closed
jalehman wants to merge 28 commits into
mainfrom
pb-61a/federated-prompt-admission
Closed

jalehman wants to merge 28 commits into
mainfrom
pb-61a/federated-prompt-admission

Conversation

@jalehman

@jalehman jalehman commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Paired Reef Gateways can exchange guarded messages, but one Gateway cannot safely propose a prompt to a session owned by the other. There is no session-scoped mount, host approval, replay-safe admission, or immediate revocation path.

Why This Change Was Made

This adds a text-only prototype that keeps the host Gateway as the sole session and execution authority. Reef carries typed, encrypted federation frames, while existing OpenClaw plugin approvals and canonical agent admission decide whether one exact remote prompt runs. The host revalidates the mount generation, session incarnation, and exact peer signing and encryption keys after approval and at canonical input-admission commit boundaries.

User Impact

Operators with two paired Reef Gateways can:

  • Share one exact host session with /reef session share.
  • Propose text prompts from the guest Gateway.
  • Approve once, always allow for that mount, or deny.
  • Resolve approvals inline above the composer or through Inbox.
  • Revoke a mount immediately from the host Gateway.

This prototype does not mirror transcripts, stream output to the guest, or transfer attachments.

Latest experiment: plugin-gated native Reef Control UI

Commit f5c4349af9ebf58d33d103c66fc5284cfce461b1 adds an opt-in native Reef panel without widening the public protocol or plugin SDK. This is experimental remote delegation: a trusted guest proposes text to one explicitly shared host session, while the host remains the sole transcript, approval, admission, model-execution, and revocation authority. It is distinct from ordinary Reef messaging, whose existing guard/classification path remains unchanged.

The panel is hidden unless the Reef plugin is enabled and the connection has operator.admin. It covers setup/unavailable states, short-lived pairing codes and requests, trust removal, exact-session sharing, guest prompt proposals, proposal outcomes, pending revocation, and links to native approvals. Read status requires operator.read; every mutation requires operator.admin, strict bounded validation, and the canonical owner command path. The generic SDK/security-owner decision described below remains outstanding.

Tested candidate provenance

  • The complete dirty-tree candidate over published head 6ef84e685234984ba8cfdc887435c895e1c6577b was frozen as a 58,582-byte binary patch with SHA-256 9d8b106bb0bb13aaf299cb771852572b37a7f2ea170ba215dd631582bd55a240.
  • That exact patch was committed as f5c4349af9ebf58d33d103c66fc5284cfce461b1; no unrelated files were included.
  • GitHub then exposed one assertion-safety ratchet requirement. Follow-up commit a7c456b504a229a6f028f67a7aee9aea79c1b79b adds only the required // SAFETY: invariant comment. The ratchet and the 8 Control UI Gateway tests pass.
  • The complete published delta from 6ef84e685234984ba8cfdc887435c895e1c6577b through a7c456b504a229a6f028f67a7aee9aea79c1b79b has SHA-256 3fed548004ddbd381867c306cf1d7c9d8505fa327738efb0be2c63213dc3b50f.
  • Fresh normal actionable P0/P1/P2 autoreview was scoped-clean with no findings and confidence 0.91.
  • Reef validation passed: 12 native Control UI tests, 382 extension tests across 31 files, type-aware lint with zero findings, formatting, git diff --check, plugin SDK/package-boundary checks, and the full repository build.

Real runtime and browser proof

A two-Gateway loopback proof used OCM 0.2.33, distinct registered Reef identities, a real local Wrangler Reef relay, OpenClaw runtime, and openai/gpt-5-mini with mocks disabled.

  • Pairing and pinned trust survived Gateway restarts.
  • Host sharing produced a real guest mount; the guest submitted through the native panel.
  • Revocation while approval was pending denied admission with no run ID and no host-history mutation.
  • A later Allow once approval produced the real host response “The shared answer is 42.”
  • Same-session continuation retained both prior host context (Harbor) and guest-added context (42).
  • The configured browser flow covered trust, session sharing, guest proposal submission, the real approval card in the exact host session, accepted outcome, revocation reflected on both peers, friend-code generation, pairing-request submission, friend removal, and disabled-plugin gating.

Limits: the proof used local loopback rather than a public multi-machine relay; it is candidate restart/reopen proof rather than older-release upgrade/downgrade proof; the guest receives proposal outcomes rather than streamed/final host output; attachment transfer and transcript attribution remain out of scope. Current published head a7c456b504a229a6f028f67a7aee9aea79c1b79b has triggered fresh exact-head CI, which is not represented as passed here until GitHub completes it. The dependency graph change in extensions/reef/package.json / pnpm-lock.yaml also requires the repository’s documented current admin or @openclaw/openclaw-secops /allow-dependencies-change override.

Proposed SDK Boundary — Owner Decision Still Open

This PR proposes a generic, core-owned plugin runtime capability rather than Reef-only machinery. Explicit SDK/security-owner acceptance of that public durable authority surface is still outstanding; the rationale below is not an approval. Core owns session incarnation, approval scoping, plugin lifecycle, and canonical agent admission; Reef is the first consumer. Keeping the authority primitive at that owner boundary avoids duplicating security policy inside one channel plugin while preserving the strict trusted-official-plugin gate.

Changes

File Change
extensions/reef/protocol/federation.ts Defines bounded typed federation frames and prompt bindings
extensions/reef/protocol/pipeline.ts Opens federation traffic outside ordinary chat ingress
extensions/reef/src/federation-state.ts Persists mounts, generations, grants, and proposal outcomes
extensions/reef/src/federation-coordinator.ts Validates authority, requests approval, and admits host execution
extensions/reef/src/flow.ts Sends federation frames through Reef E2EE transport
extensions/reef/src/channel.ts Routes inbound frames and owner-visible outcomes
extensions/reef/src/commands.ts Adds share, list, prompt, and revoke commands
ui/src/components/exec-approval-card.test.ts Covers session-scoped approval presentation
src/plugin-sdk/runtime-store*.ts, src/plugins/loader-channel-runtime.ts Keeps active plugin runtime stores owned by their registry through discovery and setup
docs/channels/reef.md Documents the two-Gateway prototype workflow
extensions/reef/**/*.test.ts Proves protocol, state, admission, replay, revocation, and E2E flow

Evidence

Configured two-Gateway flow

Built and tested exact head ebc20b31daf42cb41caa1cbb504bdb37a51efc09. Two isolated Gateways, distinct registered Reef identities, real local Reef relay, encrypted transport, real host approval UI, and a recording loopback agent provider. No operator Gateway changes.

  • Guest proposal reached the inline approval card. Allow once admitted its text into the host session and delivered session.prompt.accepted to the guest. Agent-provider requests increased from 1 to 2.
  • Both candidate Gateways were stopped and reopened against their retained state. The accepted receipt survived; the retained mount admitted another freshly approved prompt. Host-local chat used that same host session.
  • Another proposal was left pending, its mount revoked, then approval attempted. The guest received session.prompt.denied; provider requests stayed 4 to 4, and the revoked marker was absent from the host transcript. Reopening both Gateways again retained the denial and absence.
  • This is candidate restart/reopen proof, not older-release upgrade/downgrade proof. The browser recording covers approval, reconnect, and host-visible input; the exact receipt/provider/absence assertions come from the running Gateway proof.
  • Guard boundary: federation frames intentionally bypass ordinary chat classification. Host approval/grants and exact peer/mount/session bindings authorize these prompts. A separate ordinary Reef message received matching outbound/inbound allow verdicts from the live OpenAI guard for the same encrypted envelope; federation recorded zero ordinary guard calls. The agent provider was a recording mock, not a live model.
  • An earlier attempt exposed signed-GET replay collisions when repeatedly polling remote friend lists; the final observer reads canonical local trust state without issuing those requests. The transport collision remains a named follow-up. A separate reopen attempt timed out before approval; its cause was not established. The final run used latest-response command assertions and passed the complete restart flow.

Host approval for a guest prompt

Host transcript after reopened admission and revocation

[email protected]

Latest review repairs: admission and local-key recovery

  • Late revocation: the plugin supplies a synchronous live-grant assertion through the existing canonical input-admission guard. Runtime options are snapshotted before asynchronous loading. Grant/peer revocation during preparation rejects before durable input acceptance; after acceptance, host-owned execution keeps its existing custody. No copied authority, weaker validator, or new store/schema.
  • Local-key rotation: a failed exact core binding now produces a durable denial even when the display mount still looks valid. Recovery no longer dereferences a missing authorized mount; the denied outcome survives reopen and replay.
  • Real Gateway regressions failed on the original producer for revocation before facade dispatch and before input staging, then passed repaired. Coordinator grant/peer regressions and the local-key rotation regression also failed pre-fix. The after-acceptance control remains accepted.
  • 134 tests / 7 files passed, covering canonical Gateway admission, registry/grant ownership, Reef coordinator/state/E2E. Naming-only lint cleanup was followed by 29 coordinator/state tests passing.
  • Complete changed-file check plan passed across the initial run and a serialized continuation from its lint failure (parameter reassignment/shadowing corrected). Core/plugin/test types, formatting, lint, SDK/storage/dependency guards and dead exports passed. The initially failed command itself is not reported as green.
  • Full OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build passed at the exact head. Fresh final P0/P1 autoreview was scoped-clean.
  • Latest repair delta: production +48/-44 (net +4), tests +330/-188, docs +10/-1. The small production growth adds the synchronous admission assertion contract; duplicated coordinator checks were absorbed.
  • Controlled late-admission race tests are distinct from the video's pending-approval revocation scenario.
node scripts/run-vitest.mjs src/gateway/server.agent-input-authority.test.ts src/gateway/server-plugins.test.ts src/plugins/registry-runtime.cross-session-grants.test.ts src/plugins/cross-session-grants.test.ts extensions/reef/src/federation-coordinator.test.ts extensions/reef/src/federation-state.test.ts extensions/reef/src/federation-e2e.test.ts
node scripts/check-changed.mjs
OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build

Rejected-mutation expiry repair

Current published head: 6ef84e685234984ba8cfdc887435c895e1c6577b. The preceding ebc20b31daf42cb41caa1cbb504bdb37a51efc09 passed full exact-head CI and is the built two-Gateway recording above. This follow-up changes only rejected core grant mutations and their regression tests; it has not been represented as a new two-Gateway recording.

  • ClawSweeper revision 9 confirmed the prior admission/recovery repairs and found that returning an existing grant from the atomic update callback renews its TTL. All four mutation operations now use the store's existing no-write sentinel on lifecycle, role, binding, and generation rejection. Successful host-authorized mutations are unchanged; no schema, API, config, or storage design change.
  • Original failure: all four store-operation regressions changed createdAt and expiresAt after rejection. The real Gateway regression accepted a prompt after the original standing grant's deadline because a rejected peer revocation had renewed it.
  • Repaired proof: actual SQLite metadata remains unchanged. Closing/reopening the candidate store retains the original deadline; authorization fails at that deadline. The real Gateway dispatch rejects the expired grant with zero pending inputs and no prepared execution. These are controlled-clock production-store/Gateway tests, not a seven-day live soak or a new relay recording.
  • 93 tests / 7 files / 4 shards passed, covering store expiry, grant ownership, canonical Gateway admission, and Reef coordinator/state siblings. A braces-only lint correction was followed by 9/9 Gateway tests passing.
  • Full changed-file plan passed across initial and resumed runs: all types, dead exports, formatting, lint, storage, runtime-loading, import-cycle, webhook and pairing guards. The initial run failed only on two missing test braces, which were corrected; no assertions or production behavior were weakened.
  • Fresh P0/P1 autoreview: scoped-clean, no actionable findings. Production delta +9/-8 (eight corrected returns plus one invariant comment); tests +98/-15.
node scripts/run-vitest.mjs src/plugins/cross-session-grants.test.ts src/plugins/registry-runtime.cross-session-grants.test.ts src/gateway/server.agent-input-authority.test.ts src/plugin-state/plugin-state-store.test.ts src/plugin-state/plugin-state-store.expiry.test.ts extensions/reef/src/federation-state.test.ts extensions/reef/src/federation-coordinator.test.ts
node scripts/check-changed.mjs -- src/plugins/cross-session-grants.ts src/plugins/cross-session-grants.test.ts src/gateway/server.agent-input-authority.test.ts

Automated checks

  • Focused Reef protocol/flow/coordinator/state/command/channel tests, core grant and lifecycle tests, and approval UI tests passed. The initial configuration-inspection regression was repaired and rerun successfully.
  • Registry ownership regression: SDK selection and all three loader setup/discovery cases fail on the original producer. The repaired runtime-store, loader, registry, and cross-session-grant suites pass 242 tests.
  • node scripts/run-vitest.mjs src/plugin-sdk/runtime-store.test.ts src/plugins/loader.runtime-store.test.ts src/plugins/loader.runtime-registry.test.ts src/plugins/loader.test.ts src/plugins/registry-runtime.cross-session-grants.test.ts
  • node scripts/check-changed.mjs -- <changed paths>: formatting, core/plugin and test typechecks, SDK/contract ratchets, lint, dead-code, storage, and import-cycle checks passed. Full PR checks passed before the runtime-owner follow-up; the follow-up's complete changed-surface checks also passed.
  • OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build: passed after the runtime-owner repair.
  • Fresh P0/P1 autoreview: scoped-clean for the rebased PR and the runtime-owner repair.
  • Existing capacity regression proves terminal failure before ACK, relay-failure retry, no agent request, and continued inbox processing; revocation retries remain idempotent.

Exact-head CI fixture repair

The first full CI run found six test-lane failures caused by fixtures retaining runtimes across registry replacement. The follow-up initializes iMessage, Matrix, Mattermost, and Zalo runtimes under the fixture registry and retires the shared test registry only after final fixture hooks. Voice Call terminal persistence/timer cleanup now completes before retirement. Production code and assertions are unchanged; test/support delta +38/-24.

  • Combined affected suites: 283 tests passed across six Vitest shards, including the original Voice Call cleanup regression and SDK runtime isolation.
  • Complete changed-file formatting, extension/root test typechecks, lint, dependency/SDK/storage guards, and dead-export scans passed.
  • Fresh P0/P1 autoreview: scoped-clean.
  • node scripts/run-vitest.mjs extensions/voice-call/src/manager.test-harness.test.ts extensions/voice-call/src/manager.notify.test.ts extensions/voice-call/src/manager.restore.test.ts extensions/zalo/src/channel.pre-aborted.integration.test.ts extensions/imessage/src/monitor.last-route.test.ts extensions/matrix/src/delivery-trace.test.ts extensions/matrix/src/matrix/sdk.test.ts extensions/mattermost/src/mattermost/interactions.test.ts src/plugin-sdk/runtime-store.test.ts
  • node scripts/check-changed.mjs -- <six changed test/support paths>

Remaining boundaries

  • Not a shared transcript/composer: guest receives proposal outcomes, not streamed or final host model output. No attachment transfer.
  • The host currently renders admitted guest text with its generic “You” label; approval identifies the guest. Transcript attribution is recorded as a separate follow-up, not claimed solved.
  • Older-release upgrade/downgrade compatibility has not been demonstrated; candidate reopen is covered above.
  • SDK/security-owner acceptance of the proposed generic grant capability is still open. No merge is requested by this evidence update.
  • Runtime-owner repair delta: production +74/-18 (net +56), tests +198/-1. Registry ownership is needed to distinguish active/discovery/setup lifecycles while preserving standalone CLI behavior; no authority fallback was added.

Manual test

Enable and register Reef on both Gateways, configure the guard provider credential, then pair their Reef identities. On the host: /reef session share @guest <host-session-key>. On the guest: /reef session list, then /reef session prompt <mount-id> <text>. Approve in the host session, verify that session receives the prompt and the guest receives acceptance. Leave another proposal pending, run /reef session revoke <mount-id> on the host, then try approving it: expect denial and no new host model run. A host-local message still works normally in the host session.


View the OpenClaw team session

Native Reef panel with trusted peer and session mounts

Real host approval for a guest Reef prompt

Guest Reef panel showing the accepted proposal outcome

Host Reef panel after mount revocation

@clawsweeper

clawsweeper Bot commented Sep 3, 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 app: web-ui App: web-ui channel: reef Channel integration: reef size: XL maintainer Maintainer-authored PR labels Sep 3, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 9, 2026, 3:39 PM ET / 19:39 UTC (Revision 11).

ClawSweeper review

What this changes

Adds host-approved remote text prompts between paired Reef Gateways, durable grants and outcomes, session commands, a native management panel, and registry-scoped plugin runtime lookup.

Merge readiness

⛔ Blocked before merge - 8 items remain

Keep open: this remains distinct, useful work, but the previously reported reset-authorization defect persists and the new panel can erase unsent drafts. The protected maintainer label also rules out automated closure.

Priority: P2
Reviewed head: a7c456b504a229a6f028f67a7aee9aea79c1b79b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Substantial implementation and runtime evidence remain useful, but an unresolved authority defect and draft loss prevent merge readiness.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the hash-matched body reports real relay, host approval, explicit revocation, and restart recovery with observed outcomes, which remain useful evidence. It does not demonstrate rejection of an old standing grant or pending proposal after an actual host-session reset and reopen, before input acceptance and transcript/provider I/O. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the hash-matched body reports real relay, host approval, explicit revocation, and restart recovery with observed outcomes, which remain useful evidence. It does not demonstrate rejection of an old standing grant or pending proposal after an actual host-session reset and reopen, before input acceptance and transcript/provider I/O. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 11 items Current main still lacks the requested workflow: At fetched main, Reef commands provide friendship and review operations without session sharing or prompting; the runtime type also lacks crossSessionGrants. No merged fixing PR was established.
Reset preserves the identifier used by grants: The reset owner preserves currentEntry.sessionId and assigns a new lifecycleRevision. Grant authorization compares the stored session ID, peer binding, and generation without checking that revision.
Final admission repeats an incomplete grant check: The coordinator supplies assertAdmissionCurrent, but that callback only reauthorizes the unchanged grant binding; expectedExistingSessionId also remains valid after reset.
Findings 2 actionable findings [P1] Invalidate remote grants when the host session resets
[P2] Preserve unsent form drafts across status refreshes
Security Needs attention Pre-reset remote authority remains usable: The host's reset changes lifecycle revision without changing the identifier retained by the grant, so a previously allowed peer can submit into the reset session without renewed authorization.

How this fits together

Reef transports encrypted messages between separately owned OpenClaw Gateways. This change lets a guest propose input to a shared host session, where host approval and Gateway admission control execution.

flowchart LR
  A[Guest prompt] --> B[Encrypted Reef transport]
  B --> C[Host mount and peer checks]
  C --> D[Host approval or standing grant]
  D --> E[Gateway input admission]
  E --> F[Host session execution]
  E --> G[Durable guest outcome]
Loading

Decision needed

Question Recommendation
Should the generic durable crossSessionGrants API and Reef's separate approval-based authorization path become supported contracts? Accept a bounded core-owned contract: SDK and security owners accept the documented boundary after reset invalidation and upgrade behavior are demonstrated.

Why: The body explicitly leaves acceptance open, and this choice establishes persistent authority and public plugin semantics beyond a mechanical repair.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the hash-matched body reports real relay, host approval, explicit revocation, and restart recovery with observed outcomes, which remain useful evidence. It does not demonstrate rejection of an old standing grant or pending proposal after an actual host-session reset and reopen, before input acceptance and transcript/provider I/O. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Invalidate remote grants when the host session resets (P1) - The previous blocker remains: session-reset-service.ts preserves sessionId and rotates lifecycleRevision, but this callback only checks the stored grant's peer, session ID, and generation. After a host reset, an old standing mount still passes both this assertion and expectedExistingSessionId, allowing fresh guest input without renewed authorization. Bind grants to the canonical session lifecycle and reject stale authority before input acceptance, including after reopen.
  • Preserve unsent form drafts across status refreshes (P2) - Every successful status refresh removes all forms and recreates empty prompt textareas. With multiple mounts, drafting a prompt for one and submitting another erases the unsent draft; host-driven update() has the same effect. Retain drafts by mount and preserve other edited form values across refreshes, clearing only the successfully submitted form.
  • Resolve security concern: Pre-reset remote authority remains usable - The host's reset changes lifecycle revision without changing the identifier retained by the grant, so a previously allowed peer can submit into the reset session without renewed authorization.
  • Resolve merge risk (P1) - Older-release upgrade compatibility for retained state and registry-scoped runtime lookup remains unproven; candidate reopen does not establish that existing installations remain usable.
  • Resolve merge risk (P1) - SDK/security-owner acceptance remains outstanding for durable cross-session authority and federation's intentional bypass of the ordinary Reef chat guard.
  • Complete next step (P2) - Resolve both findings, supply reset/reopen final-effect proof and older-release compatibility evidence, obtain SDK/security-owner acceptance, and secure current-head dependency authorization.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Invalidate remote grants when the host session resets — extensions/reef/src/federation-coordinator.ts:198-204
  • [P2] Preserve unsent form drafts across status refreshes — extensions/reef/browser/index.ts:106-109
  • [high] Pre-reset remote authority remains usable — extensions/reef/src/federation-coordinator.ts:198
Agent review details

Security

Needs attention: Persistent remote authority survives session reset; the inspected dependency delta adds only a local workspace development link.

PR surface

Source +3021, Tests +3604, Docs +81, Config +9, Other +3. Total +6718 across 61 files.

View PR surface stats
Area Files Added Removed Net
Source 28 3077 56 +3021
Tests 27 3811 207 +3604
Docs 3 111 30 +81
Config 1 10 1 +9
Generated 0 0 0 0
Other 2 4 1 +3
Total 61 7013 295 +6718

Review metrics

Metric Value Why it matters
Public runtime expansion 8 grant operations and 2 Gateway request options added These establish supported plugin authority and lifecycle contracts requiring explicit owner acceptance.
Production versus validation growth Production +3,004 net; tests and test support +3,604 net The body justifies production growth through federation, native controls, and registry isolation; validation growth is substantial but still misses reset invalidation.

Merge-risk options

Maintainer options:

  1. Repair lifecycle binding and validate the contract (recommended)
    Reject grants from before a session reset at final admission, then establish older-release compatibility and SDK/security acceptance.
  2. Pause the durable API expansion
    Retain this PR as an experiment until the public authority and persistence contract has an accepted owner decision.

Technical review

Best possible solution:

Keep execution host-owned, bind remote authorization to the canonical session lifecycle, preserve panel drafts, and publish only an owner-approved SDK contract with demonstrated upgrade compatibility.

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

Yes, from source: allow a mount, reset its host session, then submit through the old mount; the session ID and grant checks still match. Separately, refreshing the panel after drafting a prompt recreates an empty textarea. Neither path was executed during this review.

Is this the best way to solve the issue?

Partly: reusing core approval and admission owners is appropriate, but stable session IDs do not establish session incarnation, and rebuilding forms without retained draft state is unsafe.

Full review comments:

  • [P1] Invalidate remote grants when the host session resets — extensions/reef/src/federation-coordinator.ts:198-204
    The previous blocker remains: session-reset-service.ts preserves sessionId and rotates lifecycleRevision, but this callback only checks the stored grant's peer, session ID, and generation. After a host reset, an old standing mount still passes both this assertion and expectedExistingSessionId, allowing fresh guest input without renewed authorization. Bind grants to the canonical session lifecycle and reject stale authority before input acceptance, including after reopen.
    Confidence: 0.98
  • [P2] Preserve unsent form drafts across status refreshes — extensions/reef/browser/index.ts:106-109
    Every successful status refresh removes all forms and recreates empty prompt textareas. With multiple mounts, drafting a prompt for one and submitting another erases the unsent draft; host-driven update() has the same effect. Retain drafts by mount and preserve other edited form values across refreshes, clearing only the successfully submitted form.
    Confidence: 0.97

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

Labels

Label justifications:

  • P2: This is an optional collaboration prototype with concrete merge blockers, rather than an established urgent production outage.
  • merge-risk: 🚨 security-boundary: A standing remote grant can survive host-session reset because authorization does not bind the lifecycle revision.
  • merge-risk: 🚨 compatibility: The PR adds a durable public grant API and changes runtime-store lookup semantics without established older-release upgrade proof.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the hash-matched body reports real relay, host approval, explicit revocation, and restart recovery with observed outcomes, which remain useful evidence. It does not demonstrate rejection of an old standing grant or pending proposal after an actual host-session reset and reopen, before input acceptance and transcript/provider I/O. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [high] Pre-reset remote authority remains usable — extensions/reef/src/federation-coordinator.ts:198
    The host's reset changes lifecycle revision without changing the identifier retained by the grant, so a previously allowed peer can submit into the reset session without renewed authorization.
    Confidence: 0.98

What I checked:

  • Current main still lacks the requested workflow: At fetched main, Reef commands provide friendship and review operations without session sharing or prompting; the runtime type also lacks crossSessionGrants. No merged fixing PR was established. (extensions/reef/src/commands.ts:4, ac0a263eebf9)
  • Reset preserves the identifier used by grants: The reset owner preserves currentEntry.sessionId and assigns a new lifecycleRevision. Grant authorization compares the stored session ID, peer binding, and generation without checking that revision. (src/gateway/session-reset-service.ts:1660, a7c456b504a2)
  • Final admission repeats an incomplete grant check: The coordinator supplies assertAdmissionCurrent, but that callback only reauthorizes the unchanged grant binding; expectedExistingSessionId also remains valid after reset. (extensions/reef/src/federation-coordinator.ts:198, a7c456b504a2)
  • Prior finding remains applicable: Tree inspection found identical coordinator and grant-store blobs at the previous reviewed head and current head. The current Gateway test matrix covers plugin-grant revocation and expiry, while its reset cases exercise spawn authority instead. (src/gateway/server.agent-input-authority.test.ts:57, 6ef84e685234)
  • Panel refresh discards form state: Every successful render removes all controls and recreates empty prompt textareas. Successful actions and host-driven updates both invoke this render, without retaining drafts for other mounts. (extensions/reef/browser/index.ts:109, a7c456b504a2)
  • Complete captured body inspected: The live body matched captured SHA-256 898b6607bf9d5b7a7104a73edb7c2ecff28a970e8405b6a889bdb6dbca068af3, including omitted ranges. It reports real two-Gateway approval, pending-proposal revocation, restart recovery, and live-model continuation; it supplies no host-reset invalidation result and explicitly leaves older-release compatibility and SDK/security acceptance open. Downloaded media was unavailable in the supplied scratch location, so this assessment does not claim visual inspection. (a7c456b504a2)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Repair reset invalidation and provide production-boundary evidence that old grants and pending proposals fail before I/O after reset and reopen, while newly authorized mounts work.
  • Preserve unsent panel drafts across unrelated actions and status updates, with focused regression coverage.
  • Record SDK/security acceptance and older-release compatibility; redact private details from added proof and update the PR body to trigger re-review, or ask a maintainer to comment @clawsweeper re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-03T18:34:03.102Z sha 0e080ec :: needs real behavior proof before merge. :: [P1] Revalidate lifecycle before persisting a standing grant | [P1] Retry durable terminal outcomes while Reef remains live | [P1] Move remote-session authority out of the channel plugin | [P2] Match the documented approval label to the UI | [P2] Describe session-command authorization accurately
  • reviewed 2026-09-04T10:00:33.860Z sha d934fdf :: blocked before merge. :: none
  • reviewed 2026-09-04T13:02:45.299Z sha 41702ce :: needs real behavior proof before merge. :: [P1] Return a terminal outcome when the peer reaches proposal capacity
  • reviewed 2026-09-04T15:02:49.115Z sha 552467b :: needs real behavior proof before merge. :: [P1] Obtain SDK and security owner approval for the persistent grant API
  • reviewed 2026-09-09T06:41:03.762Z sha 9320408 :: needs real behavior proof before merge. :: [P1] Carry grant authority through canonical agent admission | [P2] Persist a denial whenever core rejects the mount
  • reviewed 2026-09-09T06:56:55.506Z sha 298cfe5 :: needs real behavior proof before merge. :: [P1] Carry grant authority through canonical agent admission | [P2] Persist a denial whenever core rejects the mount
  • reviewed 2026-09-09T07:50:41.803Z sha ebc20b3 :: needs real behavior proof before merge. :: [P1] Keep rejected grant mutations from renewing expiry
  • reviewed 2026-09-09T08:15:01.253Z sha 6ef84e6 :: needs real behavior proof before merge. :: [P1] Invalidate remote grants when the host session resets

@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Sep 3, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 4, 2026
@jalehman

jalehman commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The requested Core/SDK authority repairs are pushed at 41702ce1ebcab548ce6788c0443f19da8014d734.

Additional closeout evidence:

  • pnpm exec vitest run extensions/reef/src/federation-coordinator.test.ts extensions/reef/src/federation-e2e.test.ts — 18/18 passed
  • pnpm exec vitest run extensions/reef/src/transport.test.ts extensions/reef/src/federation-coordinator.test.ts extensions/reef/src/federation-e2e.test.ts extensions/reef/src/channel.test.ts — 45/45 passed before the final scope-only change
  • autoreview (--mode local, Codex gpt-5.5) — clean, no actionable findings
  • a configured two-Gateway/local-relay run exposed and fixed the missing operator.approvals scope before approval creation

I did not substitute a mock guard for the remaining configured authority proof: this environment has no Reef guard API credential available, so the full approved/revoked-before-agent-I/O run is blocked at that prerequisite.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 4, 2026
@jalehman
jalehman marked this pull request as ready for review September 9, 2026 06:31
@jalehman

jalehman commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 9320408d81789c4baaa8514e4f0f6d70d8103283: rebased, repaired registry-owned plugin runtime stores after configured live proof exposed discovery overwriting the active Gateway binding, and added host approval/revocation evidence plus an inspected recording to the PR body. Federation intentionally bypasses the ordinary chat guard; the body and docs now state that boundary explicitly. Generic cross-session grant SDK/security-owner acceptance remains an open decision. No merge requested.

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Sep 9, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/reef/package.json
  • pnpm-lock.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfiles or workspace dependency policy changes are present.
  • Treat pnpm-lock.yaml and package-lock.json diffs as dependency security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@openclaw-barnacle openclaw-barnacle Bot added channel: imessage Channel integration: imessage channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: zalo Channel integration: zalo labels Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph changes are blocked

OpenClaw does not accept dependency graph changes through PRs unless a repository admin or security explicitly authorizes the current head SHA. Dependency updates are generated internally by maintainers so external PRs cannot change the resolved graph.

Detected dependency graph changes:

  • pnpm-lock.yaml changed.
  • extensions/reef/package.json changed devDependencies.

Auto-scrub was not attempted because this PR changes package manifest dependency graph fields:

  • extensions/reef/package.json changed devDependencies.

Dependency graph changes must be reviewed by security or handled by maintainers internally. Please remove lockfile changes manually if they are not needed.

To remove lockfile changes, restore them from the target branch:

git fetch origin
git checkout 'origin/main' -- 'pnpm-lock.yaml'
git commit -m 'chore: remove dependency lockfile change'
git push

If this PR intentionally needs a dependency graph change, ask a repository admin or member of @openclaw/openclaw-secops to comment:

/allow-dependencies-change

The action will approve the current head SHA (a7c456b504a229a6f028f67a7aee9aea79c1b79b) when it reruns. A later push requires a fresh approval.

@jalehman

Copy link
Copy Markdown
Contributor Author

Closing as superseded (owner decision 2026-11-27, executed by the OpenClaw agent on the owner's behalf).

The branch went stale after 2026-09-18 — ~42,000 commits behind main with a DIRTY merge state, head a7c456b blocked by the dependency-graph guard, and the proposed generic cross-session grant capability never received the SDK/security-owner decision this PR was parked on.

Re-scope plan: re-file against current main as two smaller PRs — (1) the plugin-gated native Reef Control UI panel, and (2) host-approved remote session prompts (federation frames, coordinator, grants) once the grant-capability decision is made. All commits remain on pb-61a/federated-prompt-admission for cherry-pick.

@jalehman jalehman closed this Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui channel: imessage Channel integration: imessage channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: reef Channel integration: reef channel: zalo Channel integration: zalo dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR 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. P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant