Skip to content

feat: send participant exec approvals to the session creator - #204858

Merged
jalehman merged 8 commits into
mainfrom
participate-split/p3-creator-approvals
Nov 25, 2026
Merged

jalehman merged 8 commits into
mainfrom
participate-split/p3-creator-approvals

Conversation

@jalehman

@jalehman jalehman commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Related: #202552

Part 3 of 6 of the split of #202552 (Participate: let invited people take part in your session).
Stack: #204783 (part 1, merged) → #204847 (part 2, merged) → this PR (part 3) → #204899 (part 4) → #204914 (part 5). Now based on main, since #204847 has merged.

What Problem This Solves

When an invited person takes part in someone else's session, their agent run can ask to execute a command that needs approval. Today an exec approval goes to the configured approvers for the device that asked, which for a participant run can be the participant themselves. A participant must not be able to approve their own command inside someone else's session.

User Impact

No change for anyone yet: nothing can create a participant run until part 4 lands. Once it does, a participant's exec approval goes to the session's creator (or an admin), the participant's session is told it is waiting, and only the creator or an admin can approve or deny it.

Visible to everyone, including people who never opt in:

  • Reconnect progress snapshots now keep waiting-approval and approval-resolved lifecycle entries for every run, so a client that reconnects mid-run still sees that the run is waiting for approval.
  • The connect hello advertises a new session-approval-recipients-v1 capability to every client. Older clients ignore it.

Why This Change Was Made

