different-ai/openwork · error

MCP_APP_RESOURCE_RESOLUTION_FAILED

MCP_APP_RESOURCE_RESOLUTION_FAILED

Error message

safeMcpAppDiagnosticMessage(cause, "The interactive view resource could not be resolved.")

What it means

Emitted by McpAppFrame when resolving the interactive view resource for an MCP app part fails with an actionable error (isActionableMcpAppResolutionError). The component builds an McpAppDiagnostic with code MCP_APP_RESOURCE_RESOLUTION_FAILED, stage 'resource-resolution', and a message produced by safeMcpAppDiagnosticMessage(cause, fallback) - falling back to 'The interactive view resource could not be resolved.' It surfaces why the embedded MCP app UI could not be fetched/resolved, including the underlying OpenworkServerError causeCode when present.

Source

Thrown at apps/app/src/components/chat/mcp-app-frame.tsx:597

  useEffect(() => {
    let cancelled = false
    setApp(null)
    setError(null)
    if (!result || !openworkServerClient || !workspaceId) return () => { cancelled = true }
    const startedAt = performance.now()
    void openworkServerClient.resolveMcpApp(workspaceId, part.toolName, launch ?? undefined)
      .then(({ app: resolved }) => {
        if (cancelled) return
        // A preserved MCP result is neutral transport data. A null resolution
        // means the current tool definition does not advertise an MCP App, so
        // ordinary tools such as save_artifact_view render only their normal
        // result without claiming an unavailable interactive view.
        setApp(resolved)
      })
      .catch((cause) => {
        if (!cancelled && isActionableMcpAppResolutionError(cause)) {
          const diagnostic: McpAppDiagnostic = {
            code: "MCP_APP_RESOURCE_RESOLUTION_FAILED",
            ...(cause instanceof OpenworkServerError ? { causeCode: cause.code } : {}),
            stage: "resource-resolution",
            message: safeMcpAppDiagnosticMessage(cause, "The interactive view resource could not be resolved."),
            toolName: part.toolName,
            elapsedMs: Math.round(performance.now() - startedAt),
            checkpoints: ["resolve-started"],
          }
          console.error(`[OpenWork MCP App] ${diagnostic.code}`, diagnostic)
          setError(diagnostic)
        }
      })
    return () => { cancelled = true }
  }, [launch, openworkServerClient, part.toolName, result, workspaceId])

  if (!result || (!app && !error)) return null
  if (error) return <McpAppDiagnosticNotice error={error} notice={CHAT_MCP_APP_UNAVAILABLE_NOTICE} />
  if (!app) return null
  return (

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Check the diagnostic's causeCode/stage to see the underlying resolution failure (e.g. 404 vs network).
  2. Re-run the tool call so a fresh interactive view resource is generated and re-resolve it.
  3. Verify the MCP server that owns the resource is running and its resource endpoints are reachable.
  4. If resources expire, configure longer retention or have the client re-request the view instead of caching stale URIs.

Example fix

// before: resolving a stale stored resource URI
setApp(await resolveApp(part.resourceUri))
// after: fall back to a fresh resolution on failure
catch (cause) { setApp(await rerunToolAndResolve(part.toolName)); }
Defensive patterns

Strategy: fallback

Validate before calling

const res = await fetch(viewUrl, { method: 'HEAD' });
if (res.status === 404) throw new OpenworkServerError('RESOURCE_EXPIRED', 'Interactive view resource no longer exists');

Type guard

function isResolutionFailed(d: McpAppDiagnostic): boolean {
  return d.code === 'MCP_APP_RESOURCE_RESOLUTION_FAILED';
}

Try / catch

resolveApp(part).then(setApp).catch((cause) => {
  if (!cancelled && isActionableMcpAppResolutionError(cause)) {
    setDiagnostic({ code: 'MCP_APP_RESOURCE_RESOLUTION_FAILED', stage: 'resource-resolution', causeCode: cause instanceof OpenworkServerError ? cause.code : undefined });
  }
});

Prevention

When it happens

Trigger: The resource fetch for the MCP app's interactive view rejects: the resource URI no longer exists (404), the server returns an OpenworkServerError during resolution, network failure while fetching the view resource, or the resolved payload is not a usable app after retries within the cancellation window.

Common situations: MCP server restarted and its resource handles became invalid; chat history referencing a tool result whose resource expired; server version mismatch changing resource resolution routes; transient network interruption while loading the frame.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/ea308fff92b7e354. Report an issue: GitHub.