Skip to content

feat(session-share): pull shared sessions over outbound WSS - #201075

Merged
vincentkoc merged 5 commits into
mainfrom
feat/session-share-outbound-reader-20261118
Nov 18, 2026
Merged

vincentkoc merged 5 commits into
mainfrom
feat/session-share-outbound-reader-20261118

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Receivers that cannot accept an inbound source-node connection need to read selected sessions through an outbound WSS connection.

User Impact

Configured Gateway sources appear beside paired nodes as read-only catalogs. Operators must preprovision a dedicated named non-primary identity and an explicit singleton publication-read token. Nothing enrolls automatically or falls back to broader credentials.

Why This Change Was Made

Builds on source-side device grants. URL, identity selector, SecretRefs and provider bindings are captured from one startup snapshot. Relevant changes retire the connection; unrelated reloads keep it usable. Replies from retired connections are discarded.

No steering or writer credential is included.

Evidence

The outbound candidate passed 39 tests across six files, two signed-WSS cases, production SDK declaration checks, 38 selected package compilations plus the negative boundary canary, and scoped type/lint/config checks. The explicit package-local check passed after the repository package checker refreshed its separate development declarations.

The stock ES2023 library check reports Promise.withResolvers in unchanged session-catalog.ts; the explicit package check uses Node 26/ES2024. Independent exact-slice review accepted publication.

The WSS fixture uses test-owned identities, pinned local TLS and synthetic Access-shaped headers. This is not live Cloudflare Access validation. No live enrollment, credentials, configuration or deployment changed.

No steering or reader write privilege is included. No live deployment was performed.

Exact revision and proof entry points
  • Reviewed head: c4658d819fe006ebc2051d3b012f6a4ba458d258
  • Reviewed base: a46ba4cfd4b5c84a544ad587e3ad0f0716403b2e
  • Tree: 93dcbb85f20c109606e7ec88a766e3bab95e7d0e
  • Delta: 11 files, +896/−46.

Focused runs used node scripts/run-vitest.mjs with isolated repository-suite configurations, maxWorkers: 1 and file parallelism disabled, selecting:

  • extensions/session-share/src/gateway-catalog.test.ts
  • extensions/session-share/src/node-commands.test.ts
  • test/plugins/session-share-gateway.integration.test.ts
  • test/plugins/session-share-filters.integration.test.ts
  • test/plugins/session-share.integration.test.ts
  • src/plugin-sdk/gateway-reader-identity.test.ts
  • Separately: test/plugins/session-share-publication.gateway.test.ts under the isolated Gateway suite.

SDK command: node --import ./scripts/tsx.mjs scripts/build-all.mts pluginSdkStrictSmoke.

Package command: node --import ./scripts/tsx.mjs scripts/check-extension-package-tsc-boundary.mts.

Stack order

3/4. Depends on the preceding PR (feat/session-share-device-source-20261118). Merge prerequisites before retargeting/revalidating this exact diff; do not merge this stack out of order.

Depends on #201074.

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

@vincentkoc
vincentkoc marked this pull request as ready for review November 18, 2026 07:46
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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 clawsweeper:intake:feature 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

Adds outbound WSS sources to the Session Share catalog using dedicated device identities, publication-read tokens, and optional Cloudflare Access credentials.

Example: A receiver behind a firewall connects to wss://team.example.com as gateway:team.

  • Before: Session Share requires the source node to connect to the receiver.
  • After: The receiver initiates the connection and lists or reads explicitly granted sessions.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful direction, but the adapter lacks real-behavior proof, existing-state upgrade evidence for plugins.entries.session-share.config.gateways, and resolution of the listed defects.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Receivers that cannot accept inbound source-node connections cannot use the existing sharing topology.
Reason: The maintainer-authored direction addresses a concrete network constraint through the existing optional plugin.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this maintainer-authored PR open: the outbound capability is useful and absent from main, but request-lifecycle behavior, recovery guidance, and a patch-caused CI failure need correction.

Priority: P2
Reviewed head: c4658d819fe006ebc2051d3b012f6a4ba458d258

Before merge

  • Apply configuration revocation when the next request starts (P2) - If a credential-provider configuration changes while session-share.read is awaiting its response, this second assertCurrent call invokes assertConfigured and rejects an otherwise successful read; list has the same post-response check. Root AGENTS.md explicitly permits an admitted request to finish and applies reload or revocation to the next request. The PR records no incident, likelihood, or accepted complexity exception for changing that contract. Keep configuration admission at request start and remove the mid-request configuration recheck and its corresponding test.
  • Report restart recovery for retired sources (P2) - Changing a source URL, identity selector, or referenced provider permanently sets retired in assertConfigured until the service restarts. This catch replaces the known restart instruction with “Refresh the catalog,” so following the displayed action can never recover the source. Preserve a safe distinction for configuration retirement and tell the operator to restart the receiver service; retain refresh guidance for transient connection failures.
  • Register the new long-lived GatewayClient call site (P2) - Adding this constructor without updating the existing GatewayClient call-site contract makes src/gateway/client-callsites.guard.test.ts fail: the CI annotation explicitly reports gateway-catalog.ts as the unexpected call site. Account for this service-owned connection in the existing guard with its lifetime justification so the required Node shard can pass.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Apply configuration revocation when the next request starts — extensions/session-share/src/gateway-catalog.ts:248-249
  • [P2] Report restart recovery for retired sources — extensions/session-share/src/gateway-catalog.ts:224-228
  • [P2] Register the new long-lived GatewayClient call site — extensions/session-share/src/gateway-catalog.ts:141

