A Codex title request through a Responses relay (CPA) failed with
"X-OpenAI-Internal-Codex-Responses-Lite requires reasoning.context to be
all_turns". fromLite took Lite's shape off for a backend that isn't
OpenAI's: it lifted additional_tools, left reasoning.context out and
didn't send the Lite header on. But over a websocket Codex says it is
Lite a second way, in client_metadata
(ws_request_header_x_openai_internal_codex_responses_lite: "true",
codex-rs client.rs build_ws_client_metadata). magpie left that marker
in, so the relay still read the request as Lite and passed it to the
ChatGPT backend without the context it had been told to expect.
fromLite now also drops that one client_metadata key
(withoutLiteMetadata). Every other client_metadata entry, the
instructions and the identity line go as Codex sent them.
Reported by ChangQiu on Discord and filed as #4853 by ZyphrZero. The
withoutLiteMetadata patch and its two tests are ported from
ZyphrZero's fork commit 7f67c732. TestCodexSocketLiteTurnLeavesLiteForARelay
is new: it sends #4853's title request through passthrough to a fake
relay and checks that the marker, the context and the header are all gone.
Run on mote at this head:
- the three new tests plus TestLiteSubagentLeavesLite and the
additional_tools tests: ok
- go test -timeout 45m ./internal/gateway: one red,
TestCodexPoolSaysTheClientsVersion (#4807). It passes 3/3 alone here
and on origin/main.
- go vet ./internal/gateway with GOOS=linux, windows and darwin: clean.
gofmt -l: clean.
Broken by hand: with withoutLiteMetadata stubbed to return its input,
all three new tests went red.
Not tried: a real CPA, or a real Codex websocket session through magpie.