ac4af582301a4e8a29245dbba767eba31334ddf9
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
02ff0e908f |
agent: the Codex app's route opens config.toml to see it can be read, not reads it whole
codexAppRoute runs every 3s for as long as magpie does (the Codex app's app-server watcher). It read the whole of Codex's config.toml with os.ReadFile only to learn the file could be read; the keys it uses come from filememo, which parses the file once per change. Codex keeps every project's trust level in that file, and the owner's is 1.5 MB, so this was 1.55 GB of the 33 GB a live magpie allocated in 53 minutes (heap profile: KeepCodexAppOnItsProvider → codexAppStep → os.ReadFile). It is now opened and closed: a file that can't be opened is still an unknown route, a missing one still a known one. Run on mote: - TestCodexAppRouteReadsNoWholeConfig (new): a 1.6 MB config, 10 looks allocate under 1 MB; a config with mode 0 gives no route. - Broken by hand: ReadFile put back, red (14.4 MB for 10 looks); the unreadable check dropped, red. - go test -run CodexAppRoute ./internal/agent: ok. - go test -count=1 -timeout 45m ./internal/agent ok (185.3s), at this tree rebased on 4a7d1c63a; gofmt -l clean; go vet ./internal/agent for darwin, linux and windows ok |
||
|
|
d6e1116380 |
codex: each end of the Codex app's app-server says why, and list flaps are guarded (#4550)
|
||
|
|
72ca3d593b |
codex: magpie as Codex's provider keeps the Codex app's ChatGPT account while it has room, so its Work chats and projects stay
Qyburn3 on X: with magpie taking Codex over, the Codex app's "Work"
sessions don't load while the model still answers; turned off, they
come back.
Cause: [model_providers.magpie] had no requires_openai_auth, so Codex's
app-server answers account/read and getAuthStatus with no account and no
token whenever magpie is Codex's provider (magpie API, or the codex.out
takeover). ChatGPT.app 26.1021 then switches to an identity of no
account: onboarding again with no name, ChatGPT mode's projects and
chats ("Work") empty, no avatar, no Chrome control (#1824).
Now putProvider writes requires_openai_auth = true while Codex has a
ChatGPT sign-in with room (openaiAuth: codexChatGPTKnown and not
codexUsedUp), and takes it out otherwise:
- API key alone: left out. With it Codex drops image_gen (captured: 11
tools without, 10 with), and there is no account to keep.
- No sign-in: left out (the app would ask for a sign-in).
- A sign-in the Codex app holds (codex.out, or magpie API while used
up): left out, since the app's composer gate (authMethod chatgpt +
allowed false, #540) would grey Send for magpie's models again. The
takeover's note now names "its ChatGPT chats and projects" among what
is off till the reset, beside Keep on ChatGPT.
- An unknown sign-in read leaves the table as it is.
Sync rewrites the key on any table that disagrees (authStale), an older
magpie's included, and the key joins codexAppRoute, so the Codex app's
app-server is restarted onto its account with nothing for the user to
do. The magpie API note no longer says Chrome control needs ChatGPT (en,
zh, zh-TW, ja, de); agent-wiring.md says why.
Real app (mote, ChatGPT.app 26.1021 with its codex 0.164.0-alpha.11,
sandbox CODEX_HOME, copied real ChatGPT auth, auth.json unchanged after):
- native config: the account's projects and recent chats listed.
- magpie table without the key: onboarding, "ChatGPT Work" with no
projects, no chats. app-server: account null, authMethod null.
- magpie table with requires_openai_auth = true (the keys this commit
writes): every project and chat back; account/read chatgpt pro,
getAuthStatus authMethod chatgpt with a token.
- Model requests to a capturing server, with and without the key:
Bearer is magpie's experimental_bearer_token, no ChatGPT-Account-ID,
15 tools both ways with a ChatGPT sign-in (image_gen kept).
Tests: TestCodexMagpieProviderKeepsChatGPTAccount (ChatGPT + magpie API,
used up and back; taken over and the reset; an older magpie's table from
live config bytes; API key and no sign-in, fresh and after ChatGPT) and
TestCodexAppRouteFollowsOpenAIAuth. Broken by hand: on the old codex.go
5 of 7 subtests red; without the Sync re-derive 3 red; with the key kept
while used up 2 red; agents.go without the route key, the route test red.
Run (mote-run, at this tree on origin/main 157d575c3; the build and the
agent run again after the rebase onto
|
||
|
|
df83749218 |
codex: Disconnect and Connect restart the Codex app's own app-server, so the app stops sending to magpie without a restart
JiangLiuer222 on X: after Disconnect the Codex app kept sending to 127.0.0.1:3425, now and then. The app's app-server reads config.toml only as it starts, so one started while Codex was connected kept the gateway's base URL until the user quit the app. Now the gateway's watcher (KeepCodexAppOnItsProvider, from |