mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-14 10:52:17 +03:00
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.