Skip to content

v0.6.65: memory fix, image uploads in files#4422

Merged
waleedlatif1 merged 3 commits intomainfrom
staging
May 3, 2026
Merged

v0.6.65: memory fix, image uploads in files#4422
waleedlatif1 merged 3 commits intomainfrom
staging

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@waleedlatif1 waleedlatif1 commented May 3, 2026

…ET (#4421)

* fix(memory): return 200 with null data when memory key not found on GET

* test(memory): add null-data path test for memory_get transformResponse
* feat(files): allow image uploads in workspace files

* fix(files): include images in workspace type filter

* fix(files): match all image mime types in image filter
@vercel
Copy link
Copy Markdown

vercel Bot commented May 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 3, 2026 10:32am

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 3, 2026

PR Summary

Medium Risk
Changes the GET /api/memory/:id contract to return 200 with data: null instead of 404, which can affect client logic expecting errors. File upload/validation changes expand allowed types (images) and could expose edge cases in MIME/extension handling.

Overview
Updates GET /api/memory/[id] so a missing memory key returns 200 with { success: true, data: null } rather than a 404 error, and adds a matching test to ensure tool response parsing yields an empty memories array.

Extends workspace Files to support image uploads by adding SUPPORTED_IMAGE_EXTENSIONS (and additional image MIME types), including images in the file input accept list, and adding Images to file type labeling and filtering UI.

Reviewed by Cursor Bugbot for commit 14c93f6. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 3, 2026

Greptile Summary

This PR bundles two small improvements: the memory GET route now returns 200 with { success: true, data: null } instead of 404 when a key is not found, aligning the API contract with what transformResponse already expected; and workspace file uploads now support image formats by exporting SUPPORTED_IMAGE_EXTENSIONS from the validation module and wiring it through the files UI. Both changes are straightforward, well-tested, and low-risk.

Confidence Score: 4/5

Safe to merge — both changes are targeted fixes with no breaking behavior.

Only P2 findings: a missing image branch in getSupportedMimeTypes (exported but unused for images) and an inline MIME check inconsistent with the audio/video pattern. No correctness or security regressions introduced.

apps/sim/lib/uploads/utils/validation.ts — getSupportedMimeTypes does not handle the newly exported image extensions.

Important Files Changed

Filename Overview
apps/sim/app/api/memory/[id]/route.ts Changed GET to return 200 with null data instead of 404 when memory key not found, aligning with the tool's transformResponse behavior.
apps/sim/tools/memory/get.test.ts Adds test coverage for the null-data 200 response, verifying that transformResponse returns empty memories array correctly.
apps/sim/lib/uploads/utils/validation.ts Exports SUPPORTED_IMAGE_EXTENSIONS constant and expands image MIME types; replaces the old private dot-prefixed array with a shared typed constant. getSupportedMimeTypes does not handle image extensions but is not currently called with them.
apps/sim/app/workspace/[workspaceId]/files/files.tsx Adds image upload support to workspace files: imports SUPPORTED_IMAGE_EXTENSIONS, adds image to type filter, and updates display labels. Image filtering uses inline startsWith check rather than a dedicated helper.

Comments Outside Diff (1)

  1. apps/sim/lib/uploads/utils/validation.ts, line 275-279 (link)

    P2 The getSupportedMimeTypes utility now implicitly covers image extensions (via SupportedMediaExtension) but returns an empty array for any image extension, silently failing. Adding an image branch keeps the function consistent and prevents future callers from getting unexpected empty results.

Reviews (1): Last reviewed commit: "feat(files): allow image uploads in work..." | Re-trigger Greptile

Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 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 14c93f6. Configure here.

Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx
* fix(files): align upload route image extensions with picker

* fix(files): widen image mime mapping for chat/profile/logo uploads

* fix(files): fall back to extension when MIME is generic for image-only uploads

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

* fix(files): add new image extensions to EXTENSION_TO_MIME map

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

* fix(files): skip non-Claude image MIMEs in createFileContent

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

* fix(files): resolve content type for image-only contexts when MIME is generic

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

* fix(files): cover image/jpg in Claude gate, reverse MIME map, audit metadata

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

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 merged commit 5be12f8 into main May 3, 2026
19 checks passed
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.

1 participant