- Function was only used in tests, not in production code
- Dual-storage approach (images + imagesBase64) eliminated need for base64→file conversion
- Removed ~60 lines of function code + ~90 lines of tests
- Simplified imageDataUrl module to focus on production use case
- Kept normalizeImageRefsToDataUrls which is used in production (Task.ts)
- Function is now primarily used for testing
- Production code uses dual-storage (images + imagesBase64)
- Removed redundant cache since same hash always produces same file path
- Simplified implementation and removed obsolete test
- Add imagesBase64 field to ClineMessage schema for efficient dual storage
- Store both webview URIs (for display) and base64 (for API) when creating messages
- Remove repeated base64→file→URI conversions on every render
- Update all tools to use base64 from stored messages for API calls
- Eliminates file I/O overhead during rendering and message updates
- Improves performance by storing each format once instead of converting repeatedly
Add test coverage for HTTPS CDN URL conversion (e.g., https://file+.vscode-resource.vscode-cdn.net/...) to base64 data URLs. This covers the critical URI-to-base64 conversion flow that was previously only tested with legacy file:// URIs.
- Remove file:// URI handling from webviewUriToFilePath (legacy support no longer needed)
- Update tests to reflect modern CDN-style URIs only
- Use MAX_IMAGE_BYTES and estimateBytesFromBase64DataUrl from webview-ui/src/utils/image.ts in ChatTextArea for consistent 10MB enforcement
Fixes knip unused export error and test failure
UI: early-reject >10MB in ChatTextArea paste/drop handlers. Backend: validate >10MB in savePastedImageToTemp(). Cache base64 mapped to file path and consume in normalizeImageRefsToDataUrls() to avoid re-encoding UI-pasted images.
Use /^[^?#]*\/(?:Users|home|root|var|tmp|opt)\/[^?#]{1,300}\.(png|jpg|jpeg|gif|webp)$/i to support Linux/macOS while keeping bounds and avoiding backtracking.
ClineProvider.convertToWebviewUri: align JSDoc with non-throwing behavior and fallback to file URI.
imageDataUrl.webviewUriToFilePath: remove impossible CDN host check from vscode-resource branch; expand Windows path regex to allow spaces while keeping bounds.
ChatTextArea: clear pendingImageUploadsRef via captured ref in cleanup to avoid stale closure.
- Remove unnecessary memory caching logic
- Store base64 data URLs directly in ClineMessage.images[] and ApiMessage content when first received
- Eliminate conversion overhead at API call time (base64 already available)
- Keep frontend memory efficient with webview URIs for display
- Much simpler and more efficient than caching approach
- One-time conversion: webview URI → base64 when storing in backend
- API calls use pre-stored base64 directly (no file I/O or conversion needed)
This achieves PR goals with optimal performance: frontend memory efficiency + instant API calls
- Add normalizeImageRefsToDataUrls() function to convert webview URIs to base64 data URLs
- Add formatImagesIntoBlocksAsync() for async image processing in backend
- Update Task.ts to use async conversion when storing images in backend messages
- Backend now stores base64 (for API calls), frontend displays webview URIs (memory efficient)
- Fixes OpenRouter and other providers not being able to see attached images
- Maintains PR goals: webview memory efficiency + working image functionality
* feat: add telemetry tracking to DismissibleUpsell component
- Added UPSELL_DISMISSED and UPSELL_CLICKED events to TelemetryEventName enum
- Updated DismissibleUpsell component to track clicks and dismissals with telemetry
- Added telemetry tests to DismissibleUpsell test suite
- Events include upsellId in the payload for tracking specific upsells
* refactor(webview): make handleDismiss synchronous in DismissibleUpsell
test(webview): add scenario where dismissOnClick=true without onClick tracks only UPSELL_DISMISSED; update tests; all tests passing locally
---------
Co-authored-by: Roo Code <roomote@roocode.com>
- Fixed CodeQL security issue by properly validating vscode-cdn.net domain instead of substring check
- Added missing copy action check for HTTPS/vscode-cdn URLs before opening image
- Updated tests to match the more secure URL validation logic