Repository navigation
feat: support principal-bound remote Control UI for trusted plugins - #170540
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs real behavior proof before merge. What this changesThis PR lets trusted plugin services provide remote Control UI and Gateway RPC access bound to an approved principal and scope ceiling. Example: A verified person with operator.read approves a grant requesting operator.admin.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep this maintainer-owned, security-sensitive feature open; the prior tokenless reconnect documentation finding remains unresolved. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Gateway admits plugin-forwarded HTTP, WebSocket, and RPC requests, intersects the grant ceiling with current principal authority, and dispatches through existing resource and method owners. flowchart LR
A[Trusted plugin service] --> B[Principal binding]
B --> C[Live grant and role authority]
B --> D[Remote HTTP and WebSocket transport]
B --> E[Gateway RPC dispatch]
D --> F[Existing resource and method owners]
E --> F
Technical reviewBest possible solution: Retain the shared Gateway-owned ingress capability, correct the tokenless public guidance, and demonstrate retained-person authorization at the final write boundary. Do we have a high-confidence way to reproduce the issue? The documentation contradiction is directly reproducible by comparing the public guides with token issuance and browser credential selection; no target code or tests were run. Is this the best way to solve the issue? A service-bound SDK capability fits the ownership boundary because principal resolution, session visibility, authentication, and retained-effect checks remain with existing Gateway owners. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 33a438a7624d. Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: The new delegation boundary depends on live grant and principal authority remaining valid at final effects. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)
Reviewed October 13, 2026, 12:02 AM ET / 04:02 UTC (Revision 3). |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…penclaw#170540) * feat: add principal-bound remote Control UI ingress * test: align remote ingress fixtures with runtime contracts * test: publish archive fixture state after the mutation
What Problem This Solves
Trusted plugins need to host a remote Control UI and invoke Gateway RPC for an explicitly approved owner or person without sharing the Gateway token or password.
User Impact
A trusted plugin can bind remote UI and RPC to the same principal and chosen access ceiling. Effective access is that ceiling intersected with the principal's current role and session visibility. Embedded browsers receive no reusable device credential, remain pinned to the serving Gateway, and can use an embedder-provided Gateway switcher.
This is a privileged capability for bundled or verified official plugins. A relay can read and modify content in transit and exercise the approved capabilities; this is not end-to-end encryption against the relay. The core capability alone does not publish a Gateway or enable a relay. Existing installations retain their normal direct-listener authentication and need no config migration.
Why This Change Was Made
The Gateway owns principal resolution, live authority, session policy, HTTP route admission, device pairing, and transport shutdown. The service-bound ingress factory composes those existing owners for plugin transports and grant-bound RPC. Revocation and role changes fence retained work as well as new requests; signed embedded browsers authenticate through the live grant and never receive bearer device tokens.
The MCP relay consumer, consent UI, plugin registration, and real-plugin integration case remain in #168233. This PR contains only the reusable core/SDK capability, its core tests and docs, and the embedder transport UI. The merge preserves main's Solid app root, deferred HTTP runtime admission, and exact media-file identity checks.
Evidence
Standalone core validation (the relay package is physically absent):
pnpm build:ci-artifactspassed in 228.4s, including SDK declarations, plugin exports, and Control UI build/performance limits.max-linesfindings outside this diff; all implicated source and lint configuration blobs match the merged main base. Two earlier findings have disappeared. No lint suppression was added.pnpm deadcode:fullreports one inherited unused export,renderBoardWidgetErrorinui/src/components/board/board-widget-cell-render.ts. The same command reproduces it on clean merged main3f168ed8c3035b9a5c2490b0c837c0cdcaeeba1ewith an independent frozen install; the relevant source and Knip configuration match. Main subsequently removes the obsolete adapter in #170609. The prior SQLite findings are gone. No suppression was added. Required CI remains authoritative, with any inherited-only exception handled through the native evidence workflow. Earlier live ChatGPT/production-relay smoke is recorded in the consumer PR; it covered the earlier owner flow. Current owner/person authorization and revocation are covered by isolated Gateway boundary tests. Live OAuth expiry enforcement is outside this core change and was not independently exercised. The coordinator Gateway was neither restarted nor reconfigured.Release-note context: trusted plugins can expose principal-bound, tokenless remote Control UI and Gateway RPC, constrained by an approved scope ceiling and the principal's live role; embedded browsers support an embedder-owned Gateway switcher.
Existing end-to-end consumer visuals
These sanitized synthetic before/after captures belong to the MCP relay consumer in #168233. This core PR supplies its ingress capability; the Connected apps panel itself remains in that follow-up.
Before:
After:
Follow-up CI fixture validation: test WebSocket hosts use the existing pre-auth payload limit; node-only visibility fixtures preserve the document contract used by browser-client initialization; HTTP-route tests assert abort propagation through composed authority signals; the selected-session mock has its storage-isolation rationale and its obsolete baseline exception was removed by the generator. These changes preserve production behavior. All 69 cases in the five focused authorization, route, activity, and refresh files pass (564.57s total wrapper wall time, dominated by cold worker compilation; UI shard 9.90s). The two payload suites also pass all 45 cases. Fresh independent review through P2, targeted type-aware lint, formatting, and diff checks pass. Broad CI is attached to the repaired head; remaining failures require exact-head attribution before landing.
Archive fixture repair: the selected-session case previously published an archived
sessions.describeresponse before the Archive click. A naturally occurring descriptor refresh could therefore turn that click into an unarchive request. The fixture now publishes that response only after the successful archive mutation, with the committed row timestamp; the original selection, title, transcript, archive attribution, and restored-composer assertions remain unchanged. No production behavior changed. The full archive file passes all 10 cases (150.43s; selected case 3.905s), and targeted type-aware lint, formatting, and both size ratchets pass. A held real descriptor response also passes the original flow when resolved from current fixture state.The earlier controlled diagnostic reproduced the CI signature once, but its unchanged full-PR countercheck passed, so the bisect did not isolate a causal production hunk. The repair addresses the directly observed invalid fixture chronology; passing replays are not being used as inherited-failure evidence. Fresh independent review through P2 is scoped-clean. The repair and reviewed main merge are published at
b060084c99b283f3e69a1b9bd6b4ff5467751348; CI on that exact head remains required. Main independently repaired the premature descriptor and roster clocks; the conflict resolution preserves their deferred patch and clocks while keeping the current post-success descriptor. The affected archive case passes on the merged source (6.031s; 107.83s total, nine unrelated cases omitted), as do UI types, target lint, formatting, and fresh conflict review through P2. The earlier cron snapshot failure matched scheduled main run 38339144048, job 115106094544; any remaining failure on the new head still requires exact-run attribution before landing.Current CI: run 38345779430 tested merge
f7f0a6b351524e6792ccec42d69a382a0fd7aaf4onto main5ac63514950809ba05512c161264ec0bc0945639. All nine archive/UI shards pass. The config-preflight missing-export type error and updater readiness-message mismatch both reproduce on that exact main base, with matching test and owner source inputs. The final Node shard reached its one-hour deadline after the Telegram slow-album test timed out and later same-file tests/hooks failed. Linux baseline run 38353820867 verifies the exact main tree and reproduces the same slow-album timeout (120,036 ms; one failed, one passed, 18 skipped), with an unprepared-runtime-config error. The Telegram, ingress, runtime-config, and test inputs are unchanged in the PR merge. Scheduled main does not select this generic E2E file, so the independent baseline supplies attribution. The cancelled remainder remains unrun coverage, and the full later hook cascade was not replayed. CI remains failed; all remaining roots are inherited and are being submitted through the authorized native exception, preserving security and review gates.