fix(models): route image input by preset capability (#6651)
* fix(providers): preserve images across retries and recovery Remove destructive text-only retries and validate tool image media at the boundary. Keep image identity across native transport preparation and compaction, and stop incomplete fallback or continuation without replaying tools. Resolves NAN-442 * fix(models): route image input by preset capability Replace the expanded image recovery and tool-format changes with an explicit supportsImages preset setting, capability-aware fallback selection, and an Image input switch in model settings. Keep original messages on retry and fail on actual non-transient image errors. * docs(models): introduce image input settings positively * test(agent): align image request fixtures with preset routing Cover successful image requests and direct validation errors when attributing model responses. Configure the image-capability check for the existing text-only provider mocks so governance and override-reuse tests exercise their scripted primary/fallback paths.
This commit is contained in:
1 parent
6a24b17629
commit
3f65a8f86c
36 files changed
+483
-444
No files matched your search
@@ -1417,7 +1417,7 @@ export async function fetchSidebarState(
|
||||
function modelGenerationSettingsPayload(
|
||||
configuration: Pick<
|
||||
ModelConfigurationCreate,
|
||||
"maxTokens" | "contextWindowTokens" | "temperature" | "reasoningEffort" | "api" | "extraHeaders" | "extraQuery" | "extraBody"
|
||||
"maxTokens" | "contextWindowTokens" | "temperature" | "reasoningEffort" | "supportsImages" | "api" | "extraHeaders" | "extraQuery" | "extraBody"
|
||||
>,
|
||||
): Record<string, unknown> {
|
||||
const payload: Record<string, unknown> = {};
|
||||
@@ -1430,6 +1430,9 @@ function modelGenerationSettingsPayload(
|
||||
if (configuration.temperature !== undefined) {
|
||||
payload.temperature = configuration.temperature;
|
||||
}
|
||||
if (configuration.supportsImages !== undefined) {
|
||||
payload.supports_images = configuration.supportsImages;
|
||||
}
|
||||
if (configuration.reasoningEffort !== undefined) {
|
||||
payload.reasoning_effort = configuration.reasoningEffort ?? "";
|
||||
}
|
||||
|
||||
@@ -754,6 +754,7 @@ export interface SettingsPayload {
|
||||
context_window_tokens: number;
|
||||
temperature: number;
|
||||
reasoning_effort: string | null;
|
||||
supports_images?: boolean;
|
||||
api?: ModelAPIConfig | null;
|
||||
timezone: string;
|
||||
tool_hint_max_length: number;
|
||||
@@ -772,6 +773,7 @@ export interface SettingsPayload {
|
||||
temperature: number;
|
||||
reasoning_effort: string | null;
|
||||
reasoning_effort_values?: string[];
|
||||
supports_images?: boolean;
|
||||
api?: ModelAPIConfig | null;
|
||||
extra_headers?: Record<string, string> | null;
|
||||
extra_query?: Record<string, string> | null;
|
||||
@@ -1407,6 +1409,7 @@ export interface ModelConfigurationCreate {
|
||||
contextWindowTokens?: number;
|
||||
temperature?: number;
|
||||
reasoningEffort?: string | null;
|
||||
supportsImages?: boolean;
|
||||
api?: ModelAPIConfig | null;
|
||||
extraHeaders?: string;
|
||||
extraQuery?: string;
|
||||
@@ -1422,6 +1425,7 @@ export interface ModelConfigurationUpdate {
|
||||
contextWindowTokens?: number;
|
||||
temperature?: number;
|
||||
reasoningEffort?: string | null;
|
||||
supportsImages?: boolean;
|
||||
api?: ModelAPIConfig | null;
|
||||
extraHeaders?: string;
|
||||
extraQuery?: string;
|
||||
|
||||
Reference in new issue
Block a user