This is a restriction that has to exist before anyone can be admitted. Each piece only acts when the run carries a participation ceiling, which only part 2's admitted-run authority produces and only part 4's admission can grant:

  • exec-approval-participation.ts binds a participant run's approval to the session creator, and authorizes exec.approval.resolve / approval.resolve / exec.approval.request / exec.approval.waitDecision for that binding.
  • Approval delivery, broadcast and session approval events are scoped to the bound recipient; replay after reconnect is scoped the same way. Reconnect replay keeps main's session-indexed selection: the session event runtime tracks pending participant approvals per audience session from the approval lifecycle, and only those IDs (resolved for the reconnecting client) are passed to the bounded store read. Sessions without participant approvals replay exactly as on main, and approvals in other sessions don't affect a session's replay. A participant approval is delivered only to the creator's connected approval clients, never to forwarders, mobile or Web Push, channel approval subscribers or the turn-source route, because none of those can resolve it. This matches how cron approvals are already limited to approval clients.
  • The visible-record and lookup paths let the participant see that their request is pending without letting them resolve it. The creator-only check also applies when approval.resolve names the approval by its compact transport reference: the check runs again against the canonical approval the store returns, so a participant can't resolve their own request through the reference. Method admission still matches exact IDs only, so a creator without operator.approvals must use the canonical ID (what the Control UI sends). Transport references come from channel and device surfaces, which can never resolve a participant approval.
  • The gateway exec host enforces the participant allowlist-miss denial: part 2 computes the retained rule (participationDenyMisses), and this part makes bash-tools.exec-host-gateway.ts refuse an allowlist miss with participant-allowlist-miss instead of reopening it through a host on-miss/always approval. The refusal tells the agent and user that no approval can be requested for that command, and to use an allowed command or ask the session creator to run it. The test for it (core-coding-tools.exec-workdir) moves here from part 2.
  • The exec auto-reviewer is told that a participant cannot grant creator authority (the prompt line cites feat: invite someone to help in one session without giving them Gateway-wide write access #202552 and this PR as its source).
  • The session-approval-recipients-v1 capability constant is defined here, next to the hello that advertises it.
  • GatewayBroadcastOpts gains the host-only participationApprovalRecipient filter, and method-authorization.ts gains the participation-approval check. Both files otherwise belong to part 4; these are the only hunks this part needs from them.

Data-model compatibility: this PR changes no stored format. The participant binding (ExecApprovalRecord.participation) is process-local and never written to the operator-approval store (the participation suite asserts the stored row has no participation field). The store and pending-view changes only add an in-memory read filter. The schema v44 member-access migration and its upgrade evidence from the published [email protected] belong to #204783 and are unchanged here.

Still inert until later parts: participant runs exist only from part 4 (admission), and the Control UI approval notices for participants and creator review controls arrive in part 6.

Evidence

Checked on this branch on current main (parts 1 and 2 merged):

  • Core and UI typechecks pass, and all 33 test-shard typechecks pass.
  • Lint and format pass on the changed files; madge finds 0 cycles; the session-identity and test-lines ratchets pass; protocol:check (including the Swift and Kotlin contracts), the worker-access inventory and the Vitest inventory ownership tests pass.
  • The PR's own suites pass: exec-approval.participation (creator or admin only, ordinary approvals unchanged, direct and child bindings, merged identities), operator-approval-participation-replay, operator-approval-session-events, approval.channel-custody, server-chat-progress-snapshot, exec-auto-reviewer and core-coding-tools.exec-workdir (retained allowlist misses are not reopened through host on-miss/always).
  • The end-to-end proof through the real admission path (server.participation-approval-delivery) lands with part 4, because only part 4 can admit a participant.

Live proof: this is maintainer-authored work, so ClawSweeper's real-Gateway/model proof gate doesn't apply. The evidence is the focused suites above, which run the real Gateway request handlers, approval managers and stores in-process.

Test-line budget: this part adds 734 net test lines; config/test-lines-allocations/204858-participate-creator-approvals.txt records the 334 lines above the 400-line allowance and explains why.

🦞 Made with OpenClaw

@clawsweeper

clawsweeper Bot commented Nov 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 app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: XL labels Nov 24, 2026
@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 24, 2026
@clawsweeper

clawsweeper Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Binds participant exec approvals to the session creator and scopes resolution, delivery, and reconnect replay to that binding.

Example: A run reconnects while approval a is pending.

  • Before: Reconnect progress omits the waiting-approval lifecycle entry.
  • After: Replay retains the redacted waiting status for a and removes it after resolution.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful staged authority work with focused in-process coverage and no identified blocker; evidence does not establish the full shipped participant flow.
Proof confidence 🦐 gold shrimp (3/6) The maintainer-authored proof exemption applies; supplied evidence exercises real handlers, managers, and stores in process, while the inspected screenshots show historical invitation UI rather than current approval routing.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Partial
User problem: Invited participants need command review by the session creator without acquiring authority to approve their own commands.
Reason: The maintainer-authored direction establishes a necessary authority boundary before participant admission; the body correctly uses Related for the larger feature.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored stage supplies the approval boundary needed by the Participate stack, with no blocking code defect found in the pinned diff; CI remains pending.

Reviewed head: 390a1f4891a9869a60807ffa19a49b336f0c6eab

Before merge

None.

Findings

None.

Tests

Agent review details

How this fits together

The Gateway receives exec approval requests from admitted agent runs, derives participant authority from host-owned run state, and sends approval cards or waiting status to authorized clients through the existing approval manager and session replay store.

flowchart TD
  A[Admitted agent run] --> B[Exec approval handler]
  B --> C[Host participant binding]
  C --> D[Existing approval manager]
  D --> E[Creator review clients]
  D --> F[Participant waiting status]
  D --> G[Session scoped replay]
Loading

Technical review

Best possible solution:

Keep this staged boundary in the existing approval manager and replay owners, then activate participant admission through the dependent stack.

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

This is a staged feature whose participant admission is not yet available on main; source inspection establishes the missing approval binding, and no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

The change uses existing approval ownership, adds a host-only binding shared by resolution and delivery, and preserves session-indexed replay without introducing a competing execution authority.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Invitation approval authority changes intended behavior with a stated reason (2b5f1a8: The earlier merged change limited invitees to their own approvals while retaining existing reviewer and device checks for ordinary sharing.)
  • Pending approval replay keeps the original intent (0bde641: Session-indexed pending selection and bounded replay reuse prevent reconnects from scanning unrelated approvals.)
  • Durable approval storage keeps the original intent (5e2b898: Approval persistence runs through the worker-owned store; this change retains that owner and changes only selection inputs.)
  • Gateway exec denial keeps the original intent (d2699a8: The preceding merged participant-limit stage computes the retained allowlist-miss denial; this stage enforces it before host approval can reopen the command.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 5b56a1f adds src/gateway/operator-approval-session-events.ts:38 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5b56a1f664e6; files: src/gateway/operator-approval-session-events.ts)

PR surface

Source +607, Tests +735, Docs +7, Other +18. Total +1367 across 37 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 25 747 140 +607
Tests 9 737 2 +735
Docs 2 9 2 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 1 18 0 +18
Total 37 1511 144 +1367

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 status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

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

History

Review history (6 earlier review cycles)
  • reviewed 2026-11-24T19:43:33.727Z sha 47e15a6 :: needs changes before merge. :: [P2] Keep replay candidate selection scoped to the subscribed session | [P2] Explain that participant allowlist misses cannot request approval
  • reviewed 2026-11-24T22:24:28.518Z sha 1bd1b63 :: blocked before merge. :: [P1] Authorize the canonical approval reached through a transport reference | [P2] Cite the source for the new participant reviewer rule
  • reviewed 2026-11-24T22:55:41.520Z sha 6c74d16 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-25T02:21:43.266Z sha 3aa15c8 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-25T04:28:13.378Z sha d113555 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-25T05:55:28.619Z sha d8436d3 :: needs changes before merge. :: none

Reviewed November 25, 2026, 1:57 AM ET / 06:57 UTC (Revision 7).

@jalehman
jalehman force-pushed the participate-split/p3-creator-approvals branch from 47e15a6 to e4b4032 Compare November 24, 2026 19:47
@openclaw-barnacle openclaw-barnacle Bot removed scripts Repository scripts commands Command implementations labels Nov 24, 2026
@jalehman
jalehman force-pushed the participate-split/p2-participant-limits branch from 84bdf51 to 795ef79 Compare November 24, 2026 20:13

@THE-NAVVV THE-NAVVV left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

​

@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Nov 24, 2026
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@jalehman
jalehman force-pushed the participate-split/p3-creator-approvals branch from d113555 to d8436d3 Compare November 25, 2026 04:46
Base automatically changed from participate-split/p2-participant-limits to main November 25, 2026 05:42
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 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: 390a1f4891a9869a60807ffa19a49b336f0c6eab
  • Maintainer: @jalehman
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/exec-approval-result.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/exec-auto-reviewer.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/exec-approval-delivery.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/exec-approval-manager.types.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/exec-approval-participation.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/server-methods/exec-approval.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/server-methods/method-authorization.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-connection/connect-hello.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 25, 2026
@jalehman
jalehman force-pushed the participate-split/p3-creator-approvals branch from d8436d3 to 2814a32 Compare November 25, 2026 06:03
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Nov 25, 2026
@jalehman
jalehman force-pushed the participate-split/p3-creator-approvals branch from 2814a32 to 390a1f4 Compare November 25, 2026 06:51
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 25, 2026
@jalehman
jalehman merged commit 937aeeb into main Nov 25, 2026
178 of 183 checks passed
@jalehman

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@jalehman
jalehman deleted the participate-split/p3-creator-approvals branch November 25, 2026 07:32
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
…w#204858)

* feat: send participant exec approvals to the session creator

* chore: name the test-line allocation after its pull request

* test: enforce retained participant allowlist misses on the gateway exec host

* fix: scope participant approval replay to its session and explain participant allowlist denials

* test: avoid a shadowed replay selection name

* fix: apply the creator-only check to approvals resolved by transport reference

* chore: describe the transport-reference case in the test-line record

* chore: regenerate the worker access inventory on current main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation 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: 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.

2 participants