Skip to content

feat(sdk-playground): reflect SDK-owned memory block in debug view - #1533

Open
Dhravya wants to merge 1 commit into
sdk-dedup/pythonfrom
sdk-dedup/playground
Open

feat(sdk-playground): reflect SDK-owned memory block in debug view#1533
Dhravya wants to merge 1 commit into
sdk-dedup/pythonfrom
sdk-dedup/playground

Conversation

@Dhravya

@Dhravya Dhravya commented Aug 18, 2026

Copy link
Copy Markdown
Member

Stack Context

Part 3 (top) of a 3-PR stack moving memory deduplication into the SDKs. See sdk-dedup/tools-ts for full context.

What?

Update the SDK playground so its debug view reflects the SDK-owned memory block.

  • Displays the current deduplicated <supermemory> replacement block produced by the SDK middleware, instead of the old browser-side "seen facts" delta.
  • Adds a memory-dedupe helper and ignores local *.tsbuildinfo.

Why?

The previous debug cards were misleading — they showed an incremental browser-filtered delta while the middleware actually re-injected the full profile. Now the visualization matches what the SDK really sends.

🤖 Generated with Claude Code


Note

Low Risk
Playground-only visualization and chat gating changes; no production SDK or API behavior.

Overview
The playground debug trace now shows the deduplicated memory block the SDK middleware would inject (static → dynamic → search, mode-aware), instead of a misleading browser-side “new facts” delta. A new memory-dedupe helper mirrors @supermemory/tools middleware behavior and is applied when fetching container context and building middleware memory debug entries; the context preview card is relabeled to reflect that each turn replaces the prior <supermemory> block.

Chat UX: messaging is enabled when API keys are configured on the server (hasSupermemoryKey / hasOpenAiKey from /api/chat), not only when keys are typed in the panel. The message input stays editable while waiting for text; Send still requires non-empty input.

Also ignores *.tsbuildinfo in .gitignore.

Reviewed by Cursor Bugbot for commit ed15364. Bugbot is set up for automated code reviews on this repo. Configure here.

Update the playground to display the current deduplicated <supermemory>
replacement block produced by the SDK middleware instead of a browser-side
seen-facts delta. Add memory-dedupe helper and ignore local tsbuildinfo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown

Claude finished @Dhravya's task in 2m 6s —— View job


Review Complete

  • Fetch PR diff and existing review comments
  • Read changed files for full context
  • Analyze for bugs, security issues, and logic errors
  • Submit review

Overview: Adds a memory deduplication helper and updates the SDK playground debug view to show the actual deduplicated memory block that the SDK middleware sends.

Issues found: None — this looks good to ship.

The implementation is clean:

  • dedupeProfileForMode correctly implements static → dynamic → search priority deduplication with case-insensitive normalization
  • The chatReady logic properly allows chat when either user-entered keys OR server env keys are present
  • The debug view now accurately reflects what the SDK middleware actually injects

Score: 10/10

Dhravya commented Aug 18, 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 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: Adds a memory deduplication helper and updates the SDK playground debug view to show the actual deduplicated memory block that the SDK middleware sends.

Issues found: None — this looks good to ship.

The implementation is clean:

  • dedupeProfileForMode correctly implements static → dynamic → search priority deduplication with case-insensitive normalization
  • The chatReady logic properly allows chat when either user-entered keys OR server env keys are present
  • The debug view now accurately reflects what the SDK middleware actually injects

Score: 10/10

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ed15364. Configure here.

dynamic: profileRaw?.dynamic ?? [],
searchResults: normalizeSearchResults(profileResponse.searchResults),
},
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wrong-mode double dedupe

Medium Severity

fetchContainerContext always runs dedupeProfileForMode with "full" or "profile" based only on whether a query string is present, then buildMiddlewareMemoryDebug dedupes again with the real memoryMode. For "query" mode that first pass treats overlapping search hits as profile duplicates and drops them, so the debug preview no longer matches what the SDK middleware injects.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ed15364. Configure here.

@cloudflare-workers-and-pages

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 successful!
View logs
supermemory-mcp ed15364 Aug 18 2026, 03:18 PM

@cloudflare-workers-and-pages

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 ed15364 Commit Preview URL

Branch Preview URL
Aug 18 2026, 03:21 PM

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