Skip to content

feat(provider): accept image parts in chat messages (vision on the wire) - #498

Merged
ajianaz merged 2 commits into
developfrom
feat/vision-input
Nov 3, 2026
Merged

ajianaz merged 2 commits into
developfrom
feat/vision-input

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

What (description of the change)

Image input on the chat wire (#212): --image <path|data:…;base64,…> (repeatable) on run, chat and mission, attached to the first message/turn. Embedders get turn::run_turn_with_images. The OpenAI wire sends text + image_url content parts. Rules: png/jpeg/gif/webp detected from file bytes, 10 MiB cap; paths are canonicalise-jail-checked (../symlink escapes refused loudly); inline images spill to <codecora home>/tole/images/. The session log stores only a reference (payload.images: path, mime, bytes, fnv1a64 hash); each request reloads the file and re-checks the jail and hash, so resume keeps working — a changed or missing file reaches the model as an [image unavailable: …] note instead of being dropped. TOLE_VISION=0 fails before any request with a model-capability error; a 400/415/422 whose body names image/vision/multimodal maps to the same error. Docs: README image section + TOLE_VISION, epics, CHANGELOG.

Why (the problem you're solving)

Closes #212. The fleet model is multimodal; tole could not carry an image on the wire.

Testing (how you verified this works)

  • RED: tests/image_input.rs failed to compile before the implementation (run_turn_with_images, with_image_roots, with_vision absent). GREEN: 2 integration tests (reference-only logging + replay to a wire image part; the non-vision capability error), 5 image module unit tests, and 2 wire tests in openai.rs (missing file -> note; rejecting server -> capability error).
  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace --no-fail-fast (972 passed / 0 failed), cargo test -p tole-core --no-default-features (392 passed / 0 failed), cargo build -p tole-cli --no-default-features: all pass. cora pre-commit: "No issues found".
  • Decisions: FNV-1a 64 for the change-detection hash (no new crypto dependency); image roots (workspace + spill dir) fixed once at startup in a OnceLock so provider signatures are unchanged and resumed sessions can reload; TOLE_VISION is env-only (no config key); base64 added to tole-core (already in the lockfile).
  • Scope notes / deferred: no prompt-text path scanning (implicit file reads would surprise users — say the word if wanted); image input on ACP/serve/MCP faces not included; mission images attach to the first turn only; no dedicated image line in the unattended ops: budget tiers bound to trust + mission cost report #201 cost report.
  • UNVERIFIED: a real vision-model round trip (no live model/key in this environment) and the "image rejected" error-string match against real provider phrasings (mock-tested only).

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

Comment thread docs/epics.md Outdated
(#437); command-level allow/deny patterns for `run_command` (#438); global session
index and `sessions --all`, `resume` names the owning project's command (#439);
context compaction for `chat`, `resume` and `mission` (#440), its overflow recovery
<<<<<<< HEAD
@ajianaz
ajianaz merged commit 210d861 into develop Nov 3, 2026
16 checks passed
@ajianaz
ajianaz deleted the feat/vision-input branch November 3, 2026 15:01
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.

multimodal input: images in chat (vision parts on the wire)

2 participants