Skip to content

feat(ui): add social preview links for private sessions - #139250

Merged
steipete merged 1 commit into
mainfrom
codex/control-ui-social-previews
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/control-ui-social-previews

Conversation

@steipete

@steipete steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private session and dashboard URLs cannot produce useful social previews when link crawlers are redirected to a login page. Simply adding metadata inside the authenticated app would not make it reachable.

Why This Change Was Made

Adds a separate public preview document under the Control UI's /share/ namespace. It serves generic OpenClaw Open Graph metadata and a 1200 × 630 PNG, then links to the normal authenticated session or dashboard. Preview requests never look up session state, including whether the target exists. The card is generated at build time from existing OpenClaw artwork with the existing image library; there are no new dependencies, configuration keys, database changes, or runtime image-rendering jobs.

User Impact

Copy → Preview link is available in the sidebar, session list, and chat-header menus. It reuses the Gateway's public address, preserves deployment base paths, exact session keys, and catalog routing, and excludes connection credentials. Copy → Session link retains its existing direct-link behavior.

The preview contains no session title, messages, widget contents, or screenshot. The URL still contains its routing identifiers. Opening the session still requires normal Gateway access.

Operators using Cloudflare Access or another login proxy must expose only the preview namespace and card image, while keeping the app, WebSocket, bootstrap, and API routes protected. The existing gateway.publicOrigin supplies the public HTTPS origin behind TLS termination. Setup and verification are documented in docs/web/urls.md; this PR does not modify deployment access policies.

Evidence

  • Focused UI/navigation suite: 143 tests passed.
  • Gateway HTTP/routing suite: 37 tests passed, including public preview isolation, disabled UI, and plugin route precedence.
  • Real browser with a synthetic Gateway fixture: Copy → Preview link copied /share/chat/main/preview-example; a separate JavaScript-disabled context rendered the preview and retained /chat/main/preview-example as its destination.
  • Real HTTP tests independently verify that private bootstrap requests return 401; the browser's Gateway fixture is mocked.
  • HTTP coverage preserves encoded slashes and spaces in session keys under both root and nested mounts, using the existing session URL parser.
  • pnpm build ciArtifacts passed, including runtime/plugin builds, SDK declaration/export checks, and the UI build. Independent P0–P2 review is clean. The full changed-file gate passed, including core/test/UI type checks, lint, and repository guards.

The initial full build was invalidated by source changes during compilation; it is not counted as a successful build. The final CI-artifact build passed on frozen sources. The first changed-file run found two implicit Promise-executor returns in the HTTP test; those were corrected, and the complete gate passed on rerun.

Copy menu (synthetic session) Public preview, JavaScript disabled
Copy preview link menu Public session preview

Production/build delta: +156 lines; tests: +146 lines; docs: +42 lines. The growth adds the public document/card and menu action; the Gateway now reuses the shared HTML escaping helper instead of maintaining its own copy.

Focused commands:

node scripts/run-vitest.mjs src/gateway/control-ui-share.http.test.ts src/gateway/server.plugin-http-auth.test.ts
node scripts/run-vitest.mjs ui/src/lib/sessions/session-menu-navigation.test.ts ui/src/components/session-menu.test.ts ui/src/pages/chat/components/chat-header-session-menu.test.ts ui/src/app-route-paths.test.ts
pnpm build ciArtifacts
env -u OPENCLAW_TESTBOX node scripts/check-changed.mjs

Live Discord/Slack/X unfurl rendering remains a deployment check: it requires the public preview path to be enabled at the proxy. Local verification exercises the HTTP responses consumed by crawlers and the browser copy/open flow.

Serve generic Open Graph cards without reading session state. Preserve direct links and authentication, reuse the session URL grammar, and document public preview routing for login proxies.
@clawsweeper

clawsweeper Bot commented Sep 5, 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 size: M maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 17:45
@steipete
steipete requested a review from a team as a code owner September 5, 2026 17:45
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 1:52 PM ET / 17:52 UTC.

ClawSweeper review

What this changes

Adds a session-menu action that copies public preview links, generic social-card pages and build-generated artwork, with deployment guidance for login proxies.

Merge readiness

