Repository navigation
Forward image tool results through the Genkit adapter - #2338
Merged
Merged
Conversation
Contributor
|
Chat app preview removed for |
This was referenced Nov 26, 2026
leehack
added a commit
that referenced
this pull request
Nov 27, 2026
## Summary - Supersedes #2345 after the prerequisite in #2344 merged into `main`. - Prepare genkit_llamadart 3.13.0 with `>=0.21.0 <0.23.0`. - Collect the package release notes for the image tool-result support merged in #2338. ## Changelog - [packages/genkit_llamadart] Support llamadart 0.22.x alongside 0.21.x. - [packages/genkit_llamadart] Forward image tool results to the next model turn on qualified native llama.cpp vision templates. ## Production-readiness scope - User-facing scope — Package dependency resolution on the 0.21.x and 0.22.x core series. The release includes the image tool-result support from #2338. - Supported paths — Qualified native llama.cpp vision templates for image tool results. Dependency resolution validated against hosted core 0.21.0 and 0.22.0. - Unsupported paths — Audio tool results and unsupported runtimes return `UNIMPLEMENTED`. - Follow-up — Independent audit and the owner’s release approval under #2337. The feature is tracked in #1212. ## Completeness checklist - [x] Two-file prep scope verified against the prerequisite. - [x] Package changelog records the compatibility and image tool-result changes. - [x] Hosted compatibility exercised at each core version. Runtime regressions and public capability evidence were covered by #2338. - [x] Checked the diff for sensitive output or data handling. N/A for new API, examples, runtime code, and capability registry entries. ## PR type guidance - Independent Genkit release prep. The package manifest and changelog are the only changed files. ## Test Plan - [x] `dart run tool/prepare_workspace.dart` on the clean worktree - [x] Package `dart analyze --fatal-infos` and `dart test -x real-model` with hosted llamadart 0.21.0 and 0.22.0, using the repository fixture layout - [x] Package docs and checker tests - [x] Root release-docs verifier in normal and `--release-prep` modes - [x] Root Genkit floor, release-routing and staging tests - [x] Standalone `dart pub publish --dry-run` with hosted llamadart 0.22.0 - N/A for full root VM, Chrome, coverage and new model qualification. The prep changes release metadata and dependency constraints. See #2338 for the feature’s runtime verification. ## Matrix Evidence | Matrix row | Scope covered | Platform / model / backend | Result | Evidence / notes | | --- | --- | --- | --- | --- | | genkit-contracts | Hosted 0.21.0 and 0.22.0 dependencies | macOS / model-free | Pass | 508 tests per version, fatal-info analysis, exact hosted lockfile and package config on each version | | genkit-release | Standalone publish dry-run, release docs, routing and staging | macOS / model-free | Pass | 0 publish dry-run warnings, two release-doc verifier modes and 13 root tooling tests | | genkit-native-cpu | Image tool-result runtime | N/A for release prep | N/A | Feature evidence is recorded in #2338 | ## Review Notes - Independent review — Pending at the draft head. - CI status / head SHA — Head `55d36534e14b0e586dee2f1045e85e0bc1622be5` targets `main`. The cherry-pick has the same Git tree as validated head `207ef23cf1ac90e7be812121afb311bd11d71c4d`. The local validation above applies to those identical files. Hosted checks and the independent audit are pending at the new head. ## High-risk regression review - Classification — high-risk, artifactConsumer - Implementation task — Genkit 3.13.0 release prep under #2337 - Independent blocking QA task — Pending coordinator handoff - Exact head / current base — `55d36534e14b0e586dee2f1045e85e0bc1622be5` / `90c6ed0b3433cf4b0ffaa87fe1015b03b6907739` - Production-branch deletion, bypass, or miswire proof — Pending independent QA. The prerequisite demonstrates the floor checks reject incorrect and malformed constraints. - Affected-family real-model/artifact evidence — Hosted core 0.21.0 and 0.22.0 used for the package contract suite. The source feature’s qualified template evidence is in #2338. - Explicit unavailable-family or other N/A evidence — The release prep only adjusts package metadata and the core dependency range. - Known PR-caused P1 regressions — 0 found in local validation. Independent audit pending. - Unresolved review threads — Pending hosted verification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MediaPartvalues in tool results toLlamaToolResultContent.content(ordered with text parts;resultis null sooutputstays Genkit-history-only, as with text). Text-only results keep their joined form.LlamaEngineCapabilities.toolResultMedia(image/audio), so an unsupported runtime/template/backend failsUNIMPLEMENTEDbefore the next model turn. Thinking-budget/speculation guards and usage counts now include tool-result media.LlamaDartMediaResolver(same limits, cancellation, sanitized errors); without one they are rejected with a redactedINVALID_ARGUMENT. Audio, resource, data, video, PDF and other non-image parts failUNIMPLEMENTED(remote audio and non-image remote media are never fetched); malformed image data URLs and remote images without a resolver stayINVALID_ARGUMENT.genkit_llamadart_tool_media_example.dart, docs/skill/README/CONTRIBUTING updates, opt-in real-model test.genkit_llamadartis independently versioned: this adds only an## Unreleasedentry; no pubspec bump and no release prep (3.13.0 is left for a separate two-file prep PR).Changelog
MediaPartvalues in Genkit tool results to the next model turn on native llama.cpp vision models with a qualified template, and reject audio and unsupported runtimes withUNIMPLEMENTED.Production-readiness scope
file://,data:and resolver-fetched HTTP(S) images.UNIMPLEMENTEDbefore the next model call (redacted); remote images without a resolver:INVALID_ARGUMENT.Completeness checklist
PR type guidance
Test Plan
From
packages/genkit_llamadart(Flutter 3.47.1 SDK):dart format --output=none --set-exit-if-changed .;dart analyze --fatal-infos;python3 .github/check_docs.pydart test -x real-model: 504 pass, hosted llamadart 0.21.0 (lower bound) and checkout-core overridedart test -p chromeon converter/media/remote-media suites: 128 passdart pub publish --dry-run: 0 warningspython3 tool/ci/check_format.pyMatrix Evidence
genkit-contractsgenkit-native-cpu089d75c5…ca6c2ae, rev52d6c8ff…eb503) + F16 mmproj (c3d5afbe…6aea5), 2 threadsreal_model_tool_result_media_test.dart; also passes on Qwen3.5-0.8B + Qwen3-VL template; hosted 0.21.0 and checkout coretool-result-image-smokegenkit_llamadart_tool_media_example.dartwith the Qwen3-VL pair and a red PNGMutation checks (10 mutants: result non-null, reversed order, no remote rejection, no image/audio capability check, no resolver collection, no nested replacement, dropped text, top-level-only media for guards/usage) are all killed; the new tests fail against the base
lib/.Review Notes
High-risk regression review
lib/files fails 10 new tests; mutants aboveDelta (audit B1 fix, 2ac130c): non-image tool-result media now fails
UNIMPLEMENTEDregardless of resolver config; the resolver queues onlyimage/*tool-result media. Rejected-case tests assertStatusCode; they fail against 12c5334 (8 failures) and 4 delta mutants are killed. Packagedart test -x real-model508 pass, Chrome suites 174 pass, analyze/format/check_docs clean. Docs note that tool-returned local paths are read as given.