Skip to content

feat(dashboard): persist MCP Apps as board widgets#111552

Closed
fuller-stack-dev wants to merge 2 commits into
mainfrom
codex/mcp-app-widget-backend
Closed

feat(dashboard): persist MCP Apps as board widgets#111552
fuller-stack-dev wants to merge 2 commits into
mainfrom
codex/mcp-app-widget-backend

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Jul 19, 2026

Copy link
Copy Markdown
Member

Related: #111218

What Problem This Solves

Pinned dashboard widgets could persist HTML, but an MCP App view was only an expiring runtime lease. There was no backend-owned way to admit an MCP App pin, retain a safe durable descriptor, or remint a view after restart without persisting the App HTML, tool inputs/results, or transient view ID.

Why This Change Was Made

This adds the backend/protocol/store half of durable MCP App widgets. The public pin payload contains only { kind: "mcp-app", viewId }; the Gateway validates the live view in the board session, requires its originating tool call, derives the stable descriptor and App-visible tools server-side, and persists only canonical authority metadata.

Board App views are reminted from the authenticated transcript. They are read-only until explicitly granted, use only the snapshotted App-visible tools, and recheck current grant, revision, and instance authority for every interactive capability. Restart-reconstructed or revoked source views remain read-only. Existing HTML show_widget and channel behavior are unchanged.

AI-assisted: yes. The original feature patch and the two-line CI correction both completed mandatory autoreview with no accepted or actionable findings.

User Impact

The backend can now safely represent MCP Apps as durable board-widget content and remint their views after the original lease expires or the Gateway restarts. This PR intentionally adds no UI or channel behavior.

Scope: 25 files, +1116/-94 lines. No SQLite schema version or table-shape change.

Evidence

  • Final base: upstream/main at 3c0f55b58f3ce789295e42259f071e96a21f33b0.
  • Head: 7ed78c78627cd8940ec9c4e72b7225061fe06684.
  • Final ancestry: git merge-base --is-ancestor upstream/main HEAD exited 0 immediately before push.
  • Rebase integrity: git range-diff bcbbf28093b4777e1079a6c9503e9db42f8b6507..7026ee47c20d2663bd13b181b70b292e75ff0da6 3c0f55b58f3ce789295e42259f071e96a21f33b0..4513825130a36eff2e21774dae346e97d2a02938 reports 7026ee47c20 = 4513825130a; the original feature patch is byte-equivalent after rebase.
  • The only additional commit is 7ed78c78627, which removes the unused exported BoardWidgetDocument type and registers board.widget.appView in the release-train expectation.
  • Focused behavior proof: node scripts/run-vitest.mjs packages/gateway-protocol/src/schema/board.test.ts packages/gateway-protocol/src/schema/error-codes.test.ts src/boards/board-store.test.ts src/boards/board-store.parity.test.ts src/gateway/board-http.test.ts src/gateway/mcp-app-reconstruction.test.ts src/gateway/server-methods/board.test.ts src/gateway/server-methods/mcp-app.test.ts src/agents/mcp-ui-resource.test.ts src/gateway/methods/core-descriptors.since.test.ts — 4 shards, 10 files, 111 tests passed on the corrected rebased head.
  • Original-patch Blacksmith Testbox: provider blacksmith-testbox, id tbx_01kxy41avfw09k4thv4tnnzsrb, run 29704184686. The authored-file check:changed gate and pnpm build passed.
  • Post-fix Testbox exception: provider blacksmith-testbox, id tbx_01kxydc4nnjt36gm586v63332x, run 29708908882 remained queued while official GitHub Status reported API partial outage and Actions degraded performance. The lease was stopped; normal and force-cancel requests both returned HTTP 503, so the Actions run remained queued at last read. This run is not claimed as green.
  • Autoreview: the two-line uncommitted correction and the full rebased branch against upstream/main both exited clean with no findings.
  • git diff --check passed.

