Skip to content

Commit 8df8e43

Browse files
fix: case-insensitive codex model matching and edit-mode submit routing
- normalizeCodexBillingModel: lowercase input for case-insensitive matching - billing_test: use uppercase CODEX-AUTO-REVIEW to actually test case insensitivity - ImageStudio: pass explicit forceMode from Generate button to prevent image-to-image mode silently falling through to text endpoint Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 78fe653 commit 8df8e43

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

database/billing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func normalizeBillingModelName(model string) string {
224224
}
225225

226226
func normalizeCodexBillingModel(model string) (string, bool) {
227-
compact := strings.NewReplacer(" ", "-", "_", "-").Replace(model)
227+
compact := strings.NewReplacer(" ", "-", "_", "-").Replace(strings.ToLower(model))
228228
switch {
229229
case strings.Contains(compact, "gpt-5.5-pro") || strings.Contains(compact, "gpt5-5-pro") || strings.Contains(compact, "gpt5.5-pro"):
230230
return "gpt-5.5-pro", true

database/billing_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ func TestNormalizeCodexBillingModelCodexAutoReview(t *testing.T) {
296296
}{
297297
{"codex-auto-review", "gpt-5.4"},
298298
{"codex-auto-review-v2", "gpt-5.4"}, // variant suffix should match
299-
{"codex-auto-review", "gpt-5.4"}, // case-insensitive
299+
{"CODEX-AUTO-REVIEW", "gpt-5.4"}, // case-insensitive
300300
{"codex_auto_review", "gpt-5.4"}, // underscores normalized
301301
}
302302
for _, tt := range tests {

frontend/src/pages/ImageStudio.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ export default function ImageStudio() {
12161216
<X className="size-4" />
12171217
{t('images.clearSelection')}
12181218
</Button>
1219-
<Button disabled={submitting || !prompt.trim()} onClick={() => void submitJob()}>
1219+
<Button disabled={submitting || !prompt.trim()} onClick={() => void submitJob(createJobPayload(), imageToImageMode ? 'edit' : 'text')}>
12201220
{submitting ? <Loader2 className="size-4 animate-spin" /> : <Play className="size-4" />}
12211221
{t('images.generate')}
12221222
</Button>

0 commit comments

Comments
 (0)