Repository navigation
fix(apps): preserve tool results and host protocol contracts - #4862
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Passed · 12/12 tests · 18/18 assertions · 8 images Commit |
Warden review summary — ClearNative findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (145029 ms), confidentiality-review (191323 ms), spec-provenance-review (187000 ms), desktop-den-sync-review (306882 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (2362e57ed7bf1214f8b05697b3c2dbe33687c6cd). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
2362e57 to
ba4008e
Compare
The latest Warden review is blocked or incomplete; clearance revoked.
ba4008e to
9340e58
Compare
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (9340e58e06e90ade07ea345c84619e184a94546f). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
9340e58 to
7ba0107
Compare
| null, | ||
| { name: "OpenWork", version: "1.0.0" }, | ||
| readOnly ? {} : { serverTools: {} }, | ||
| readOnly ? {} : { serverTools: {}, openLinks: {} }, |
There was a problem hiding this comment.
Interactive MCP Apps can open attacker-controlled URLs through Electron
Advertising openLinks lets untrusted MCP App content invoke onopenlink, which passes its URL to Electron's shell.openExternal; require explicit user approval or restrict links to an allowlist before enabling this capability.
Evidence
- The changed capability declaration exposes
openLinksto every non-read-only MCP App sandbox. - The same component registers
bridge.onopenlinkand forwards the app-suppliedurltoopenDesktopUrl. openDesktopUrlonly checks forhttp:/https:and then callswindow.__OPENWORK_ELECTRON__.shell.openExternalin the Electron runtime.- A connected or compromised MCP server can therefore cause the desktop to open arbitrary attacker-controlled web pages, enabling phishing or other unsafe external navigation.
Clear when: MCP App link requests require an explicit user confirmation or are restricted to trusted, validated destinations before reachingshell.openExternal.
Identified by Warden · diff-security-review · FH6-D6C
| ...createOpenworkServerClient({ baseUrl: "http://localhost:1" }), | ||
| resolveMcpApp: async (workspaceId, name, launch, context) => { | ||
| resolutions.push({ workspaceId, name, launch, context }) |
There was a problem hiding this comment.
Private content-block metadata is exposed to the model
The new pass-through for standard MCP content blocks returns nested _meta unchanged, allowing provider-private metadata (including credentials or sensitive identifiers) to become model-visible; strip _meta from model-facing blocks while retaining it only for the app host. Clear when: content blocks delivered through the agent tool result no longer contain provider _meta fields.
Evidence
externalCapabilitySuccessToolResult()usesexternalToolContent(result.result)to build thecontentreturned by the capability gateway.- The changed
externalToolContent()branch returns every SDK-validated content block unchanged. - MCP content blocks may contain reserved
_metafields, so a provider-controlled block can now carry that metadata into the model-visible tool result; the fallback branch previously removed_metaduring serialization.
Identified by Warden · diff-security-review · AJF-ASX
| const launchResult = externalCapabilitySuccessToolResult(executed) | ||
| expect(launchResult.structuredContent).toMatchObject({ | ||
| serverTools: { | ||
| expect(launchResult._meta).toMatchObject({ | ||
| "openwork/serverTools": { | ||
| searchCapabilities: "search_capabilities", |
There was a problem hiding this comment.
Moving MCP App launch metadata breaks published desktop clients
The Den response moves MCP App launch metadata from structuredContent to _meta, so already-published desktop builds that read the former will fail to discover and render external MCP Apps.
Evidence
externalCapabilitySuccessToolResult()now placesresult.mcpAppunder_meta["openwork/mcpApp"]andopenwork/serverToolsrather than instructuredContent.- The desktop MCP App launch path now reads
gatewayMcpAppLaunch(result?._meta), while the preceding desktop implementation consumed the launch reference from the structured result. - The changed test explicitly verifies the new
_metashape, confirming the wire response changed for the same external capability call. - Published desktop binaries still use the old structured-content reader, so they receive a successful tool result without a launch binding and cannot mount the MCP App. Ship a desktop release that accepts both locations first, then deploy the Den response change; clear when old and new desktop builds can both discover the launch binding.
Identified by Warden · desktop-den-sync-review · SZC-BNX
Summary
Preserve MCP App result semantics and advertise only the host capabilities that the originating view can use.
isError, including explicit false, through server preservation, chat parsing, frame delivery and dashboard caching.structuredContentunchanged. Put gateway routing and advisory fields under reserved namespaced_metakeys; schema guidance remains separately model-visible without serializing private provider metadata._metafrom fallback serialization.Current Dev Reconciliation
Previous head:
9340e58e06e90ade07ea345c84619e184a94546f.Current signed head:
7ba0107c3739c5124978da6a3dcfad77b21332ab.Fresh base and merge-base:
858414c41c63a22eecfe331d17f3f5dd348dfc6f(dev).The three useful commits rebase cleanly. Current dev already owns originating endpoint/workspace/session/engine binding, live launch leases, disposal and archive restrictions (#4863), plus private App readiness repair (#4839). Those implementations are retained, not duplicated. The protocol/result increment is still absent from dev, so this PR is not obsolete.
#4294 independently owns bounded discovery recovery and saved dashboard identity checks. This PR does not add retries or replay tools. The candidate heads compose without textual conflicts; that check does not establish combined runtime behavior. No review threads were present when inspected; historical automated review summaries are not current-head clearance.
Verification
Verdict: Incomplete. Passed on the current head, all exit 0:
pnpm --filter @openwork/app exec bun test --isolate tests/mcp-app-frame.test.ts tests/dashboard-tile-cache.test.ts tests/session-sync-tool-parts.test.ts: 49 passed, 0 failed, 0 skipped.pnpm --filter openwork-server exec bun --conditions=development test src/opencode-plugins/openwork-extensions-preview.test.ts src/opencode-plugins/gmail-attachment-fulfillment.test.ts: 50 passed, 0 failed, 0 skipped.pnpm --filter @openwork-ee/den-api exec bun --conditions=development test --isolate test/mcp-tool-content.test.ts test/external-connection-proxy.test.ts test/mcp-agent-timeouts.test.ts: 52 passed, 0 failed, 0 skipped.Gwith Jalil's existing signature.Total: 151 passed; no failed or skipped tests. The focused checks use deterministic fixtures, not live providers. Expected rejection diagnostics and a non-failing storage warning appear in output.
Deferred: the existing
saved-app-creationruntime journey, database-backed search-divergence coverage, and current-head runtime evidence. No manual cloud/E2E/review runs or local E2E were started. Earlier test counts, typechecks and published runtime evidence (including the report forba4008e03e54580c5f8d271ed21fb0cbce90dae9) are historical only and do not prove this head.Message/context writes, View tools, resource proxies and streaming are outside this increment. Normal CI remains required and unchanged. No merge, deployment or review request is included.