Skip to content

feat(session-share): filter shared groups by person - #182286

Merged
vincentkoc merged 19 commits into
mainfrom
feat/session-share-person-selection-20261024
Oct 27, 2026
Merged

vincentkoc merged 19 commits into
mainfrom
feat/session-share-person-selection-20261024

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Operators need to share selected session groups with teammates while limiting them to sessions owned by or including one person.

User Impact

share.groups remains mandatory. Optional share.involvingProfileId narrows those groups to an exact source-local canonical human owner or direct profile participant, including merged aliases. Mentions, display names, remote attribution, and personal hide/show choices do not qualify. Missing or malformed selections publish nothing; omitting the selector preserves group-only sharing.

Restart the source node host after changing plugin configuration. Existing exclusions and receiver access checks remain in force.

Implementation

The source uses one scoped SDK reader for discovery, final selection, and synchronous publication. Fresh profile identity and aliases are prepared through the shared-state worker while the selected session read remains admitted. After the last asynchronous step, final native session reads and synchronous configuration, identity, and local-authority checks guard publication.

This removes the extra host-thread profile query identified in the previous review without weakening the final session guard. Profile data is a fresh as-of snapshot, not a promise to observe a foreign profile commit after that snapshot or an atomic snapshot across separate databases. Group-only sharing avoids participant hydration.

This is the person-selection slice extracted from #156736, following #182242. Vincent Koc's original implementation remains preserved there; Open original remains a separate slice.

Evidence

Exact reviewed and published source: f7e4f14ee53fb17d2043a3fd1d70999ca832211e, tree 24ce272b098108253c3ee11b3d62bc4106b8c659.

  • Exact-head PR CI and its enforced openclaw/ci-gate: passed.
  • Fresh full-branch source review: no actionable P0–P2 findings. Independent composition and fixture reviews accepted the signed source.
  • Canonical config generation/check passed; all four rendered hashes and counts 2565/3977/4888 verified.
  • Real paired receiver test: passed at this head in 109.485s, wrapper exit 0. Node 26.12.1 launcher with repository-managed Bun 1.4.4 workers.
  • Package Acceptance: passed on this exact workflow and package source. Normal public package build, integrity checks, and the real [email protected] / session-share upgrade lane all passed. Download the small scenario proof artifact.

Person-filtered receiver effects

The separately started receiver Gateway uses the production source dispatcher in the test process. Exact synthetic output from the final-head run:

{"listed":["agent:main:participant","agent:main:owner"],"delivered":[[{"type":"userMessage","text":"Allowed owner transcript"}],[{"type":"userMessage","text":"participant"}]],"rejected":["group-only","mention","unrelated","other-group"]}
{"revoked":"group","receiver":"rejected","nodeResults":[false],"heldTranscriptInNodeResult":false}
{"revoked":"owner","receiver":"rejected","nodeResults":[false],"heldTranscriptInNodeResult":false}

Allowed owner/direct-participant transcripts reach the receiver. Group-only, mention-only, unrelated, and other-group sessions do not. In-flight group revocation and owner reassignment reject the receiver read and keep held transcript bytes out of node.invoke.result. This test does not claim a separate source-node CLI startup; the upgrade scenario below exercises that path.

Shipped group-only upgrade

The hosted workflow built and admitted package SHA-256 e42bb16e676d388a76d40d8542b0b5e40c31eefb60496863989548766ee5aeb7 from this exact head. Installed candidate identity independently records commit f7e4f14ee53fb17d2043a3fd1d70999ca832211e, manifest SHA-256 7a530f11d0e3576984097f07466db07bebe706e9285c9bfdd6a8a041b93f52b4.

The real published baseline [email protected] was configured with group-only sharing and seeded with Team and Private sessions. Native update succeeded, then immediate inspection preserved configuration, both session identities/categories, and both transcripts. No standalone Doctor or candidate Gateway ran between update and inspection; the updater's own required migration/check phases remained enabled.

Recorded first-hop result:

