feat(sdk-playground): reflect SDK-owned memory block in debug view - #1533
feat(sdk-playground): reflect SDK-owned memory block in debug view#1533Dhravya wants to merge 2 commits into
Conversation
|
Claude finished @ved015's task in 2m 2s —— View job Review Complete
Overview: Updates the SDK playground debug view to show the actual deduplicated memory block the SDK middleware injects, replacing the old misleading browser-side delta visualization. Issues found: None — this looks good to ship. Re: Cursor Bugbot's "double dedupe" concern: This is a false positive. The two code paths are separate:
The implementation is correct:
Score: 10/10 |
There was a problem hiding this comment.
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:
dedupeProfileForModecorrectly implements static → dynamic → search priority deduplication with case-insensitive normalization- The
chatReadylogic 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
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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), | ||
| }, | ||
| ) |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit ed15364. Configure here.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | 5d1f557 | Aug 24 2026, 06:11 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | 5d1f557 | Commit Preview URL Branch Preview URL |
Aug 24 2026, 06:13 PM |
42f308b to
8de27af
Compare
ed15364 to
5243a43
Compare
There was a problem hiding this comment.
Overview: Adds a dedupeProfileForMode helper to the SDK playground and updates the debug view to show the actual deduplicated memory block the SDK middleware sends.
Issues found: None — this looks good to ship.
Re: Cursor Bugbot's "double dedupe" concern: This is a false positive. The two call sites are in separate code paths:
fetchContainerContextis used by the/api/contextendpoint for UI displaybuildMiddlewareMemoryDebugcallsfetchProfileContextdirectly (line 236-241), notfetchContainerContext, so it gets fresh raw data and dedupes once with the correctmemoryMode
The implementation is correct:
dedupeProfileForModecorrectly implements static → dynamic → search priority deduplicationnormalizeFactKeyproperly normalizes text by stripping date/recent prefixes and normalizing whitespace- Mode handling is accurate: "query" keeps only search results, "profile" clears search results, "full" keeps all
Score: 10/10
5243a43 to
2d03036
Compare
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>
a46eba5 to
5d1f557
Compare



Stack Context
Part 3 (top) of a 3-PR stack moving memory deduplication into the SDKs. See
sdk-dedup/tools-tsfor full context.What?
Update the SDK playground so its debug view reflects the SDK-owned memory block.
<supermemory>replacement block produced by the SDK middleware, instead of the old browser-side "seen facts" delta.memory-dedupehelper 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-dedupehelper mirrors@supermemory/toolsmiddleware 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/hasOpenAiKeyfrom/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
*.tsbuildinfoin.gitignore.Reviewed by Cursor Bugbot for commit ed15364. Bugbot is set up for automated code reviews on this repo. Configure here.