Settings › Models › Image generation offered "GPT Image 2 · Codex" and
"GPT Image 2.5 · Codex". chatgpt.com/backend-api/codex/images/generations
ignores the model (and size): tested with the owner's Pro account, it
answers gpt-image-2, gpt-image-2.5, gpt-image-2.5-sunburst and a made-up
"x" with 200 and the same image (#1865 comment 6131731318), as 3a18ec8e
already suspected. The picker implied a choice that doesn't exist.
What changed:
- gateway: codexDrawers is one entry, gpt-image-2 named "GPT Image" (what
Codex CLI asks for). VendorPicksDrawer(p) marks a ChatGPT account.
ListedDrawer(ref) maps any gpt-image-* picked on a ChatGPT account
(a saved codex/gpt-image-2.5) to that entry, for display only.
drawsFamily still lets a named or saved gpt-image-2.5 draw there.
- gui: /api/settings sends imageGenShown when the saved ImageGen stands
for another listed entry, and vendorPicks on the ChatGPT entry. The row
shows and ticks the entry, picking it again saves nothing (the saved
value is never rewritten), its option note and a line under the row say
ChatGPT's image backend picks the model itself. en/zh/zh-TW/ja/de.
- Aside: magpie/codex/gpt-image-2.5, picked when it was offered, is still
taken as an image model (asideImageOffered maps it via ListedDrawer).
- An API key's gpt-image-2.5 (OpenAI, relays) is listed and drawn as
before: there the model field matters.
Checked: no doc, site page, MCP tool description or CLI lists these ids.
The remote-magpie list (drawerObjects) follows Drawers and now lists one.
Run, at this head:
- New tests failing on the old code: TestCodexListsOneGPTImage ("codex
lists [gpt-image-2 gpt-image-2.5], want only gpt-image-2") and
TestCodexAccountDraws with the old codexDrawers;
TestAsideCodexOneGPTImage ("magpie/codex/gpt-image-2.5 not offered")
without the aside mapping; TestImageGenCodexOneEntry ("shown \"\"")
without the api.go wiring; images-codex-one.test.cjs with the old
app.js (button "codex/gpt-image-2.5", not "GPT Image · Codex").
- go test -tags nogui ./internal/gateway ./internal/gui ./internal/agent
./internal/catalog ./internal/provider under a sandbox HOME: ok.
- gofmt -l (empty), go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./..., go build, GOOS=linux go build -tags nogui,
GOOS=windows go build: clean.
- Playwright (1.62.0), chromium and webkit: images-codex-one (en, zh,
zh-TW, ja, de at 1000px; en, zh at 360px), images-missing, vision-mcp,
searcher-pick, routing-vision-why, i18n-keys: all pass.
Not run: the full go test ./... and the whole GUI suite; no new request
was made to chatgpt.com (the backend's behaviour is the #1865 test).
50 lines
1.6 KiB
Go
50 lines
1.6 KiB
Go
package agent
|
|
|
|
import (
|
|
"encoding/base64"
|
|
"encoding/json"
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/yetone/magpie/internal/provider"
|
|
)
|
|
|
|
// #1865: a ChatGPT account is offered one GPT Image for Aside's image
|
|
// model, as its backend draws the same for any name; Aside's
|
|
// magpie/codex/gpt-image-2.5, picked when magpie offered it, is still
|
|
// taken as that one, not turned away as no image model.
|
|
func TestAsideCodexOneGPTImage(t *testing.T) {
|
|
asideHome(t)
|
|
claims := func(m map[string]any) string {
|
|
b, _ := json.Marshal(m)
|
|
return "h." + base64.RawURLEncoding.EncodeToString(b) + ".s"
|
|
}
|
|
auth, _ := json.Marshal(map[string]any{"auth_mode": "chatgpt", "tokens": map[string]any{
|
|
"id_token": claims(map[string]any{"email": "me@example.com"}),
|
|
"access_token": claims(map[string]any{"exp": time.Now().Add(time.Hour).Unix()}),
|
|
"refresh_token": "r", "account_id": "acct-1"}})
|
|
writeFile(t, filepath.Join(os.Getenv("HOME"), ".codex", "auth.json"), string(auth))
|
|
provider.ForgetAccounts()
|
|
t.Cleanup(provider.ForgetAccounts)
|
|
var codex []string
|
|
for _, o := range asideImageOptions() {
|
|
if strings.HasPrefix(o.Ref, "codex/") {
|
|
codex = append(codex, o.Value)
|
|
}
|
|
}
|
|
if len(codex) != 1 || codex[0] != "magpie/codex/gpt-image-2" {
|
|
t.Fatalf("codex image options %v, want only magpie/codex/gpt-image-2", codex)
|
|
}
|
|
for _, v := range []string{"magpie/codex/gpt-image-2", "magpie/codex/gpt-image-2.5"} {
|
|
if !asideImageOffered(v) {
|
|
t.Errorf("%s not offered", v)
|
|
}
|
|
}
|
|
if asideImageOffered("magpie/codex/gpt-6.1-sol") {
|
|
t.Error("a chat model offered as an image model")
|
|
}
|
|
}
|