fix: Protect against large files#1241
Conversation
dawsontoth
commented
Jun 11, 2026
``` Failed to execute 'postMessage' on 'Worker': Data cannot be cloned, out of memory. DataCloneError: Failed to execute 'postMessage' on 'Worker': Data cannot be cloned, out of memory. ```
There was a problem hiding this comment.
Code Review
This pull request introduces a file size limit (MAX_WORKER_MODEL_CHARS set to 512 KB) for Monaco editor models and language worker registration. Files exceeding this limit are rendered as plaintext and skipped during type intelligence processing to prevent out-of-memory errors and performance degradation in the language worker. Feedback suggests combining consecutive .filter() calls in useApplicationTypeIntelligence.ts into a single filter to optimize performance and readability.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Address PR review: combine the two .filter() passes over the loaded source files into one so we don't iterate twice or build an intermediate array. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>