Commit Graph
2 Commits
Author SHA1 Message Date
yetone 86254d4049 tests: an unreachable upstream is 127.0.0.1:1, not a closed server's port
TestCodexOwnModelUnreached went red on ubuntu CI at 0ddcf28a1 (run
39742463965, shard 2): it closed an httptest server and pointed
codexAPIBase at its URL, Linux handed that port to another test's server
at once, and its fake answered "pong" with 200 instead of the dial error
the test is about. The same class as 9a852ae9d and d0ccbbebc.

Both tests that took a dead URL from a closed server now use
http://127.0.0.1:1: refused at once on every OS, and no test can listen
on it (privileged on Linux and macOS, unused on Windows). The sibling is
TestMirrorFailuresAreTheMirrors in internal/update, whose "gone" mirror
had the same race.

Run at this tree: go test -count=3 -run
'TestCodexOwnModelUnreached|TestMirrorFailuresAreTheMirrors'
./internal/gateway ./internal/update: ok; go test ./internal/update: ok;
gofmt -l none; go vet for darwin, linux, windows: ok. The reuse itself
wasn't injected; the CI log's 200 "pong" body is the evidence.
2026-10-22 16:27:54 +08:00
yetone 953bce2cfb agents: Codex signed in with only an API key gets magpie as its provider, its picker listing magpie's models (#322, dakango: switching the Codex app to one of its own models went to OpenAI, 502) — magpie counted an API key in auth.json as a ChatGPT sign-in and only set openai_base_url, counting on Codex to ask the gateway for its models; but Codex asks for none with an API key (models-manager refresh_available_models returns early), so the picker showed Codex's built-in models and the one magpie model, and a built-in one went to OpenAI with the relay's key. Now only a ChatGPT sign-in takes that route; with an API key alone magpie is the model_provider with model_catalog_json listing every magpie model on for Codex, as when signed out, and a sync moves a setup an older magpie wrote; going back to Codex's own model restores the user's model_provider. A Codex model whose OpenAI can't be reached now fails naming the model and what to do instead of a bare 502. TestCodexAPIKeyUsesProvider, TestCodexAPIKeyBaseURLMoved and TestCodexOwnModelUnreached fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. 2026-09-30 20:08:27 +08:00