✅ Ready for maintainer review

Keep open: this adds a distinct capability absent from inspected main. No blocking correctness findings were identified, and the maintainer label independently excludes automated closure.

Priority: P3
Reviewed head: 8f4a434014e56c5ee06e875b6343c4fda2cf766c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with useful boundary coverage and no identified blocking defect; runtime results are contributor-reported.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-author exemption applies. The captured body reports browser copy/open behavior and HTTP isolation checks; linked images were inaccessible here, and no screenshot-based security claim is accepted.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-author exemption applies. The captured body reports browser copy/open behavior and HTTP isolation checks; linked images were inaccessible here, and no screenshot-based security claim is accepted.
Evidence reviewed 11 items Verified review scope: Origin identifies openclaw/openclaw. Raw test-merge parents match the pinned main followed by the exact PR head; its main-relative changes match the introduced files. Unrelated model-selection and outbound-delivery changes are base drift.
Public document boundary: The preview owner parses the existing session URL grammar, preserves encoded paths, retains only catalog routing parameters, escapes interpolated values, and performs no session lookup. Its response disables scripts and uses no-store and no-referrer policies.
HTTP routing and sibling isolation: The standalone handler terminates share requests before ordinary plugin dispatch, including when the UI is disabled. The card maps to one static file through existing containment checks; bootstrap authorization remains separate. Approval, focus, media, and plugin routing were inspected.
Findings None None.
Security None None.

How this fits together

The Control UI turns session-menu selections into Gateway URLs. The Gateway serves generic preview metadata and artwork, then directs visitors to the existing authenticated session view.

flowchart LR
  A[Session menu] --> B[Build preview URL]
  B --> C[Gateway preview route]
  D[Link crawler or visitor] --> C
  C --> E[Generic page and static card]
  E --> F[Open session link]
  F --> G[Existing authentication]
  G --> H[Session or dashboard]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +156, Tests +146, Docs +42. Total +344 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 12 180 24 +156
Tests 6 151 5 +146
Docs 1 42 0 +42
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 373 29 +344

Review metrics

Metric Value Why it matters
Production versus test growth Production/build net +156 lines; tests net +146; docs +42 Growth implements a new public document and card capability while reusing navigation, static serving, and HTML escaping.
Public surface 1 preview namespace added; 0 configuration keys or dependencies added The feature uses existing public-origin configuration and keeps image generation at build time.

Technical review

Best possible solution:

Keep previews generic and state-free, reuse canonical session URLs, and leave proxy exposure explicitly operator-controlled.

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

Not applicable: this adds a preview capability; it does not report a broken existing contract.

Is this the best way to solve the issue?

Yes: a separate state-free document addresses crawler access without exposing authenticated session content; adding metadata only inside the app would leave the login-proxy problem unresolved.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3e4becea5e2c.

Labels

Label changes:

  • add P3: Social preview links improve sharing ergonomics without repairing an urgent broken workflow.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-author exemption applies. The captured body reports browser copy/open behavior and HTTP isolation checks; linked images were inaccessible here, and no screenshot-based security claim is accepted.

Label justifications:

  • P3: Social preview links improve sharing ergonomics without repairing an urgent broken workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-author exemption applies. The captured body reports browser copy/open behavior and HTTP isolation checks; linked images were inaccessible here, and no screenshot-based security claim is accepted.

Evidence