Tests

  • Low-value test extensions/session-share/src/gateway-catalog.test.ts: Remove the test requiring rejection when a credential provider changes during an already-started read; it pins the mid-request revocation behavior that conflicts with the repository's request-start policy.
  • Missing end-to-end proof: Provide redacted output from a running receiver configured with gateways.team that lists and reads a granted session through this adapter, including recovery after a relevant configuration change.
Agent review details

How this fits together

The plugin combines paired-node and outbound Gateway sources into the existing read-only session catalog; source-side grants select the sessions returned over signed Gateway RPC.

flowchart LR
  A[Catalog viewer] --> B[Session Share catalog]
  B --> C[Paired node adapter]
  B --> D[Outbound WSS adapter]
  D --> E[Source Gateway admission]
  E --> F[Device grants and session selection]
  F --> G[Read only session pages]
Loading

Technical review

Best possible solution:

Retain the existing catalog and credential owners, check configuration authority when requests start, preserve actionable recovery errors, and integrate the outbound client with the existing call-site guard.

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

Source inspection establishes the missing outbound path on main and the introduced failure cases; no target code was executed during this read-only review.

Is this the best way to solve the issue?

An outbound adapter behind the existing catalog is appropriate, but it should follow request-start authority semantics and expose recovery instructions that can resolve the reported condition.

Full review comments:

  • [P2] Apply configuration revocation when the next request starts — extensions/session-share/src/gateway-catalog.ts:248-249
    If a credential-provider configuration changes while session-share.read is awaiting its response, this second assertCurrent call invokes assertConfigured and rejects an otherwise successful read; list has the same post-response check. Root AGENTS.md explicitly permits an admitted request to finish and applies reload or revocation to the next request. The PR records no incident, likelihood, or accepted complexity exception for changing that contract. Keep configuration admission at request start and remove the mid-request configuration recheck and its corresponding test.
    Confidence: 0.98
  • [P2] Report restart recovery for retired sources — extensions/session-share/src/gateway-catalog.ts:224-228
    Changing a source URL, identity selector, or referenced provider permanently sets retired in assertConfigured until the service restarts. This catch replaces the known restart instruction with “Refresh the catalog,” so following the displayed action can never recover the source. Preserve a safe distinction for configuration retirement and tell the operator to restart the receiver service; retain refresh guidance for transient connection failures.
    Confidence: 0.99
  • [P2] Register the new long-lived GatewayClient call site — extensions/session-share/src/gateway-catalog.ts:141
    Adding this constructor without updating the existing GatewayClient call-site contract makes src/gateway/client-callsites.guard.test.ts fail: the CI annotation explicitly reports gateway-catalog.ts as the unexpected call site. Account for this service-owned connection in the existing guard with its lifetime justification so the required Node shard can pass.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 74e5127c0c3d.

Provenance checked

  • Paired-node catalog registration keeps the original intent (5278a8f: Expose explicitly selected native sessions through the existing read-only catalog while retaining source ownership.)
  • Source-publication configuration and documentation keeps the original intent (a46ba4c: Authorize exact reader devices and restrict publication by groups and canonical person independently of transport.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 5278a8f adds extensions/session-share/index.ts:10 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5278a8f2ed9e; files: extensions/session-share/index.ts)

PR surface

Source +335, Tests +449, Docs +66, Generated 0. Total +850 across 11 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 4 374 39 +335
Tests 3 450 1 +449
Docs 2 69 3 +66
Config 0 0 0 0
Generated 2 3 3 0
Other 0 0 0 0
Total 11 896 46 +850

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: This is an optional connectivity improvement with bounded lifecycle and recovery defects.
  • add merge-risk: 🚨 compatibility: The PR adds a public Plugin SDK export and persisted plugin configuration; maintainer authorship establishes direction, while existing-state compatibility still needs verification.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is an optional connectivity improvement with bounded lifecycle and recovery defects.
  • merge-risk: 🚨 compatibility: The PR adds a public Plugin SDK export and persisted plugin configuration; maintainer authorship establishes direction, while existing-state compatibility still needs verification.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • 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, 3:04 AM ET / 08:04 UTC.

@vincentkoc
vincentkoc force-pushed the feat/session-share-device-source-20261118 branch from a46ba4c to c7ecb5d Compare November 18, 2026 09:17
Base automatically changed from feat/session-share-device-source-20261118 to main November 18, 2026 09:36
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XL and removed size: L labels Nov 18, 2026
@vincentkoc
vincentkoc force-pushed the feat/session-share-outbound-reader-20261118 branch from c4658d8 to 5d59a9a Compare November 18, 2026 09:36
@vincentkoc
vincentkoc merged commit 06d62b4 into main Nov 18, 2026
114 checks passed
@vincentkoc
vincentkoc deleted the feat/session-share-outbound-reader-20261118 branch November 18, 2026 10:25
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…#201075)

* feat(session-share): pull shared sessions over outbound WSS

* fix(session-share): preserve admitted reads and expose restart recovery

* fix(session-share): retain actionable startup retirement errors

* fix(session-share): qualify socket turnover and preserve SDK exports

* test(session-share): preserve exports with partial SDK doubles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: file-transfer plugin: session-share rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L 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