Skip to content

refactor(model-runtime)!: remove legacy model type aliases - #207

Merged
QuantumGhost merged 1 commit into
mainfrom
codex/remove-model-type-alias
Jul 6, 2026
Merged

QuantumGhost merged 1 commit into
mainfrom
codex/remove-model-type-alias

Conversation

@QuantumGhost

@QuantumGhost QuantumGhost commented Jul 3, 2026 •

Copy link
Copy Markdown
Member

AI disclosure: This PR was primarily drafted with Codex using GPT-5.4.
I have reviewed and edited the final diff, and I am responsible for the content.

Important

  1. Make sure you have read our contribution guidelines
  2. Search existing issues and pull requests to confirm this change is not a duplicate
  3. Open or identify the issue this pull request resolves or advances
  4. Use a Conventional Commits title for this pull request, and mark breaking changes with !
  5. Remember that the pull request title will become the squash merge commit message
  6. If CLA Assistant prompts you, sign CLA.md in the pull request conversation

Related Issue

Closes #206

Summary

Remove legacy provider-native model type alias parsing from ModelType now that the Dify legacy model_type migration window has completed.

This keeps canonical Graphon model type values accepted:

  • llm
  • text-embedding
  • rerank
  • speech2text
  • moderation
  • tts

It also keeps ModelType.to_origin_model_type() unchanged so Graphon can still map canonical model types to provider-native strings at the outbound provider boundary.

BREAKING CHANGE: ModelType no longer accepts legacy provider-native model type strings such as text-generation, embeddings, or reranking. Callers must pass canonical Graphon model type values instead.

Validation:

  • uv run pytest tests/model_runtime/test_model_dispatch.py -k 'model_type_rejects_legacy_origin_model_type_aliases or model_type_accepts_canonical_values or model_type_to_origin_model_type_uses_model_map'
  • just test
  • just check

Checklist

  • This pull request links the issue it resolves or advances
  • This pull request title follows Conventional Commits, and any breaking change is marked with !
  • I filled in the ADR field using ADR 0001 as the source of truth
  • If CLA Assistant prompted me, I signed CLA.md in the pull request conversation

Remove legacy provider-native model type alias parsing from ModelType while keeping canonical model type values and provider-native output mapping covered by tests.

BREAKING CHANGE: ModelType no longer accepts legacy provider-native model type strings such as text-generation, embeddings, or reranking. Callers must pass canonical Graphon model type values instead.

Closes #206

Assisted-by: Codex:GPT-5.4
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 3, 2026
@QuantumGhost
QuantumGhost enabled auto-merge (squash) July 3, 2026 04:55
@QuantumGhost
QuantumGhost merged commit c5293d0 into main Jul 6, 2026
11 of 12 checks passed
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 6, 2026
@QuantumGhost
QuantumGhost deleted the codex/remove-model-type-alias branch July 6, 2026 16:37
@laipz8200 laipz8200 mentioned this pull request Jul 29, 2026
2 of 19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove legacy model type alias parsing after Dify migration window

2 participants