-
Notifications
You must be signed in to change notification settings - Fork 3k
feat: support full-turn multimodal routing for image prompts #7045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
18a93ff
feat: support full-turn multimodal routing
yiliang114 5d57f87
fix: keep full-turn multimodal routes exact
yiliang114 c6728b5
Merge remote-tracking branch 'origin/main' into codex/issue-6988-mini…
yiliang114 4e0f49a
test(cli): sync serve capabilities baseline
yiliang114 1879445
fix(cli): close multimodal routing review gaps
yiliang114 dbe2669
fix(cli): normalize full-turn vision parts
yiliang114 128eeb8
fix(cli): fail closed on full-turn scheduling errors
yiliang114 9ab4240
fix(core): close multimodal routing review gaps
yiliang114 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Full-turn multimodal routing | ||
|
|
||
| ## Scope | ||
|
|
||
| This implements Phase 1 of #6988 only: when the primary model is text-only, an explicitly agent-capable vision model may handle the complete image-bearing turn. | ||
|
|
||
| It does not add persistent route state, session recovery, durable visual summaries, stable image references, historical media cleanup, or later image reinspection. | ||
|
|
||
| ## Capability gate | ||
|
|
||
| Full-turn routing requires both image and agent capability: | ||
|
|
||
| ```json | ||
| { | ||
| "id": "vision-agent", | ||
| "capabilities": { | ||
| "vision": true, | ||
| "agent": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Missing or false `agent` capability keeps the existing Vision Bridge transcription behavior. | ||
|
|
||
| ## Routing | ||
|
|
||
| - If the primary accepts images, use the existing primary-model path. | ||
| - If the selected vision model is not agent-capable, transcribe through Vision Bridge and answer on the primary. | ||
| - If the selected vision model is agent-capable, keep the original image parts and set a turn-local exact model selector. | ||
| - The exact provider, model, and endpoint are reused for provider retries, tool execution, tool-result continuations, and blocking ACP Stop Hook continuations. | ||
| - Configured fallback models are disabled for that turn. Failure to resolve the exact route fails closed instead of sending raw image data to the primary. | ||
| - The next independent user turn clears the selector and returns to the primary. Every model request, including side queries, receives only media modalities supported by its exact target. | ||
|
|
||
| The full-turn selector adds a trailing NUL marker to the existing `model\0baseUrl` representation. The chat layer removes that marker before model resolution. This keeps ordinary endpoint-qualified model selections on their existing behavior. | ||
|
|
||
| ## Context limits | ||
|
|
||
| LLM-based automatic chat compression remains on the primary-model path. A full-turn route skips that compression because running primary-model compression while an image turn is owned by another provider would violate the exact-route guarantee. Existing local history microcompaction and image-payload slimming still apply, and request/cache copies retain only media modalities supported by their target model. An oversized full-turn request therefore fails on the selected model. | ||
|
|
||
| ## Entry points | ||
|
|
||
| Phase 1 covers the interactive TUI and ACP. Non-interactive routing is intentionally unchanged until it has an equivalent turn-local lifecycle. |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.