Merge requirement: do not merge until required CI is green for exact head 7ed78c78627cd8940ec9c4e72b7225061fe06684, including the previously failing dependency and compact-large shards.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Jul 19, 2026
@clawsweeper clawsweeper Bot added 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. 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. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 9:54 PM ET / July 20, 2026, 01:54 UTC.

Summary
Adds durable MCP App dashboard widgets by materializing a transient viewId into server-derived board metadata, reminting a view from the session transcript, and exposing the board.widget.appView Gateway method.

PR surface: Source +436, Tests +519, Other +67. Total +1022 across 25 files.

Reproducibility: not applicable. as a bug report: this PR adds a new durable MCP App dashboard capability. The supplied focused tests cover the backend behavior, but no failing current-main bug is being claimed.

Review metrics: 1 noteworthy metric.

  • Gateway and persistence surface: 1 new Gateway method; 1 new durable MCP App widget representation. The PR changes both a public protocol surface and persisted board metadata, so the upgrade and authority contract merits owner review.

Stored data model
Persistent data-model change detected: serialized state: src/boards/sqlite-board-store.ts, unknown-data-model-change: packages/gateway-protocol/src/schema/board.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Obtain an explicit dashboard/Gateway owner decision on the durable descriptor and restored-interactivity contract.
  • [P2] Wait for all required CI to complete successfully on the exact head.

Risk before merge

  • [P1] Merging establishes a persistent MCP App descriptor and a new Gateway method whose upgrade, client, and long-term protocol contract need explicit owner acceptance.
  • [P1] The descriptor is reconstructed from authenticated transcript data and can regain interactivity through current grants; maintainers should confirm that the descriptor identity, transcript lookup, and instance/revision checks are the intended durable authority boundary.
  • [P1] Required CI for the exact head is not fully green yet: several requested jobs remain queued, so merge readiness cannot be established from the current status alone.

Maintainer options:

  1. Approve with exact-head CI (recommended)
    After an owner accepts the persistent descriptor and authority semantics, require all required checks to pass on 7ed78c78627cd8940ec9c4e72b7225061fe06684 before merge.
  2. Require a contract revision
    Pause merge and revise the protocol/storage or authorization design if the owner does not want transcript-reminted views to use this durable authority model.

Next step before merge

  • [P2] A protected member-authored feature needs a maintainer decision on the permanent protocol, persistence, and restored-interactivity boundary; there is no narrow mechanical repair to dispatch.

Maintainer decision needed

  • Question: Should OpenClaw adopt this persistent MCP App board-descriptor and transcript-reminting contract, including the instance/revision/grant checks that govern restored interactivity?
  • Rationale: The patch is an additive feature rather than a repair: it creates a durable stored representation and public Gateway API for a previously transient MCP App view, so code review alone cannot choose the intended product and security boundary.
  • Likely owner: steipete — The merged dashboard stitching work and its stated remaining MCP App pinning scope make this the strongest feature-history routing candidate.
  • Options:
    • Approve the durable contract (recommended): Accept the server-derived descriptor and reminting model, then land after exact-head required CI is green.
    • Narrow the authority contract: Require a revised descriptor or authorization model before merge if owners want stronger or differently scoped restoration semantics.
    • Defer durable MCP App widgets: Pause this backend feature and keep the existing transient-view model until the dashboard roadmap explicitly sponsors persistence.

Security
Cleared: The reviewed patch adds grant and instance/revision checks around restored MCP App interactivity and introduces no dependency, workflow, secret, or supply-chain change in the supplied diff.

Review details

Best possible solution:

Accept the backend only after the dashboard/Gateway owners explicitly approve the durable descriptor and authority model, then require exact-head CI before landing it as the prerequisite for the separately scoped UI renderer.

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

Not applicable as a bug report: this PR adds a new durable MCP App dashboard capability. The supplied focused tests cover the backend behavior, but no failing current-main bug is being claimed.

Is this the best way to solve the issue?

Unclear pending owner intent: server-side descriptor derivation and transcript reminting avoid persisting HTML or tool payloads, but maintainers must decide whether this is the intended permanent Gateway and board-authority contract.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 27f05c8993fb.

