Skip to content

fix(openai): remove compact model suffix#3403

Open
xyfacai wants to merge 1 commit intoQuantumNous:mainfrom
xyfacai:fix/openai-compact
Open

fix(openai): remove compact model suffix#3403
xyfacai wants to merge 1 commit intoQuantumNous:mainfrom
xyfacai:fix/openai-compact

Conversation

@xyfacai
Copy link
Copy Markdown
Collaborator

@xyfacai xyfacai commented Mar 23, 2026

Summary by CodeRabbit

  • Refactor
    • Removed automatic model-name transformations for response compaction. Response compaction behavior is now exclusively determined by explicit endpoint type configuration and request path detection. This streamlines model mapping logic, eliminates implicit suffix-based model handling, and reduces automatic model rewriting, making system behavior more predictable and explicit.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 44ec2ba1-3774-48b5-9688-cd52bc92ca1f

📥 Commits

Reviewing files that changed from the base of the PR and between 9ae9040 and 136dd3a.

📒 Files selected for processing (6)
  • controller/channel-test.go
  • middleware/distributor.go
  • relay/channel/codex/constants.go
  • relay/helper/model_mapped.go
  • setting/ratio_setting/compact_suffix.go
  • setting/ratio_setting/model_ratio.go
💤 Files with no reviewable changes (5)
  • middleware/distributor.go
  • relay/helper/model_mapped.go
  • setting/ratio_setting/model_ratio.go
  • controller/channel-test.go
  • setting/ratio_setting/compact_suffix.go

Walkthrough

This pull request removes all handling of response compaction model suffix logic across the codebase, including the CompactModelSuffix constants, WithCompactModelSuffix helper function, and all conditional branches that automatically rewrite model names or prices for compact-suffixed models. Response compaction will now be determined solely by explicit endpoint_type or request path detection instead of model-name conventions.

Changes

Cohort / File(s) Summary
Compact Suffix Constants & Helpers
setting/ratio_setting/compact_suffix.go
Deleted entire file containing CompactModelSuffix (-openai-compact) and CompactWildcardModelKey constants, and the WithCompactModelSuffix() helper function.
Model Pricing & Ratio Logic
setting/ratio_setting/model_ratio.go
Removed fallback price/ratio lookups via CompactWildcardModelKey in GetModelPrice() and GetModelRatio() functions; these now only use exact model-name lookups and default fallbacks.
Model List & Mapping
relay/channel/codex/constants.go, relay/helper/model_mapped.go
Removed withCompactModelSuffix() helper invocation from model-list initialization; changed ModelList to explicit string literals. Removed compact-suffix stripping/appending logic in model-mapping helper.
Request Processing
controller/channel-test.go, middleware/distributor.go
Removed endpoint normalization for compact-model suffixes in test handler and request-path rewriting logic; model names no longer auto-converted via compact suffix in /v1/responses/compact path handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • seefs001

Poem

🐰 The suffix fades like morning dew,
Compaction rules shed, clean and new,
No more -openai-compact trailing,
Just explicit flags set without failing,
Model names run free, untangled and light!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(openai): remove compact model suffix' directly and clearly describes the main change: removal of the compact model suffix mechanism across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@PAIN300BACKS
Copy link
Copy Markdown

I am looking for a supplier of stable models for neural networks that support:
Text, Image, Video, Audio, 3D

我正在寻找支持神经网络的稳定模型的供应商:
文本,图像,视频,音频,3D

Write: https://t.me/EUN_TR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants