Files
codex/codex-rs/app-server-protocol/schema/json/v2/ThreadSampleTextDeltaNotification.json
T
Dylan Hurd 350d8a47c4 Stream provisional text from thread/sample (#65167)
## Why

Clients had to wait for the entire sample before they could display any
assistant text.

## What changed

Set `stream: true` to receive `thread/sample/textDelta` notifications
while a sample is in progress. Each notification goes to the requesting
connection and carries the original JSON-RPC `requestId` and a text
`delta`. The stream excludes commentary and reasoning.

The final RPC response still provides the complete sample and token
usage. Discard provisional text if the request fails or the final
`text` is null. Omitting `stream` or setting it to `false` returns
only the final response.

## Testing

Integration tests cover deltas arriving before completion, text supplied
only when an output item completes, and custom tool calls producing a
null sample even after provisional text has been streamed.

GitOrigin-RevId: b2ad960420ce7789722e03f9f283781030cf61fb
2026-12-02 04:56:45 +00:00

36 lines
745 B
JSON
Generated

{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"RequestId": {
"anyOf": [
{
"type": "string"
},
{
"format": "int64",
"type": "integer"
}
]
}
},
"properties": {
"delta": {
"description": "Provisional text. The final RPC response determines whether the sample is usable.",
"type": "string"
},
"requestId": {
"allOf": [
{
"$ref": "#/definitions/RequestId"
}
],
"description": "The ID of the `thread/sample` request on this connection."
}
},
"required": [
"delta",
"requestId"
],
"title": "ThreadSampleTextDeltaNotification",
"type": "object"
}