feat: add support for Seedream image generation - #3132
Conversation
…x-override feat: 支持基于Go Regex规则和全量的请求体透传
feat: backend i18n
fix: optimize Codex relay
…sponses-local-usage fix: charge local input tokens when Gemini returns empty response
- Remove claude-instant-1.2, claude-2, claude-2.0, claude-2.1 from model lists - Remove /v1/complete endpoint support (legacy completion API) - Remove RequestModeCompletion and related code paths - Simplify handler functions by removing requestMode parameter - Update all channel adaptors that referenced claude handlers
…gacy-models remove: drop support for claude-2 and claude-1 series models
- Introduce Provider interface pattern for standard OAuth protocols - Create unified controller/oauth.go with common OAuth logic - Add OAuthError type for translatable error messages - Add i18n keys and translations (zh/en) for OAuth messages - Use common.ApiErrorI18n/ApiSuccessI18n for consistent responses - Preserve backward compatibility for existing routes and data
- Add support for custom OAuth providers, including creation, retrieval, updating, and deletion. - Introduce new model and controller for managing custom OAuth providers. - Enhance existing OAuth logic to accommodate custom providers. - Update API routes for custom OAuth provider management. - Include i18n support for custom OAuth-related messages.
…th user creation and binding - Improve error handling in DeleteCustomOAuthProvider to log and return errors when fetching binding counts. - Refactor user creation and OAuth binding logic to use transactions for atomic operations, ensuring data integrity. - Add unique constraints to UserOAuthBinding model to prevent duplicate bindings. - Enhance GitHub OAuth provider error logging for non-200 responses. - Update AccountManagement component to provide clearer error messages on API failures.
…ers for optional fields - Change fields in UpdateCustomOAuthProviderRequest struct to use pointers for optional values, allowing for better handling of nil cases. - Update UpdateCustomOAuthProvider function to check for nil before assigning optional fields, ensuring existing values are preserved when not provided.
…al file types for LF normalization and binary detection
Mitigate XSS vulnerabilities in the playground where AI-generated content is rendered without sanitization, allowing potential script injection via prompt injection attacks. MarkdownRenderer.jsx: - Replace dangerouslySetInnerHTML with a sandboxed iframe for HTML preview - Use sandbox="allow-same-origin" to block script execution while allowing CSS rendering and iframe height auto-sizing - Add SandboxedHtmlPreview component with automatic height adjustment CodeViewer.jsx: - Add escapeHtml() utility to encode HTML entities before rendering - Rewrite highlightJson() to process tokens iteratively, escaping each token and structural text before wrapping in syntax highlighting spans - Escape non-JSON and very-large content paths that previously bypassed sanitization - Update linkRegex to correctly match URLs containing & entities These changes only affect the playground (AI output rendering). Admin- configured content (home page, about page, footer, notices) remains unaffected as they use separate code paths and are within the trusted admin boundary.
…its-length fix: change token model_limits column from varchar(1024) to text
Return error when model price/ratio unset
* feat: add upstream model update detection with scheduled sync and manual apply flows * feat: support upstream model removal sync and selectable deletes in update modal * feat: add detect-only upstream updates and show compact +/- model badges * feat: improve upstream model update UX * feat: improve upstream model update UX * fix: respect model_mapping in upstream update detection * feat: improve upstream update modal to prevent missed add/remove actions * feat: add admin upstream model update notifications with digest and truncation * fix: avoid repeated partial-submit confirmation in upstream update modal * feat: improve ui/ux * feat: suppress upstream update alerts for unchanged channel-count within 24h * fix: submit upstream update choices even when no models are selected * feat: improve upstream model update flow and split frontend updater * fix merge conflict
…ream-model-tips Fix/auto fetch upstream model tips
…yles and color variants
…1216dd9f2155c19f0556e4655bc fix: update task billing log content to include reason
…ide-wildcard-path Feature/param override wildcard path
…7aec3eb60f27ca33dbb4dc9610a fix: fetch model add header passthrough rule key check
feats: repair the thinking of claude to openrouter convert
WalkthroughThe pull request adds support for the "seedream-" image generation model by registering the prefix in the recognized models list and updating the test channel controller to properly classify and handle these models with specific image dimension requirements. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
🧹 Nitpick comments (1)
controller/channel-test.go (1)
303-305: Case sensitivity mismatch with model detection logic.
strings.Contains(testModel, "seedream-")is case-sensitive, butIsImageGenerationModel()incommon/model.gonormalizes to lowercase before matching. IftestModel(which is the upstream model name from line 247) has different casing, this check could fail while the model is still classified as image generation.♻️ Suggested fix for consistent case handling
if imageReq, ok := request.(*dto.ImageRequest); ok { - if strings.Contains(testModel, "seedream-") { + if strings.Contains(strings.ToLower(testModel), "seedream-") { imageReq.Size = "2048x2048" // VolcEngine Seedream-4.5 和 5.0 模型需要至少 2048x2048 的图片尺寸 见:https://www.volcengine.com/docs/82379/1824121 } convertedRequest, err = adaptor.ConvertImageRequest(c, info, *imageReq)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@controller/channel-test.go` around lines 303 - 305, The check for seedream model casing is inconsistent: normalize testModel to lowercase (same as IsImageGenerationModel() in common/model.go) before testing; replace the case-sensitive strings.Contains(testModel, "seedream-") with a lowercase-aware check (e.g., set a local var like modelLower := strings.ToLower(testModel) and use strings.Contains(modelLower, "seedream-")) and then set imageReq.Size = "2048x2048" when matched so model detection and sizing logic are consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@controller/channel-test.go`:
- Around line 303-305: The check for seedream model casing is inconsistent:
normalize testModel to lowercase (same as IsImageGenerationModel() in
common/model.go) before testing; replace the case-sensitive
strings.Contains(testModel, "seedream-") with a lowercase-aware check (e.g., set
a local var like modelLower := strings.ToLower(testModel) and use
strings.Contains(modelLower, "seedream-")) and then set imageReq.Size =
"2048x2048" when matched so model detection and sizing logic are consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e708ff09-f177-4c67-adca-9a3d85e26a9d
📒 Files selected for processing (2)
common/model.gocontroller/channel-test.go
支持火山豆包渠道测试 seedream生图模型

Summary by CodeRabbit
New Features
Tests