What I checked:

  • Verified review scope: Origin identifies openclaw/openclaw. Raw test-merge parents match the pinned main followed by the exact PR head; its main-relative changes match the introduced files. Unrelated model-selection and outbound-delivery changes are base drift. (c5a1ef516a97)
  • Public document boundary: The preview owner parses the existing session URL grammar, preserves encoded paths, retains only catalog routing parameters, escapes interpolated values, and performs no session lookup. Its response disables scripts and uses no-store and no-referrer policies. (src/gateway/control-ui-share.ts:19, 8f4a434014e5)
  • HTTP routing and sibling isolation: The standalone handler terminates share requests before ordinary plugin dispatch, including when the UI is disabled. The card maps to one static file through existing containment checks; bootstrap authorization remains separate. Approval, focus, media, and plugin routing were inspected. (src/gateway/server-http.ts:560, 8f4a434014e5)
  • Shared navigation owner: Sidebar, session-list, and chat-header callers reach the same navigation function. Preview links reuse the existing Gateway address and session-path builder; direct links and new-window navigation retain their previous destinations. Catalog identifiers are ordinary OpenClaw routing data and do not establish a Codex runtime dependency. (ui/src/lib/sessions/session-menu-navigation.ts:187, 8f4a434014e5)
  • Boundary coverage: Read HTTP and navigation tests covering root/nested mounts, GET/HEAD, malformed routes, credential stripping, escaped keys, catalog routing, bootstrap rejection, disabled UI, and plugin precedence. Tests were not executed during this read-only review. (src/gateway/control-ui-share.http.test.ts:10, 8f4a434014e5)
  • Current-main and release necessity: Current main has direct-link copying but no social-preview owner or corresponding metadata in the searched Gateway/UI surfaces. The new handler is also absent from v2026.9.1. No verified replacement PR was supplied; the attempted GitHub search could not connect. (ui/src/lib/sessions/session-menu-navigation.ts:185, 3e4becea5e2c)

Likely related people:

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

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.

@steipete steipete self-assigned this Sep 5, 2026
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Landing checks for 8f4a434014e5:

  • Fresh independent review found no actionable P0–P2 findings. The latest ClawSweeper review also has no findings or pre-merge actions.
  • Exact-head CI passed on attempt 2, including openclaw/ci-gate.
  • The first browser shard run missed an A2UI board.event after the light-theme Refresh data click. The same head passed the targeted job rerun. Both unchanged dark→light cases also passed locally with node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/board-a2ui.e2e.test.ts. No timeout or assertion was weakened.
  • Prior focused HTTP/navigation proof, the CI-artifact build, changed-file checks, and inspected synthetic copy/open screenshots are recorded in the PR body.

The public boundary remains generic and state-free: it never looks up a session, and its destination retains normal authentication. Production/build +156 lines implement that new capability; tests +146 and docs +42. No new configuration, dependency, or storage contract.

Follow-up if the A2UI event failure recurs: capture its click/bridge lifecycle and inner-widget error before choosing a repair. Its owner files are unchanged by this PR.

Proxy exposure remains an operator deployment step; this merge does not enable the public path on any running instance. Proceeding through native prepare/merge.

@steipete
steipete merged commit e982e7c into main Sep 5, 2026
386 of 388 checks passed
@steipete
steipete deleted the codex/control-ui-social-previews branch September 5, 2026 18:19
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 5, 2026
* commit '911d7d5b0c107f7274f2415ca9655dcc6105f0e8': (867 commits)
  fix(skills): deliver pending Workshop approval controls (#139248)
  fix(gateway): deliver loopback ask_user prompts to the originating channel (#138831)
  docs: keep root agent instructions focused on repository policy (#139258)
  fix(matrix): exclude archived state roots from scans and selection (#112329)
  perf(agents): prepare exact tool names once per catalog batch (#139267)
  fix: preserve Swarm progress and simplify owner plumbing (#139269)
  fix(tailscale): release claims after gateway process-group exit (#139261)
  refactor(cli): simplify lazy command registration (#139108)
  test(ui): retain synthetic widget failure evidence (#139229)
  fix(buzz): keep implicit replies at thread root (#138879)
  test(diagnostics): await graceful Gateway shutdown before cleanup (#139247)
  fix(ci): unblock releases with different tooling package managers (#139259)
  feat(ui): add social preview links for private sessions (#139250)
  fix(codex): retain failed conversations for guarded continuation (#139246)
  chore(ui): refresh control ui locales (#139200)
  fix(ci): run browser checks for real-gateway inputs (#139256)
  fix(llama-cpp): reconcile managed router state before requests (#136363)
  chore(i18n): refresh native locales (#139237)
  refactor(worker): unify inference payload handling (#139245)
  refactor(terminal): replay wrapped prefixes in one pass (#139240)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
)

Serve generic Open Graph cards without reading session state. Preserve direct links and authentication, reuse the session URL grammar, and document public preview routing for login proxies.
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 docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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