Skip to content

fix(agent): image selection silently pins empty quality and hides parameter overrides #1106

Open

Description

@Weihong-Liu

Summary

Selecting an image model in WebUI can implicitly save tools.media.image.quality: "". That empty value then suppresses an explicit quality: "high" supplied to image_generate, so the Images API request omits quality even though the tool-call input shown in the trace requests high quality.

The same trace can show a requested Sunburst model and a different effective model. I understand that a model explicitly selected in Settings is intended to take precedence; this report does not ask to bypass that selection. The problem is the implicit quality pin and the lack of an explanation of which arguments were overridden and why.

Steps to reproduce

  1. Configure an OpenAI-compatible Custom provider that supports image generation.

  2. Select custom/gpt-image-2.5 for the image role in WebUI without selecting any image quality. The saved section is:

    {
      "model": "custom/gpt-image-2.5",
      "provider": "custom",
      "quality": ""
    }
  3. Invoke image_generate with the following arguments, or inspect a conversation in which the agent makes this call:

    {
      "prompt": "A kitten",
      "model": "openai/gpt-image-2.5-sunburst",
      "quality": "high"
    }
  4. Compare the tool-call input, effective request parameters, and tool result.

A minimal reproduction of the quality resolution does not need credentials, an HTTP request, or a real image generation:

from raven.agent.tools.media_gen import ImageGenerateTool
from raven.config.schema import ImageToolConfig

for extra in ({}, {"quality": ""}, {"quality": "low"}):
    config = ImageToolConfig(
        model="custom/gpt-image-2.5",
        provider="custom",
        **extra,
    )
    print(extra, repr(ImageGenerateTool(config).effective_quality("high")))

Output:

{} 'high'
{'quality': ''} ''
{'quality': 'low'} 'low'

Expected behavior

  • Selecting only an image model should not silently change whether a per-call quality argument can take effect. An unset/inherit quality and an explicitly chosen provider-default quality need distinguishable semantics.
  • If an empty string intentionally means "force the provider default, ignoring per-call quality", expose that choice in Settings and explain the override in the tool/trace UI. Currently the model picker writes it without a quality control.
  • Keep the documented Settings model precedence, but make requested versus effective model/quality and their selection source clear. A trace should explain that the configured model replaced the requested model and that the requested quality was omitted because of Settings.
  • Any model reported by the provider should be distinguished from Raven's outgoing model ID, if such information is available. Do not infer a provider's underlying model from an alias.

Actual behavior

The real local call succeeds, but its trace contains these different input and output values. Paths, session identifiers, and the original prompt are omitted:

{
  "tool.name": "image_generate",
  "input": {
    "model": "openai/gpt-image-2.5-sunburst",
    "quality": "high"
  },
  "result": {
    "success": true,
    "model": "gpt-image-2.5",
    "quality": ""
  }
}

The result does not explain the override. Its model is Raven's resolved outgoing model ID, not a model name read from the provider response.

I also reproduced the request construction locally with httpx.MockTransport, without calling an external service:

Image configuration Tool-call quality Outgoing model Outgoing quality
quality key omitted high gpt-image-2.5 high
quality: "" (as saved by the picker) high gpt-image-2.5 omitted
quality: "low" high gpt-image-2.5 low

All three calls requested openai/gpt-image-2.5-sunburst; the configured model correctly remained authoritative. The first two quality cases differ only in whether the empty default was serialized.

Environment

  • macOS, local deployment, zsh
  • Raven 0.2.5, installed with uv, Python 3.12
  • Observed in a TUI conversation trace displayed in the page interface; image selection configured through WebUI
  • Image provider: Custom / OpenAI-compatible Images API; endpoint and credentials omitted
  • Confirmed the relevant selection logic is also present on current main (25e1b23ea685ab71c3f1bad248a5e1c934815b2d), and reproduced request construction using the checkout's implementation with a mock HTTP transport

Logs or screenshots

Relevant source on the inspected main revision:

Related context: #828 introduced the provider-selection discussion and was fixed by #866. #1103 concerns model classification; this report concerns parameter resolution and its visibility after a model has already been selected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions