Add app-server client protocol#19
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f25c4c1e39
ℹ️ 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".
f25c4c1 to
fea5aed
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3730553f08
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be0d9fc8cc
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 453fb54b60
ℹ️ 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".
| "inputTokens": Number(input_tokens, ..), | ||
| "cachedInputTokens": Number(cached_input_tokens, ..), | ||
| "outputTokens": Number(output_tokens, ..), | ||
| "reasoningOutputTokens": Number(reasoning_output_tokens, ..), |
There was a problem hiding this comment.
Accept token usage payloads without reasoning tokens
When the server emits thread/tokenUsage/updated, the v2 Usage payload contains the standard token fields (inputTokens, cachedInputTokens, outputTokens) and does not always include reasoningOutputTokens. Requiring that field here makes normal usage notifications fail JSON decoding; in the reader pump that exception closes the event/request queues and drops the connection for resumed or active threads that report usage. Treat the reasoning count as optional/defaulted instead of mandatory.
Useful? React with 👍 / 👎.
| executable_path, | ||
| ["--listen", "stdio://"], |
There was a problem hiding this comment.
Launch the documented Codex app-server command
With no override, this runs the default executable as codex-app-server --listen stdio://, but the Codex CLI installed by the README exposes the app server as the codex app-server subcommand. In the default installation path this means with_app_server fails before any handshake unless callers provide a custom wrapper; the SDK should launch codex with the app-server subcommand or otherwise make the argv configurable together with the executable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f96c253267
ℹ️ 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".
| guard value | ||
| is { | ||
| "id": String(id), | ||
| "sessionId": String(session_id), | ||
| "status": status, |
There was a problem hiding this comment.
Stop requiring sessionId on Thread payloads
When decoding any Thread returned by thread/list, thread/start, thread/read, or thread/started, this guard requires sessionId, but the app-server v2 Thread schema for the targeted Codex 0.128 protocol does not include that field. A normal thread payload with id, status, preview, etc. is therefore rejected with JsonDecodeError, making the main typed thread APIs and thread notifications unusable even after the request itself succeeds.
Useful? React with 👍 / 👎.
Summary
Validation