diegosouzapw/OmniRoute · error · Error
Native Codex thread_id and turn_id are required
Error message
Native Codex thread_id and turn_id are required
What it means
Guard in the chatgpt-web-codex response-state logic: extractChatGptTurnIdentity(parsed) failed to yield both a threadId and a turnId for the native Codex request. The parsed request body is at fault — it is missing or has malformed native identifiers, so previous-response state cannot be namespaced per connection.
Solutions
- Ensure the client sends well-formed native Codex thread_id and turn_id in the request
- Regenerate the request instead of replaying a partially-copied payload
- Update the Codex client so its requests always carry both identifiers
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at open-sse/executors/chatgpt-web-codex.ts:114 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/0696cc2ded2b4eeb.
Report an issue: GitHub.
Appendix: source
Thrown at open-sse/executors/chatgpt-web-codex.ts:114
const candidates = [
explicit,
process.env.CHATGPT_WEB_CODEX_CHROME_PATH,
process.env.CHROME_PATH,
"/usr/bin/google-chrome",
"/usr/bin/google-chrome-stable",
"/usr/bin/chromium",
"/usr/bin/chromium-browser",
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
];
return candidates.find((candidate): candidate is string =>
Boolean(candidate && existsSync(candidate))
);
}
function responseStateNamespace(connectionId: string, parsed: CodexParsedRequest): string {
const identity = extractChatGptTurnIdentity(parsed);
if (!identity.threadId || !identity.turnId) {
throw new Error("Native Codex thread_id and turn_id are required");
}
return `${connectionId}:${identity.threadId}:${identity.turnId}`;
}
function previousResponseBelongsToTurn(
body: Record<string, unknown>,
connectionId: string,
parsed: CodexParsedRequest
): boolean {
if (typeof body.previous_response_id !== "string" || !body.previous_response_id.trim()) {
return true;
}
try {
const namespace = responseStateNamespace(connectionId, parsed);
const expanded = expandPreviousResponseInput(body, namespace);
return expanded !== body;
} catch {
return false;View on GitHub (pinned to a179ffed5b)