You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: codex-rs/app-server/README.md
+24-17Lines changed: 24 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ The JSON-RPC API exposes dedicated methods for managing Codex conversations. Thr
65
65
-`thread/archive` — move a thread’s rollout file into the archived directory; returns `{}` on success.
66
66
-`turn/start` — add user input to a thread and begin Codex generation; responds with the initial `turn` object and streams `turn/started`, `item/*`, and `turn/completed` notifications.
67
67
-`turn/interrupt` — request cancellation of an in-flight turn by `(thread_id, turn_id)`; success is an empty `{}` response and the turn finishes with `status: "interrupted"`.
68
-
-`review/start` — kick off Codex’s automated reviewer for a thread; responds like `turn/start` and emits a `item/completed`notification with a `codeReview` item when results are ready.
68
+
-`review/start` — kick off Codex’s automated reviewer for a thread; responds like `turn/start` and emits `item/started`/`item/completed`notifications with `enteredReviewMode` and `exitedReviewMode` items, plus a final assistant `agentMessage` containing the review.
69
69
70
70
### 1) Start or resume a thread
71
71
@@ -190,49 +190,56 @@ Use `review/start` to run Codex’s reviewer on the currently checked-out projec
190
190
-`{"type":"baseBranch","branch":"main"}` — diff against the provided branch’s upstream (see prompt for the exact `git merge-base`/`git diff` instructions Codex will run).
191
191
-`{"type":"commit","sha":"abc1234","title":"Optional subject"}` — review a specific commit.
192
192
-`{"type":"custom","instructions":"Free-form reviewer instructions"}` — fallback prompt equivalent to the legacy manual review request.
193
-
-`appendToOriginalThread` (bool, default `false`) — when `true`, Codex also records a final assistant-style message with the review summary in the original thread. When `false`, only the `codeReview` item is emitted for the review run and no extra message is added to the original thread.
193
+
-`delivery` (`"inline"` or `"detached"`, default `"inline"`) — where the review runs:
194
+
-`"inline"`: run the review as a new turn on the existing thread. The response’s `reviewThreadId` equals the original `threadId`, and no new `thread/started` notification is emitted.
195
+
-`"detached"`: fork a new review thread from the parent conversation and run the review there. The response’s `reviewThreadId` is the id of this new review thread, and the server emits a `thread/started` notification for it before streaming review items.
For a detached review, use `"delivery": "detached"`. The response is the same shape, but `reviewThreadId` will be the id of the new review thread (different from the original `threadId`). The server also emits a `thread/started` notification for that new thread before streaming the review turn.
219
+
213
220
Codex streams the usual `turn/started` notification followed by an `item/started`
214
-
with the same `codeReview` item id so clients can show progress:
221
+
with an `enteredReviewMode` item so clients can show progress:
215
222
216
223
```json
217
224
{ "method": "item/started", "params": { "item": {
218
-
"type": "codeReview",
225
+
"type": "enteredReviewMode",
219
226
"id": "turn_900",
220
227
"review": "current changes"
221
228
} } }
222
229
```
223
230
224
-
When the reviewer finishes, the server emits `item/completed` containing the same
225
-
`codeReview` item with the final review text:
231
+
When the reviewer finishes, the server emits `item/started` and `item/completed`
232
+
containing an `exitedReviewMode` item with the final review text:
The `review` string is plain text that already bundles the overall explanation plus a bullet list for each structured finding (matching `ThreadItem::CodeReview` in the generated schema). Use this notification to render the reviewer output in your client.
242
+
The `review` string is plain text that already bundles the overall explanation plus a bullet list for each structured finding (matching `ThreadItem::ExitedReviewMode` in the generated schema). Use this notification to render the reviewer output in your client.
0 commit comments