fix(chat): optimize image sending stability#983
Merged
Conversation
…and enhance file handling in chat messages - Implemented `resolveOutgoingMediaUrl` to map Gateway URLs to local file paths. - Updated file handling in `handleFileRoutes` and IPC handlers to support both local file paths and Gateway URLs. - Enhanced attachment visibility in chat messages to ensure images remain visible alongside text, even when process attachments are suppressed. - Adjusted regex for extracting file paths to accommodate filenames with ASCII spaces. - Updated types to include `gatewayUrl` for better integration with Gateway-injected media.
… in chat messages - Enhanced the filtering of image files to exclude non-user-facing artifacts from tool results. - Updated logic to deduplicate image references when a subsequent assistant message contains a Gateway-injected media bubble. - Preserved existing attached files when no new attachments are found, ensuring better management of message content. - Clarified comments to improve code readability and understanding of the attachment process.
…ath extraction tests - Translated assistant messages in chat tests from Chinese to English for consistency. - Improved test cases for extracting file paths to handle both ASCII and non-ASCII filenames correctly. - Clarified comments in the tests to better explain the purpose and expected behavior of the regex used for path extraction.
- Added support for recognizing `MEDIA:` prefixes in file paths to ensure proper attachment of artifacts. - Improved regex for extracting file paths to handle tagged media references and prevent double-counting. - Updated `isInternalMessage` function to filter out specific fallback messages from the UI, enhancing user experience. - Refactored logic in `useChatStore` to improve event processing and prevent unnecessary returns. - Added unit tests to verify the attachment of Gateway media entries to assistant messages.
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.
Summary
ClawX sends image with failure. The response bubble occurs "Media: XXXX.png".
Type of Change
Validation
Checklist