Conversation
Move AISnapshotStore content from unbounded in-memory _contentStore to disk-backed storage under <appSupportDir>/instanceData/<instanceId>/aiSnap/. Content stays in _memoryBuffer during an AI turn and flushes to disk at finalizeResponse() time. Reads check memory first, then fall back to disk. Add per-instance heartbeat (60s interval) and garbage collection that removes stale instance directories (>20 min without heartbeat) on startup.
Add integration tests covering snapshot data consistency: content- addressable dedup, snapshot building/back-fill, multi-response restore, file creation/deletion flows, and reset behavior. Expose AISnapshotStore via brackets.test for test window access.
Store raw content in _readFiles instead of eagerly hashing on every recordFileRead call. Content is only hashed when promoted to a snapshot (on FS delete/rename), saving CPU and memory for the common read-only case. Also fixes three resilience issues: - _readContent: use hasOwnProperty for _memoryBuffer lookup so empty string content is not missed by the falsy check - _closeAndDeleteFile: treat "file already gone" as success instead of rejecting, so restores don't report spurious errors - _createOrUpdateFile: await CMD_OPEN completion before resolving to prevent race conditions with subsequent restore operations
Extract ~42 hardcoded English strings from AIChatPanel.js into src/nls/root/strings.js using AI_CHAT_* keys. Replace all in-code literals with Strings.* constants and StringUtils.format() for parameterized text. Fix a locale-sensitive bug where the Undo button click handler compared $(this).text() against English "Undo" — now uses data-action attributes instead. Pass brackets.getLocale() to the Claude agent so non-English users get responses in their display language. Add i18n guidance section to CLAUDE.md.
When a tool (e.g. Write) streams slowly, the "receiving N bytes..." preview would freeze. After 2s of no updates, rotate through "Working...", "Writing...", "Processing..." every 3s so the user sees the operation is still in progress. Timers are cleaned up when tool info arrives.
Fix race condition in expectFileDeleted test helper where fileExists() was fired on every awaitsFor poll but the result was checked before the promise resolved, causing one-poll-behind behavior and timeouts. Make _createOrUpdateFile resilient to stale FileSystem cache: when file.exists() returns true but getDocumentForPath fails (e.g. after a delete+recreate cycle), fall back to creating the file on disk and retry.
Two root causes identified and fixed: 1. expectFileDeleted used file.exists() which checks the _stat cache. After unlink, _handleDirectoryChange re-reads the parent dir and can repopulate _stat on the deleted File object from a racing readdir. Switch to FileSystem.existsAsync() which bypasses the cached _stat and goes directly to the impl. 2. _createOrUpdateFile could fail with NotFound when file.exists() returned stale true after a delete+recreate cycle. Add fallback: if getDocumentForPath fails, create the file on disk and retry.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.