fix: detect GPT image models for automatic endpoint tests - #6423
fix: detect GPT image models for automatic endpoint tests#6423fengnian2025 wants to merge 3 commits into
Conversation
WalkthroughGPT image model matching now covers the broader ChangesGPT image endpoint handling
Error logging updates
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@model/log.go`:
- Line 284: Update the error message in the logging flow around logger.LogError
to stop including c.GetString("username"); retain userId as the user identifier
or use an approved redacted/hash-derived value, while preserving the other
diagnostic fields and the persisted Log record behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7e8b4222-2bf1-41e1-8e36-e11ccc8592cf
📒 Files selected for processing (2)
controller/relay.gomodel/log.go
51fdfc5 to
2b6f1df
Compare
📝 变更描述 / Description
修正log日志优先级以及增加重要信息
gpt-image-2属于 OpenAI 的 Image Generation 模型,但此前模型识别规则只覆盖gpt-image-1。因此,gpt-image-2会被当作普通 OpenAI Chat 模型处理,通道测试的“自动检测”也会错误地请求/v1/chat/completions。本次修改将 GPT Image 模型识别扩展为
gpt-image-*系列,并让通道测试的自动端点检测复用统一的图片模型判断逻辑。这样gpt-image-2会自动使用:image-generation端点类型/v1/images/generationsImageRequest用户显式指定端点时仍保持原有优先级。同时增加了模型识别、端点优先级、自动检测和显式端点覆盖的回归测试。
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
全量测试通过: