sync: bring over remaining release/custom-0.1.115 changes
- Extract PublicSettingsInjectionPayload named struct with drift test - Add channel_monitor_default_interval_seconds to SSR injection - Add image_output_price to SupportedModelChip - Simplify AppSidebar buildSelfNavItems (admins see available channels) - Add gateway WARN logs for 503 no-available-accounts branches - Wire ChannelMonitorRunner into provideCleanup for graceful shutdown - Add migrations 130/131 (CC template userid fix + mimicry field cleanup) - Clean up fork-only features (sora, claude max simulation, client affinity) - Remove ~320 obsolete i18n keys - Add codexUsage utility, WechatServiceButton, BulkEditAccountModal - Tidy go.sum
This commit is contained in:
@@ -217,42 +217,6 @@ func TestApplyCodexOAuthTransform_NormalizeCodexTools_PreservesResponsesFunction
|
||||
require.Equal(t, "bash", first["name"])
|
||||
}
|
||||
|
||||
func TestNormalizeOpenAIResponsesImageGenerationTools_RewritesLegacyFields(t *testing.T) {
|
||||
reqBody := map[string]any{
|
||||
"tools": []any{
|
||||
map[string]any{
|
||||
"type": "image_generation",
|
||||
"format": "png",
|
||||
"compression": 60,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
modified := normalizeOpenAIResponsesImageGenerationTools(reqBody)
|
||||
require.True(t, modified)
|
||||
|
||||
tools, ok := reqBody["tools"].([]any)
|
||||
require.True(t, ok)
|
||||
first, ok := tools[0].(map[string]any)
|
||||
require.True(t, ok)
|
||||
require.Equal(t, "png", first["output_format"])
|
||||
require.Equal(t, 60, first["output_compression"])
|
||||
_, hasFormat := first["format"]
|
||||
require.False(t, hasFormat)
|
||||
_, hasCompression := first["compression"]
|
||||
require.False(t, hasCompression)
|
||||
}
|
||||
|
||||
func TestValidateOpenAIResponsesImageModel_RejectsImageOnlyModel(t *testing.T) {
|
||||
err := validateOpenAIResponsesImageModel(map[string]any{
|
||||
"tools": []any{
|
||||
map[string]any{"type": "image_generation"},
|
||||
},
|
||||
}, "gpt-image-2")
|
||||
|
||||
require.ErrorContains(t, err, `/v1/responses image_generation requests require a Responses-capable text model`)
|
||||
}
|
||||
|
||||
func TestApplyCodexOAuthTransform_EmptyInput(t *testing.T) {
|
||||
// 空 input 应保持为空且不触发异常。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user