{"stage":"first-hop","baseline":{"version":"2026.10.7","commit":"157d8c2bc3ea2fa183afdc11088e69690bf8e64e","manifestSha256":"362f8c0fda7b71a116e0ca2f812e896bfe9cfec41e64b6b66243f95703aaf7b8"},"candidate":{"version":"2026.10.7","commit":"f7e4f14ee53fb17d2043a3fd1d70999ca832211e","manifestSha256":"7a530f11d0e3576984097f07466db07bebe706e9285c9bfdd6a8a041b93f52b4"},"share":{"groups":["Team"]},"sessions":[{"key":"agent:main:upgrade-shared","category":"Team","text":"Preserved Team transcript","sessionId":"ab7e7070-ab82-4ade-bcdd-dd9d8bb5fbff","transcriptPreserved":true},{"key":"agent:main:upgrade-private","category":"Private","text":"Excluded private transcript","sessionId":"cce0fc1c-7de8-4d24-bb3b-d593c2e2d102","transcriptPreserved":true}],"beforeStandaloneDoctor":true}

The phase chain records native update success at 10:41:59.801 UTC, first-hop inspection success at 10:42:04.328, and candidate Gateway startup beginning at 10:42:04.358. The real source-node CLI then paired with the candidate Gateway; recorded receiver result:

{"listed":["agent:main:upgrade-shared"],"delivered":[{"type":"agentMessage","text":"Preserved Team transcript"}],"excluded":"agent:main:upgrade-private"}

The scenario and outer Docker summaries both passed: attempt 1, exit 0, 694 seconds, no timeout, cleanup joined. The hosted job and entire workflow also completed successfully. The scenario-specific first-hop JSON above supplies the preservation evidence; the generic firstHopPostCore diagnostic in the summary is unavailable and is not used as proof.

Validation notes

The fresh receiver fixture uses the existing initializeCurrentRuntimeState owner. This corrects an earlier fixture-bootstrap timeout without changing the original 180-second timeout, disclosure assertions, production code, or released-upgrade fixture. The repaired final-head run passed. Canonical generation and this one E2E file used the documented local fallback after the owned remote allocation queued and was stopped; normal packaging and the released upgrade ran in hosted CI.

Historical evidence remains separate: the earlier 08014ce upgrade scenario passed but its outer Testbox wrapper failed during collection; it is not counted as this head's gate. Earlier declaration, SDK-initialization, and fixture-bootstrap failures are superseded by the successful exact-head runs above. Original 0764086 Canvas and replaced-file compatibility runs remain historical sibling coverage. An unrelated private-QA declaration-size failure and OpenShell fixture failure are not claimed fixed here.

The composition preserves the 39 product paths against frozen baseline aaa0f434e956cb25684d107a1815535fd6d683f0; generated artifacts were regenerated canonically. One optional config field is added; no existing key is removed. This product delta changes no database schema or protocol version. Production: +384/-119; tests/helpers: +1855/-75; docs/generated: +67/-16. Production growth supplies optional person selection and the scoped read/disclosure owner.

Settings surface

Before — selected groups:

Before: Session Share publishes selected groups

After — optional person filter within those groups:

After: Session Share adds the optional Involving Person field

Screenshots use synthetic Gateway data with the schema publisher and settings renderer; execution proof is recorded above.

@vincentkoc vincentkoc self-assigned this Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime plugin: file-transfer plugin: session-share size: XL labels Oct 24, 2026
Baseline-Refresh: a63e9bac1fc70712a3ab22ead75a0faf909244ea
@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 24, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 24, 2026 06:11
@vincentkoc
vincentkoc enabled auto-merge (squash) October 24, 2026 06:17
@vincentkoc
vincentkoc disabled auto-merge October 24, 2026 06:27
@vincentkoc
vincentkoc marked this pull request as draft October 24, 2026 06:28
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds an optional person filter that narrows explicitly shared session groups to canonical owners or direct profile participants.

Example: Share the Team group while selecting the person owning agent:main:owner.

  • Before: All eligible Team sessions are published.
  • After: Only Team sessions owned by or directly involving the selected person are published; mention-only sessions remain excluded.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Useful, focused capability with production-boundary disclosure evidence, released-upgrade preservation, green exact-head gates, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded exact-head output exercises person selection through a real receiver Gateway and production source dispatch, including allowed delivery, excluded sessions, and group/owner revocation before node results; separate packaged CLI upgrade evidence covers source startup and preserved group-only sharing.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Operators cannot limit selected shared groups to sessions owned by or directly involving one person.
Reason: The maintainer-authored direction adds a useful publication restriction while preserving mandatory groups, existing exclusions, and receiver access checks.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it provides a useful, maintainer-approved capability absent from current main, with no actionable findings at the reviewed head.

