Skip to content

feat(ox-core): add multimodal attachment types, model modalities, and blob storage - #1043

Merged
hakula139 merged 2 commits into
mainfrom
feat/multimodal-phase1-core
Dec 3, 2026
Merged

hakula139 merged 2 commits into
mainfrom
feat/multimodal-phase1-core

Conversation

@hakula139

Copy link
Copy Markdown
Member

Summary

  • Add InputModality, CatalogModel::input_modalities, CatalogModel::max_attachment_bytes, and CatalogModel::supports_media_type to ox-core::catalog, and declare input_modalities = ["text", "image", "pdf"] on bundled multimodal models in crates/ox-core/catalog/models.toml.
  • Add AttachmentSource (Base64, BlobRef) and ContentBlock::Attachment to ox-core::message, and return ClientError::UnsupportedContent from the Anthropic, Google, and OpenAI wire encoders until Phase 2 implements provider attachment serialization.
  • Add a content-addressed blobs table to SessionStore in ox-core::session: append_message decodes inline base64 attachments, deduplicates them by lowercase hex SHA-256 into blobs, and persists AttachmentSource::BlobRef in messages.content; get_blob and hydrate_message retrieve and re-inline blobs on demand.
  • Add base64 (0.22) and sha2 (0.10) workspace dependencies for ox-core.

Test plan

  • cargo deny check (advisories ok, bans ok, licenses ok, sources ok)
  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo doc --no-deps
  • cargo test (all workspace unit and integration tests pass)
  • cargo llvm-cov -p ox-core --summary-only (97.21% line coverage across ox-core, 99.54% in session.rs)
  • nix develop -c run-hooks (all 20 hooks pass)

Related

… blob storage

Add Phase 1 core multimodal foundations for #279:
- Declare InputModality, input_modalities, max_attachment_bytes, and supports_media_type on CatalogModel, and mark bundled models in models.toml.
- Add AttachmentSource and ContentBlock::Attachment, returning ClientError::UnsupportedContent from wire encoders until Phase 2.
- Store deduplicated SHA-256 attachment blobs in SessionStore with get_blob and hydrate_message.
@hakula139 hakula139 added enhancement New capability area: session Touches session storage, listing, or resume labels Dec 3, 2026
@hakula139 hakula139 self-assigned this Dec 3, 2026
@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.56140% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ox-core/src/client/google.rs 96.07% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

…pe check

Address PR #1043 review findings:
- Bump SessionStore CURRENT_SCHEMA_VERSION to 2 and move blobs table creation into the v1 -> v2 migration with a regression test.
- Parse MIME type/subtype with split_once('/') and eq_ignore_ascii_case in CatalogModel::supports_media_type, rejecting empty subtypes.
- Add UnsupportedContent unit tests for Attachment blocks in the Anthropic, Google, and OpenAI wire modules.
@hakula139
hakula139 merged commit 4aec510 into main Dec 3, 2026
7 checks passed
@hakula139
hakula139 deleted the feat/multimodal-phase1-core branch December 3, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: session Touches session storage, listing, or resume enhancement New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant