C.W.K.
Stream
Lesson 02 of 06 · published

Codex 변형 — OAuth + 직접 httpx

~13 min · codex, openai, oauth

Level 0호기심
0 XP0/65 lessons0/17 achievements
0/100 XP to next level100 XP to go0% complete

ChatGPT Pro OAuth, openai SDK 안 씀

Codex-Pippa 는 openai Python SDK 안 써. Codex CLI 의 OAuth session 의 credential 읽어서, OpenAI token endpoint 통해 JWT refresh, provider 의 response endpoint 에서 httpx SSE 로 stream 해.

왜 직접 httpx

openai SDK 가 Codex backend API 를 직접 못 말해 — 그 endpoint 는 ChatGPT 자체가 쓰는 그거. SDK 우회하면 wire format quirk (instructions field, store: false, max_output_tokens unsupported) 의 full control.

multi-turn function calling

매 turn 마다 full history replay. 2026-05-14 이후로는 Claude 도 똑같이 매 turn replay 야 (vessels lesson 1 의 EvNote 참고). Tool call 은 cwkPippa 의 local tool_bridge.py 거치고 — Claude 랑 같은 코드 path. variant 별인 건 wire-format 변환뿐 (Claude 대신 OpenAI tool schema).

전쟁 이야기: Codex wire format 에 surprise 셋: instructions 가 top-level 로 들어가야 함 (input 의 developer role 아니라), store: false mandatory, max_output_tokens unsupported. 각각 ChatGPT 자체가 보내는 정확한 wire format 매치하기 전까지 400 에러.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고
💛 by 똘이warm💛 by 피파warm

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.