Document ChatGPT auth flows, WHAM endpoints, and inference request/response shapes#2
Document ChatGPT auth flows, WHAM endpoints, and inference request/response shapes#2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 836e4b6b52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - Response body (JSON): | ||
| - `device_auth_id` (string) | ||
| - `user_code` (string; also accepts `usercode`) | ||
| - `interval` (string or number; parsed as seconds)【F:codex-rs/login/src/device_code_auth.rs†L25-L52】 |
There was a problem hiding this comment.
Document interval as string only (number parsing fails)
This line says the device-code interval can be a string or number, but codex-rs/login/src/device_code_auth.rs parses it with String::deserialize in deserialize_interval, which rejects numeric JSON values. If the server returns a numeric interval (a common OAuth device-code response pattern), login will fail to parse. Either update the doc to say the value must be a string or update the deserializer to accept numbers; otherwise implementers will be misled.
Useful? React with 👍 / 👎.
Motivation
API_SPEC.mdto explicitly cover ChatGPT OAuth/device‑code login flows and all downstream WHAM and inference APIs used whenAuthMode::ChatGPTis active.wire_apiconfiguration.Description
API_SPEC.mdwith complete request and response field lists for OAuth authorize andPOST /oauth/token(authorization code and token‑exchange flows) and the device code endpoints, including exact form/json fields and returned tokens.GET /wham/usage(RateLimitStatusPayloadand nested objects),GET /wham/tasks/list(PaginatedListTaskListItemandTaskListItem),GET /wham/tasks/{task_id}(CodeTaskDetailsResponse,Turn,TurnItem,Worklog,TurnError),POST /wham/tasks(request body shape produced by the Cloud Tasks client), and sibling turns endpoint shape./backend-api/codexincludingGET /modelsresponse (ModelsResponseandModelInfofields),POST /responsesandPOST /chat/completionsrequest fields, and theresponses_websockettransport behavior and handshake headers.ResponseEventvariants andResponseItemvariants) used by Codex to consume SSE/WebSocket/Chat streaming, and linked these to in‑repo types and builders.Testing
Codex Task