From 06caa0961d06a697cfff975a54519d9bf9741f0f Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 2 Oct 2026 04:22:02 +0800 Subject: [PATCH] =?UTF-8?q?gateway=20tests:=20a=20Codex=20sign-in=20a=20te?= =?UTF-8?q?st=20makes=20is=20listed=20at=20once,=20whichever=20test=20ran?= =?UTF-8?q?=20before=20(TestAccountProxy=20failed=20in=20the=20full=20pack?= =?UTF-8?q?age,=20passed=20alone)=20=E2=80=94=20usage:=20own=20was=20sent?= =?UTF-8?q?=20[],=20want=20[acct-1]:=20TestArrangedKeysAreGatewayCandidate?= =?UTF-8?q?s,=20run=20just=20before,=20looked=20at=20the=20accounts=20in?= =?UTF-8?q?=20its=20own=20home,=20and=20provider.rememberLogins=20(interna?= =?UTF-8?q?l/provider/logins.go:461)=20looks=20again=20only=20once=2030s?= =?UTF-8?q?=20have=20passed=20since,=20so=20codexSignedIn's=20~/.codex/aut?= =?UTF-8?q?h.json=20for=20me@example.com=20was=20never=20taken=20into=20lo?= =?UTF-8?q?gins.json;=20the=20turn=20still=20went=20to=20acct-1=20by=20Cod?= =?UTF-8?q?ex's=20own=20sign-in,=20but=20LoginUsage("codex")=20listed=20on?= =?UTF-8?q?ly=20the=20two=20saved=20accounts=20and=20never=20asked=20for?= =?UTF-8?q?=20acct-1's=20usage.=20codexSignedIn=20now=20calls=20provider.F?= =?UTF-8?q?orgetAccounts,=20made=20for=20a=20test's=20home,=20and=20again?= =?UTF-8?q?=20on=20cleanup,=20as=20fallback=5Ftest=20and=20refusal=5Faccou?= =?UTF-8?q?nts=5Ftest=20do.=20No=20production=20change:=20the=2030s=20wait?= =?UTF-8?q?=20is=20magpie's=20own,=20and=20a=20sign-in=20or=20switch=20in?= =?UTF-8?q?=20magpie=20already=20clears=20it.=20go=20test=20-tags=20nogui?= =?UTF-8?q?=20-count=3D1=20./internal/gateway/=20passes=20three=20times=20?= =?UTF-8?q?in=20a=20row;=20go=20vet=20./internal/...,=20go=20build=20-tags?= =?UTF-8?q?=20nogui=20(darwin,=20GOOS=3Dlinux),=20GOOS=3Dwindows=20go=20bu?= =?UTF-8?q?ild=20pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/gateway/codex_accounts_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/gateway/codex_accounts_test.go b/internal/gateway/codex_accounts_test.go index b1a0fcea..11f989e3 100644 --- a/internal/gateway/codex_accounts_test.go +++ b/internal/gateway/codex_accounts_test.go @@ -47,6 +47,10 @@ func codexSignedIn(t *testing.T, spares ...string) { } os.MkdirAll(filepath.Dir(provider.Path()), 0o755) os.WriteFile(filepath.Join(filepath.Dir(provider.Path()), "logins.json"), mustJSON(saved), 0o600) + // signed in behind magpie's back: an earlier test's look at its own + // home within 30s would otherwise keep Codex's sign-in off the list + provider.ForgetAccounts() + t.Cleanup(provider.ForgetAccounts) } // usedUp stands in for the ChatGPT backend with acct-1 out of its