Preserve image inputs across configured model routes - #1577
Open
lihongguang-0014 wants to merge 8 commits into
Open
Preserve image inputs across configured model routes#1577lihongguang-0014 wants to merge 8 commits into
lihongguang-0014 wants to merge 8 commits into
Conversation
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.
Scope
Scope boundary: Preserve canonical image attachments while projecting each physical request according to the configured deployment's image capability.
Non-goals: New providers, unconfigured model fallback, OCR services, image generation, and changes to unrelated routing strategies.
Branch
Base branch: main
Target exception: N/A
Issue
Linked issue: None
If None, reason: User-requested multimodal routing and multi-turn attachment handling feature.
Release Note
Release note: Images now remain available across model switches and context compaction. Configured text-only routes continue with explicit markers instead of failing the whole turn or selecting an unconfigured vision model.
Tests
Ruff:
uv run ruff check src testspassed.Pytest: 3,274 passed, 5 skipped across provider, routing, image history, turn-runner, session/compaction, onboarding, gateway, and attachment functional regression suites. Follow-up runs passed: 121 routing tests, 94 session-wire/gateway-history tests, 119 history/ownership/attachment tests, 28 historical replay tests, and 146 live-profile harness/CI-governance tests (1 skipped). These batches overlap and are not an aggregate unique-test count.
Automatic-capability follow-up: 1,608 backend tests passed (4 skipped) across image guards/history, ownership, turn-runner, onboarding, and desktop integration contracts; 485 routing/capability/gateway/functional tests passed; 337 catalog/mutation tests passed; 287 catalog-refresh/compatibility tests passed (1 skipped); all 100 offline gateway-harness tests passed. These batches overlap.
Build: All 5,512 WebUI unit tests passed across 432 files with two workers. WebUI typecheck, architecture/security/i18n guards, and production build passed. Mypy passed for the affected core modules, including all five modules changed by automatic-capability follow-up. Desktop TypeScript build and router-tier normalization passed.
Regression tests: added
Settings-row follow-up: All 700 setup component/composable tests passed across 19 files. Full WebUI typecheck and production build passed; the rebuilt browser settings table was verified to display only C0-C3, with no image-model row. This follow-up changes presentation only and does not remove stored configuration or change auxiliary media-tool routing.
Notes: Independent subagent reviews covered routing, history recovery, and integration with current main. Session reset/epoch regressions include real SQLite races and a red/green check of the retired-owner pipeline boundary.
CI follow-up: Registered the four new test modules in the existing shard inventory without relaxing budgets. Updated the offline gateway harness to configure its vision route explicitly, reference intended historical attachments, and retain current main's incomplete-stream transport classification.
The default test path remains offline, deterministic, credential-free, and safe for forks.
Maintainer Live Check
Maintainer live check: yes
Surface: provider | browser | gateway
Maintainer-only note: Completed isolated browser/gateway smoke tests using already-configured deployments and a public repository image. The original user configuration was not changed. Contributors are not expected to provide secrets or run credentialed live checks.
The smoke tests exposed and verified the candidate-display and replay-context fixes above. The rebuilt routing settings page was subsequently verified to have no image column or switch and to explain automatic capability resolution. A final live Router check retained a legacy false image flag on the configured vision tier: Router still selected that deployment from catalog evidence, sent three native historical image blocks, and returned a matching visual description without reuploading. Compaction, forks, unknown-capability rejection, and ownership races were validated by deterministic tests rather than manually forced live checks.
Safety
No secrets, local-only artifacts, private prompts/transcripts, channel identifiers, AI session artifacts, non-public fixtures, or tests/_private/ contents are included. The isolated live-test profile is outside the repository.
Compatibility: Legacy tier capability flags and the image-model row remain accepted; retired flags no longer change runtime capability or semantic preset ownership. Low-level model-catalog overrides retain their existing contract. No database migration is required. The policy change is platform-neutral; both web and desktop share the updated settings table and desktop serialization is covered independently.
Third-Party Origin
Third-party origin: none
Documentation Changes