TestFetchAsksASharedBaseOnce, TestFetchAsksOneListOnceForTwoBasesOfIt
and TestFetchUnionsProtocolListsWithoutChat are red on main since
6eb510f78 ("codex: a relay's own Codex entries reach Codex as it gave
them"). Each counts every GET of the models list. For a provider added
by its address (no preset, no account) with a Responses base, 6eb510f78
asks the Responses list once more with client_version (codexEntries),
and says so: "fetchOne asks the same URL once more with client_version
(codexEntries). Only where the list is fetched (add, key change,
Refresh), never per Codex poll." The three tests' providers are such
providers, so each counted that ask as the list asked a second time.
They weren't seen red then: 6eb510f78's whole internal/provider run
crashed in TestUnreadLoginsWriteErrorsKeepCredentials (#3632) first, and
after its rebase provider ran with -run Codex. On CI that crash ends the
package before them (run 40492644859, at e056779a, names none of the
three).
The ask is that change's own, and its TestCodexListedEntry counts it, so
this keeps it and the three tests count it apart: a request carrying
client_version is Codex's, any other is the list. Each still wants the
list itself asked exactly once, what it is there for (#1006 for
TestFetchAsksOneListOnceForTwoBasesOfIt), and now wants Codex's ask once
at most: whether it is made is TestCodexListedEntry's to say. What a
Refresh of such a provider asks is unchanged, its Responses list twice,
the second time as Codex asks it. If that request isn't wanted, it is
codexEntries' to change, and these tests then need nothing.
What was run (tree 7e0975fa, on origin/main e056779a, go1.26.8,
linux/amd64), outside graftcp, umask 077:
- The three, -count=1 -v: red at e056779a as #3854 has them; here 3
PASS. -race -count=20: ok.
- Broken by hand (restored after):
- the fetch keeping no record of the lists it asked (a nil
catalog.Listed, which pays for every list URL again):
TestFetchAsksASharedBaseOnce ("asked 2 times, want once") and
TestFetchAsksOneListOnceForTwoBasesOfIt ("the one list fetched 2
times, want once", "chat and responses fetched the list 2 times,
want once") red; the third's two lists are on two servers, none
shared.
- codexEntries asking Codex's list twice: all three red ("the list
asked as Codex asks 2 times, want once at most", "asked responses as
Codex asks 2 times", "asked as Codex asks 2 times").
- internal/provider whole but TestUnreadLoginsWriteErrorsKeepCredentials
(#3632's crash), Bun 1.4.2: TestCodexAppServersOnHome alone red
(#3906); at e056779a, that and the three.
- go test -tags nogui -count=1 -timeout 45m ./... outside graftcp, umask
077, Bun 1.4.2 (log kept): 70 packages ok, 6 red, none in what this
changes. internal/provider ends at #3632's crash before the three run,
so the run above without that test is their record. The reds: agent
TestFolderVarsAreListed (#3884, main's CI red), TestCodexDriftReached
(#3398), TestInstalledVersion, TestCursorFolderFromTheEditorIsNotTheCLI,
TestCopilotFolderFromAnIDEPluginIsNotTheCLI, TestOmpDetectedWithPiDir
and TestZedAppPath (#3141), TestReasonixCLIRequiresSupportedNativeVersion
and TestReasonixCLIRecoversAfterProbeTimeout (#3641); edit
TestWriteAtomicReadOnlyHardLink and testenv TestProgram (umask 077,
#3640); gateway TestPluginToldWhereTheAgentWorks (#3675); gui
TestGatewayHeldByAContainer and TestGatewayFixQuitsOnlyAMagpie (#3649);
provider TestCodexAppServersOnHome (#3906), then "close of synctest
channel from outside bubble" from
TestUnreadLoginsWriteErrorsKeepCredentials (#3632), both main's CI red.
- gofmt -l clean. go vet -tags nogui and go build -tags nogui for linux,
windows and darwin, and go vet and go build for windows without the
tag: exit 0 each. go vet and go build without the tag on linux: exit 1
(this box has no GTK or WebKitGTK dev packages).
Merged from JoeyWu-tech's branch, cherry-picked onto origin/main d6c459c79 with the other of #3906/#3854. Run on mote (macOS) at that tree:
- go test ./internal/proc/ ./internal/provider/: ok, both whole (provider's first whole pass since #3632).
- the six tests these two touch, -count=20: ok. Each was red on main before.
- GOOS=linux and GOOS=windows go vet ./internal/proc/ ./internal/provider/: ok.
Not run here: Linux, where #3906 was red; its record is the author's above and the CI run of this push.