Priority: P2
Reviewed head: f7e4f14ee53fb17d2043a3fd1d70999ca832211e

Before merge

None.

Findings

None.

Agent review details

How this fits together

The source Session Share plugin reads local session and profile state, applies publication filters, and sends read-only catalog metadata and transcripts through a paired node to the receiver Gateway.

flowchart LR
  A[Source sharing configuration] --> B[Session Share publisher]
  C[Session store owner] --> D[Scoped SDK reader]
  E[Profile read worker] --> D
  D --> B
  B --> F[Final disclosure checks]
  F --> G[Paired node transport]
  G --> H[Receiver catalog]
Loading

Technical review

Best possible solution:

Keep person selection in the existing Session Share publisher, using one scoped SDK consumption boundary while preserving group-only sharing.

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

This is a feature request; current-main source confirms group-only selection, and supplied receiver output demonstrates the added person-filtered behavior.

Is this the best way to solve the issue?

The change uses existing session and profile owners, replaces the publisher's previous selection path, and retains the native final guard justified by cross-process writers; the added proof covers distinct disclosure, lifecycle, and upgrade boundaries.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 979c8decf7df.

Provenance checked

  • Group publication and read-only exclusions keeps the original intent (5278a8f: Publish explicitly selected native session groups through bounded read-only paired-node commands.)
  • Revision-aware inventory and native final selection keeps the original intent (63c0208: Reuse worker inventories while keeping exact-row disclosure checks authoritative after asynchronous preparation.)
  • Prepared portable identity projection keeps the original intent (34cb8f7: Move identity preparation off the Gateway thread while retaining final source authority and released synchronous APIs.)
  • Profile reader ownership keeps the original intent (656604d: Prepare disclosure identities through existing workers and retain current authority across awaits.)
  • Ordered session consumption keeps the original intent (283d5e6: Keep native effects bound to current session ownership through existing worker authority cohorts.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +260, Tests +1443, Docs +51, Generated 0, Other +342. Total +2096 across 39 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 17 379 119 +260
Tests 12 1518 75 +1443
Docs 4 64 13 +51
Config 0 0 0 0
Generated 2 3 3 0
Other 4 342 0 +342
Total 39 2306 210 +2096

Review metrics

Metric Value Why it matters
Configuration surface 1 optional setting share.involvingProfileId narrows required groups; omission preserves existing group-only publication.
SDK surface 1 new scoped reader operation withSessionEntriesAsync supplies synchronous disclosure consumption without removing released readers.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: Useful optional sharing capability with a limited operator-selected scope.
  • merge-risk: 🚨 compatibility: Adds a public SDK operation and plugin setting; the maintainer-approved scope retains existing APIs and supplies released group-only upgrade evidence.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-24T06:45:42.773Z sha c19eb80 :: needs real behavior proof before merge. :: [P2] Keep the new profile identity lookup off the host thread
  • reviewed 2026-10-26T12:10:17.245Z sha 01b25ff :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-27T10:51:02.728Z sha f7e4f14 :: needs maintainer review before merge. :: none

Reviewed October 27, 2026, 6:59 AM ET / 10:59 UTC (Revision 4).

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 27, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head: f7e4f14ee53fb17d2043a3fd1d70999ca832211e. The updated PR body includes recorded allowed/excluded/revoked receiver effects and the successful released 2026.10.7 upgrade, first-hop preservation, and paired candidate results. Exact-head CI and Package Acceptance are green.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 27, 2026
@vincentkoc
vincentkoc merged commit c147613 into main Oct 27, 2026
225 checks passed
@vincentkoc
vincentkoc deleted the feat/session-share-person-selection-20261024 branch October 27, 2026 11:07
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
* feat(session-share): filter shared groups by canonical person

* fix(session-share): prepare person selection through the state worker

* test(session-share): exercise paired-node disclosure

* fix(sessions): simplify async cohort return

* docs(config): regenerate session sharing baseline

* test(session-share): prove paired disclosure and stable upgrade

* test(e2e): select native runtime for sharing upgrade fixture

* test(e2e): wait for shipped sharing catalog readiness

* test(e2e): own sharing node pairing before catalog reads

* docs(config): regenerate composed sharing baseline

* docs(config): regenerate successor sharing baseline

* test(e2e): bind upgrade sharing reads to fixture store

* docs(config): regenerate composed sharing baselines

* test(session-share): initialize fresh receiver state
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 proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: XL 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