Skip to content

feat(aionrs): inline image attachments for Aion CLI#589

Draft
s-yanev wants to merge 1 commit into
iOfficeAI:mainfrom
s-yanev:image-support-aion-cli
Draft

feat(aionrs): inline image attachments for Aion CLI#589
s-yanev wants to merge 1 commit into
iOfficeAI:mainfrom
s-yanev:image-support-aion-cli

Conversation

@s-yanev

@s-yanev s-yanev commented Jul 7, 2026

Copy link
Copy Markdown

Summary

This PR enables image attachments to work with the Aion CLI backend by converting attached image file paths to base64 data URIs before passing the message to the aionrs engine.

Depends on

This change requires aionrs to support image content blocks first:

Once that PR is merged and a new aionrs tag is released, this PR should be updated to point Cargo.toml to the new aionrs version.

How it works

When a user attaches an image to an Aion CLI conversation:

  1. AionUi sends content like: user text\n\n[[AION_FILES]]\n/path/to/image.png plus a files array
  2. enrich_content_with_files() reads the image, base64-encodes it, and replaces the path with data:image/png;base64,...
  3. The aionrs engine parses the marker and creates proper text + image content blocks
  4. The provider serializes those blocks into the correct OpenAI/Anthropic multimodal format

Files changed

  • crates/aionui-ai-agent/src/manager/aionrs/agent.rs
    • Added enrich_content_with_files() to inline image file paths as data URIs
  • crates/aionui-ai-agent/src/manager/aionrs/history_sanitize.rs
    • Handle ContentBlock::Image in history sanitization

Testing

  • Built locally with modified aionrs
  • Verified Aion CLI can now receive and process attached images

Convert attached image file paths to base64 data URIs before passing
the user message to the aionrs engine. This enables the Aion CLI
backend to send images to the LLM provider using the new image
content block support in aionrs.

Requires aionrs with image content block support.

- crates/aionui-ai-agent/src/manager/aionrs/agent.rs
- crates/aionui-ai-agent/src/manager/aionrs/history_sanitize.rs

Co-Authored-By: Claude <noreply@anthropic.com>
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