Label changes

Label justifications:

  • P2: This is a substantial but non-emergency dashboard/MCP capability whose merge needs normal maintainer design review.
  • merge-risk: 🚨 compatibility: The PR adds a public Gateway method and persists new MCP App widget metadata that clients and upgrades must interpret consistently.
  • merge-risk: 🚨 security-boundary: Restored views can expose interactive MCP App capabilities, making descriptor identity and grant rechecks security-sensitive.
  • 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: This MEMBER-authored backend-only PR is exempt from the external-contributor real-behavior-proof gate; it supplies focused post-change test evidence, while end-user UI proof belongs to the dependent renderer PR.
Evidence reviewed

PR surface:

Source +436, Tests +519, Other +67. Total +1022 across 25 files.

View PR surface stats
Area Files Added Removed Net
Source 14 499 63 +436
Tests 9 543 24 +519
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 74 7 +67
Total 25 1116 94 +1022

What I checked:

  • Protected maintainer feature: The item is authored by a repository MEMBER and carries the maintainer label, so this workflow must keep it open for explicit maintainer handling. (7ed78c78627c)
  • Persistent board and Gateway contract: The patch adds the materialized MCP App content form, instance-bound grant parameters, and the board.widget.appView request/result schema; this is an additive public protocol and persisted-board contract. (packages/gateway-protocol/src/schema/board.ts:132, 7ed78c78627c)
  • Authority enforcement path: The patch routes interactive MCP App operations through requireMcpAppInteraction, including an authorization callback intended to recheck widget grant state before tool calls and model-context updates. (src/gateway/mcp-app-operations.ts:60, 7ed78c78627c)
  • Feature history: The dashboard stitching work was merged in commit 06480d767cefeb6514395930f189a27c5aed8983; its PR description explicitly identified MCP App pinning as remaining program work, making this backend PR an adjacent continuation rather than duplicate work. Public docs: docs/web/dashboard-architecture.md. (docs/web/dashboard-architecture.md:1, 06480d767cef)
  • Dependent UI implementation: The open UI implementation at feat(ui): render MCP Apps in dashboard widgets #111585 explicitly depends on this backend contract, so this PR remains necessary rather than superseded. (17dd3215989b)
  • Focused validation evidence: The PR body reports 111 focused tests across board protocol, stores, reconstruction, gateway handlers, and MCP operations on the exact head; the supplied check state also shows the Gateway critical-quality and security-sensitive checks succeeding, while broader queued work remains unresolved. (src/gateway/server-methods/board.test.ts:1, 7ed78c78627c)

Likely related people:

  • steipete: Authored the merged dashboard stitching PR that established the board/widget program and documented MCP App pinning as remaining work. (role: feature-history contributor; confidence: high; commits: 06480d767cef; files: docs/web/dashboard-architecture.md, src/boards/board-store.ts, src/gateway/server-methods/board.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-19T22:10:25.527Z sha 7026ee4 :: needs maintainer review before merge. :: none

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Closing as superseded in feature scope by #111524, merged as 64c82812a5e52f4a03d2b89b8132c068a048a81b.

Fresh-main audit at a8dd80afc09740769b6938881f9a38ba48ab3c11 confirms that main now contains durable MCP App board persistence, transcript remint, allowed-tool derivation, rendering, and app-view registration. This branch now overlaps #111524 in 22 of 25 files and cannot be safely rebased or merged wholesale.

The audit also found authority-hardening work that remains valid but must land as a narrow fresh-main follow-up: a viewId-only public pin contract with server-derived descriptor, required interaction provenance, dynamic authorization for every App interaction including zero-tool views, and removal of the unreleased compatibility path. That follow-up is being prepared independently from current main.

Reopen only if current main is shown to lack the merged feature surface itself; remaining hardening belongs in the fresh follow-up rather than this conflict-heavy branch.

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: android App: android app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR 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. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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