| 1 | # Brief: Codex startup notice + empty TMPDIR (Paul's live run is blocked) |
| 2 | |
| 3 | Branch `codex-startup-notice` from main 85d9ea8. Paul is running |
| 4 | scripts/try-equipo.sh live on docs-t1 and is waiting on this. Network |
| 5 | allowed; no live gate, no real sign-ins, do not touch |
| 6 | ~/.local/share/equipo. |
| 7 | |
| 8 | Observed on docs-t1 with the pinned codex 0.165.0, a signed-in ChatGPT |
| 9 | home, `app-server --strict-config --listen stdio://`: after the initialize |
| 10 | response and our `initialized`, the server sends, on EVERY start: |
| 11 | |
| 12 | {"method":"remoteControl/status/changed","params":{"status":"disabled","serverName":"DOCS-T1","installationId":"…","environmentId":null}} |
| 13 | {"method":"account/updated","params":{"authMode":"chatgpt","planType":"promax"}} |
| 14 | |
| 15 | and only then the `account/read` response (id 2, account.type "chatgpt", |
| 16 | email set). Today: |
| 17 | - internal/runner/provider/login_probe.go `call` skips only |
| 18 | remoteControl/status/changed, so the guide stops with |
| 19 | provider_identity_mismatch right after a successful `codex login`. |
| 20 | - internal/runner/provider/codex/launcher.go:414 preflight returns |
| 21 | ErrIdentity on any account/updated, and :752 returns ErrContainment on |
| 22 | any account/updated event. If the startup notice reaches those, every |
| 23 | Codex run fails. |
| 24 | |
| 25 | Fix (controller decision): |
| 26 | - R1: the startup notice is benign only when ALL hold: no id, |
| 27 | method account/updated, params.authMode == "chatgpt", and it arrives |
| 28 | before the first turn is started (before any turn/start request is sent) |
| 29 | or before the account/read response in the probe. planType is ignored. |
| 30 | Accept at most one such notice per process start. Anything else |
| 31 | (second notice, other authMode, after a turn starts, carrying an id) |
| 32 | keeps today's refusal. Apply in login_probe.go, the launcher preflight, |
| 33 | and the session event path at :752 only if the startup notice can reach |
| 34 | it (trace it; say which). Check the direct-live driver and certification |
| 35 | code for the same pattern and fix consistently. |
| 36 | - R2: provider.LoginEnvironment (login_terminal.go:55) must not pass |
| 37 | `TMPDIR=` when TMPDIR is unset or empty (codex then prints a warning that |
| 38 | breaks the `--version` check). Also compare `--version` against stdout |
| 39 | only, not merged stderr, in internal/tryequipo/prerequisites.go if the |
| 40 | command helper allows it cheaply; otherwise leave it. |
| 41 | - R3: tests with the recorded frames above (installationId fake) for the |
| 42 | probe, preflight and session path, plus refusal cases from R1. Update |
| 43 | TestCodexPreflightNotification as needed. Any fake app-server fixtures |
| 44 | in tryequipo tests that should emit the startup notice should. |
| 45 | - R4: targeted tests, then ONE full `make -k ci`; fix and rerun at most |
| 46 | twice. Remap scripts/runner-reference-allowlist.json hashes if needed. |
| 47 | |
| 48 | Rules: commit subject < 80 chars, body |
| 49 | `Co-Authored-By: Astra <noreply@openai.com>`, push to |
| 50 | `codex-startup-notice`. Go caches at defaults, no copy-review server, |
| 51 | scratch under $TMPDIR removed, tests must not require TMPDIR. Print a |
| 52 | three-line summary naming which code paths saw the startup notice. |
| 53 | |