Skip to content

DONT merge#1194

Closed
ved015 wants to merge 1 commit into
graphite-base/1194from
fix/mcp-fetch-graph-data-view
Closed

DONT merge#1194
ved015 wants to merge 1 commit into
graphite-base/1194from
fix/mcp-fetch-graph-data-view

Conversation

@ved015

@ved015 ved015 commented Jul 3, 2026

Copy link
Copy Markdown
Member

No description provided.

fetch-graph-data returned raw DocumentsApiResponse as structuredContent,
which the widget cannot dispatch on, rendering "Received unrecognized
response from server" despite the call succeeding. It now returns a proper
graph ViewMessage so the widget renders the memory graph.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
supermemory-app b356798 Commit Preview URL

Branch Preview URL
Jul 03 2026, 03:23 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
supermemory-mcp b356798 Jul 03 2026, 03:22 PM

ved015 commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label Main to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude

claude Bot commented Jul 3, 2026

Copy link
Copy Markdown

Claude finished @ved015's task in 1m 30s —— View job


Review Complete

  • Gather context
  • Get PR diff and analyze changes
  • Review surrounding code for potential issues
  • Submit review

Overview: This PR fixes fetch-graph-data to return a proper ViewMessage instead of raw DocumentsApiResponse, enabling the widget to correctly render the memory graph.

Issues found: None — this looks good to ship.

The fix correctly follows the established pattern used in memory-graph.ts. The ViewMessage type for the "graph" view is properly satisfied with all required fields (view, documents, totalCount) and the optional containerTag. The text content is also improved to be human-readable instead of raw JSON.

Score: 10/10

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: This PR fixes fetch-graph-data to return a proper ViewMessage instead of raw DocumentsApiResponse, enabling the widget to correctly render the memory graph.

Issues found: None — this looks good to ship.

The fix correctly follows the established pattern used in memory-graph.ts (lines 46-51). The ViewMessage type for "graph" view is properly satisfied with all required fields: view, documents, totalCount, and optional containerTag. The text content is also improved to be human-readable instead of raw JSON.

Score: 10/10

@vorflux vorflux Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Reviewed — found 1 issue(s). This change updates fetch-graph-data to return a graph ViewMessage in structuredContent so the MCP widget can route it correctly, but the diff also changes the structured response contract. I reviewed the changed apps/mcp/src/server/tools/fetch-graph-data.ts path for regressions in caller-visible data shape.

Findings

apps/mcp/src/server/tools/fetch-graph-data.ts

  1. structuredContent was converted to a graph ViewMessage but no longer includes pagination, breaking callers and tests that rely on structuredContent.pagination.

Verdict

⚠️ Changes requested. Please preserve the existing pagination contract while keeping the graph view shape required by the widget.


Review with Vorflux


// structuredContent must be a ViewMessage — the widget dispatches on
// `view` and renders anything else as an "unrecognized response" error.
const sc: ViewMessage = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

structuredContent now becomes a ViewMessage, but this drops the existing pagination object even though fetch-graph-data still accepts page/limit and apps/mcp/e2e/graph.test.ts still asserts res.structuredContent.pagination.limit === 5. This breaks the structured pagination contract for callers and will likely fail the graph E2E case when API_KEY is present. Please keep the graph ViewMessage shape for widget dispatch, but preserve pagination in structuredContent too, for example by extending the graph view message with pagination: data.pagination and updating the shared type.

@vorflux

vorflux Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Testing

Static validation was completed for the MCP server change in apps/mcp/src/server/tools/fetch-graph-data.ts. No automated, runtime, CI, E2E, browser, API, or MCP client tests were run, per the explicit testing constraint.

Commands run:

git diff --stat origin/fix/mcp-widget-error-display...origin/fix/mcp-fetch-graph-data-view
git diff --unified=80 origin/fix/mcp-widget-error-display...origin/fix/mcp-fetch-graph-data-view -- apps/mcp/src/server/tools/fetch-graph-data.ts
git show origin/fix/mcp-fetch-graph-data-view:apps/mcp/src/server/tools/fetch-graph-data.ts
git show origin/fix/mcp-fetch-graph-data-view:apps/mcp/src/shared/types.ts
git show origin/fix/mcp-fetch-graph-data-view:apps/mcp/src/widget/App.tsx
git show origin/fix/mcp-fetch-graph-data-view:apps/mcp/src/widget/hooks/useViewState.ts
git show origin/fix/mcp-fetch-graph-data-view:apps/mcp/src/server/tools/memory-graph.ts
git show origin/fix/mcp-fetch-graph-data-view:apps/mcp/e2e/graph.test.ts

Result:

Static inspection confirmed `fetch-graph-data` now returns a graph `ViewMessage` shape with `view: "graph"`, `documents`, `totalCount`, and optional `containerTag`, which matches the widget dispatch path and nearby `memory-graph` tool shape.

Static inspection also found that `apps/mcp/e2e/graph.test.ts` still expects `structuredContent.pagination.limit`, while this PR no longer returns `pagination` in `structuredContent`.

Verdict

⚠️ Issues found. Static validation found a likely stale E2E expectation and structured response contract regression around structuredContent.pagination.

@ishaanxgupta ishaanxgupta changed the base branch from fix/mcp-widget-error-display to graphite-base/1194 July 3, 2026 15:46
@ishaanxgupta ishaanxgupta changed the title fix(mcp): return graph view message from fetch-graph-data DONT merge Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants