Files
OmniRoute/tests
diegosouzapw e833555075 fix(sse): synthesize the native Codex turn envelope for chatgpt-session
The executor passed the OpenAI chat-completions body through as `_rawBody`, but the
vendored browser adapter reads `_rawBody` as a native Codex Responses body and demands
turn identity from it. Every request therefore failed with "ChatGPT web requires native
Codex turn_id metadata for browser-session replay" before any browser work started; no
unit test caught it because they all mock the adapter call.

`buildParsedRequest` now builds the envelope itself: a fresh thread/turn id pair per
request (this provider serves stateless chat completions, so each request genuinely is
its own turn), the turn metadata as the JSON string the real client sends, an `input`
array mirroring the parsed messages in Responses item shape, and the current-turn
passthrough marker on the last user item only. The `rawBody` parameter is gone so no
caller can reintroduce the passthrough.

Verified against the real adapter through the production code path: the turn now reaches
stage=browser_page and fails only on the missing login state.
2026-09-02 18:32:31 -03:00
..
2026-08-26 14:25:01 -03:00