4.3 KiB
4.3 KiB
Change: Update image API compatibility modes for official and Tuzi GPT Image routing
Why
The project already supports official GPT Image generation and edit requests through a dedicated adapter, but Tuzi GPT compatibility is still implemented as a hidden branch inside the generic default image adapter. That keeps current behavior working, but it leaves three important problems:
Tuzi GPT compatibilitydoes not have a real adapter boundary of its own.autostill feels ambiguous because it resolves to different contracts without a clear ownership model.- future
/images/editswork for Tuzi or other GPT-compatible gateways will keep accumulating inside the generic basic adapter.
We need to separate these contracts cleanly before more image capabilities are added.
What Changes
- Refine internal image compatibility modes to four values:
autoopenai-gpt-imagetuzi-gpt-imageopenai-compatible-basic
- Keep
autoas a runtime resolver, not as a concrete wire contract. - Accept legacy
tuzi-compatiblevalues as an alias and normalize them towardtuzi-gpt-image. - Add a dedicated
tuzi-gpt-image-adapterso Tuzi GPT compatibility no longer lives inside the generic default/basic adapter. - Add a dedicated Tuzi GPT request schema for text-to-image generation, with edit support designed as the next phase.
- Keep official GPT generation and edit on the existing dedicated
gpt-image-adapter. - Keep
openai-compatible-basicas the generic fallback path for non-official gateways and emergency rollback. - Default newly created provider profiles to
openai-gpt-imageinstead ofauto. - Default built-in managed provider profiles to
openai-gpt-imagewhen they do not already have a stored override. - Preserve explicit stored
autoon historical custom profiles instead of silently rewriting user intent. - Migrate only missing compatibility fields or managed-profile defaults toward
openai-gpt-image, while keeping manual overrides round-trippable. - Simplify the profile settings UX so the main choices emphasize:
OpenAI GPT ImageTuzi GPT 兼容whileautoandopenai-compatible-basicremain internal or migration-oriented modes.
- Make size, resolution, and quality contract semantics explicit for official GPT versus Tuzi/basic compatibility.
Non-Goals
- Do not introduce the broader
image.generate/image.editoperation abstraction in this change. - Do not add a new public MCP tool name or a new image task type.
- Do not remove the generic
openai-compatible-basicfallback. - Do not redefine
autoas always-official or always-basic. - Do not fully standardize Tuzi edit transport in the first implementation phase.
Impact
- Affected specs:
provider-profilesprovider-routingimage-generation
- Affected code:
packages/drawnix/src/utils/settings-manager.tspackages/drawnix/src/components/settings-dialog/settings-dialog.tsxpackages/drawnix/src/services/provider-routing/types.tspackages/drawnix/src/services/provider-routing/settings-repository.tspackages/drawnix/src/services/provider-routing/binding-inference.tspackages/drawnix/src/services/provider-routing/endpoint-binding-inference.tspackages/drawnix/src/services/model-adapters/default-adapters.tspackages/drawnix/src/services/model-adapters/gpt-image-adapter.tspackages/drawnix/src/services/model-adapters/registry.tspackages/drawnix/src/services/model-adapters/image-size-quality-resolver.tspackages/drawnix/src/services/model-adapters/tuzi-gpt-image-adapter.tspackages/drawnix/src/services/generation-api-service.tspackages/drawnix/src/mcp/tools/image-generation.ts
Relationship To Existing Changes
- Builds on
add-gpt-image-profile-compatibility, but tightens the contract boundary so Tuzi GPT compatibility is no longer treated as a generic basic-only branch. - Builds on
add-gpt-image-edit-support, while keeping official/images/editson the existing adapter and reserving a cleaner Tuzi edit contract for the next phase. - Preserves the current default/basic adapter as a fallback path rather than the long-term home for GPT-specific compatibility logic.
- Revises the earlier rollout assumption that new or rebuilt profiles should keep defaulting to
auto; this follow-up makes explicit GPT mode the default while retainingautoas an advanced resolver.