Skip to content

fix(chat): optimize image sending stability#983

Merged
hazeone merged 4 commits intomainfrom
fix/optimize_sending_pic_stable
May 7, 2026
Merged

fix(chat): optimize image sending stability#983
hazeone merged 4 commits intomainfrom
fix/optimize_sending_pic_stable

Conversation

@hazeone
Copy link
Copy Markdown
Contributor

@hazeone hazeone commented May 7, 2026

Summary

ClawX sends image with failure. The response bubble occurs "Media: XXXX.png".
 

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other

Validation

Checklist

  • I ran relevant checks/tests locally.
  • I updated docs if behavior or interfaces changed.
  • I verified there are no unrelated changes in this PR.

hazeone added 4 commits May 7, 2026 10:47
…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.
@hazeone hazeone merged commit 9ada49a into main May 7, 2026
6 checks passed
@hazeone hazeone deleted the fix/optimize_sending_pic_stable branch May 7, 2026 02:57
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