Skip to content

feat: convert CAF audio and GIF attachments for model compatibility#73

Closed
mfzeidan wants to merge 1 commit into
openclaw:mainfrom
mfzeidan:main
Closed

feat: convert CAF audio and GIF attachments for model compatibility#73
mfzeidan wants to merge 1 commit into
openclaw:mainfrom
mfzeidan:main

Conversation

@mfzeidan
Copy link
Copy Markdown
Contributor

iMessage voice messages use Opus-in-CAF format which isn't supported by OpenAI Whisper. GIF images aren't accepted by all model APIs (e.g. xAI). This adds ffmpeg-based conversion: .caf→.m4a for audio, .gif→.png (first frame) for images. Converted files are cached alongside originals.

iMessage voice messages use Opus-in-CAF format which isn't supported by
OpenAI Whisper. GIF images aren't accepted by all model APIs (e.g. xAI).
This adds ffmpeg-based conversion: .caf→.m4a for audio, .gif→.png
(first frame) for images. Converted files are cached alongside originals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@steipete
Copy link
Copy Markdown
Collaborator

steipete commented May 4, 2026

Thanks @mfzeidan. I landed a maintainer rewrite on main in 8dcb9d0 and credited you in the commit/changelog.

The PR was directionally right, but I did not merge it as-is because current main has a batched attachment metadata path that the PR missed, it hardcoded /opt/homebrew/bin/ffmpeg, converted as a side effect of normal metadata reads, and replaced the meaning of original_path with the converted file path.

The landed version keeps conversion opt-in via --convert-attachments / RPC convert_attachments, finds ffmpeg from PATH plus common Homebrew locations, caches converted files outside the Messages attachment directory, keeps original_path stable, and reports converted_path / converted_mime_type separately for CAF→M4A and GIF→PNG conversions.

Proof: local make lint, make test (177 tests), make build, git diff --check; GitHub CI is green on 8dcb9d0 (run 25309469864). Closing this PR as superseded by main.

@steipete steipete closed this May 4, 2026
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.

2 participants