Open-source inference server and production cluster for all the models your agent needs.
Python bgecolbertdata-pipelinedeep-learningembeddingsinferenceinference-serverinformation-retrievalllmmlmlopsnatural-language-processingnlppythonrerankingretrievalretrieval-augmented-generationsemantic-searchspladevector-search
test: add /v1/responses conformance vectors for the translation onto chat completions (#1014)
Krisztian Gajdar7bced512f95f
diff --git a/conformance/openai_responses/README.md b/conformance/openai_responses/README.mdnew file mode 100644index 000000000..a73d5672a--- /dev/null+++ b/conformance/openai_responses/README.md@@ -0,0 +1,258 @@+# OpenAI Responses conformance vectors++`POST /v1/responses` is served by translating the request onto+`/v1/chat/completions` and serving it in process with the chat route of the+topology (the gateway, or `sie-server` without a gateway), then translating the+answer back. This is the shape of the Anthropic Messages endpoint+(`/v1/messages`, [#753](https://github.com/superlinked/sie/pull/753) and+[#815](https://github.com/superlinked/sie/pull/815)): every chat gate, limit, timeout and meter+applies unchanged, and errors use the OpenAI envelope+`{"error":{"message","type","param","code"}}` that chat already uses.++The files here are the executable specification for that translation+([#1013](https://github.com/superlinked/sie/issues/1013)). The gateway and `sie-server` implementations both+replay every file, so a request is accepted, refused and answered the same way+on both.++| File | Contents |+|---|---|+| `request_vectors.json` | `accepted`: a Responses body and the exact chat body it becomes. `rejected`: a Responses body and the refusal (`status`, `type`, `code`, `param`, `message`). |+| `response_vectors.json` | A chat completion, the Responses request it answers, and the Response it becomes. |+| `stream_vectors.json` | Chat SSE `data` payloads (JSON chunks and the literal `"[DONE]"`) and the Responses events they become. |+| `error_vectors.json` | A chat error answer returned before the stream opens and the answer `/v1/responses` returns. |+| `codex_requests.json` | Requests Codex CLI 0.167.0 sent, scrubbed, with the expected refusal or a summary of the translated chat body. |++Every accepted chat body must also pass the chat route's own validation.+`created_at` is the only nondeterministic field of an answer; the vectors use+`0` and tests inject the clock. Item ids derive from the request id: the+response is `resp-<request_id>`, the message item `msg-<request_id>`, and the+tool call at position `k` (0-based) `fc-<request_id>-<k>` or+`ctc-<request_id>-<k>`. In a stream, a message item that follows a tool call is+`msg-<request_id>-<output_index>`.++## Request++### Top-level fields++| Responses field | Chat body |+|---|---|+| `model` (required string) | `model` |+| `input` (required: a string, or a non-empty array of items) | `messages` |+| `instructions` (string or null) | first part of the leading system message |+| `max_output_tokens` (positive integer) | `max_completion_tokens`; omitted when absent or null |+| `temperature`, `top_p`, `seed` | same name; chat validates them |+| `stream` (boolean) | `stream`; when true also `"stream_options": {"include_usage": true}` |+| `tools` | `tools`; an empty list is omitted |+| `tool_choice` | `tool_choice` |+| `parallel_tool_calls` | `parallel_tool_calls` |+| `reasoning.effort` | `reasoning_effort`, passed as sent; chat validates it |+| `text.format` | `{"type":"text"}`: nothing. `{"type":"json_object"}`: `response_format: {"type":"json_object"}`. `{"type":"json_schema","name","schema","strict"?,"description"?}`: `response_format: {"type":"json_schema","json_schema":{"name","schema","strict"?,"description"?}}` |+| `metadata`, `prompt_cache_key`, `user`, `safety_identifier`, `service_tier` | same name, passed through |++Every chat body carries `"include_reasoning": false`, so model thinking stays+private, and `"stream"` (false when absent). An accepted field sent as `null`+is treated as absent.++Accepted with no effect and never logged: `store` false, `background` false,+`truncation: "disabled"`, `include` when every element is+`"reasoning.encrypted_content"`, `client_metadata`, `reasoning.summary`,+`reasoning.generate_summary` and `text.verbosity`.++### Refusals++A refusal is a 400 with `type: "invalid_request_error"`, a `param` naming the+field as the caller sent it, and the message `"<param>: <reason>"`.++`code: "unsupported_field"`:++- `store: true`, and a non-null `previous_response_id` or `conversation`:+ `SIE does not store responses; send the full conversation in input`.+- `background: true`: `background responses are not supported`.+- `truncation` other than `"disabled"`: `only "disabled" is supported`.+- An `include` element other than `"reasoning.encrypted_content"`: param+ `include[i]`, `'<value>' is not supported`.+- `prompt`, `max_tool_calls`, `top_logprobs`, `stream_options`, any other+ unknown top-level field, and an unknown key in `reasoning`, `text`,+ `text.format`, a tool, an input item or a content part:+ `Extra inputs are not permitted`.+- An unknown `text.format.type`: `'<type>' is not supported`.+- The input item, part, tool and `tool_choice` refusals below.++`code: "invalid_request"`: a missing `model` or `input` (`Field required`), an+empty `input` list, a value of the wrong type or range (for example+`max_output_tokens: "16"` or `0`), an unknown role, and a named `tool_choice`+whose tool is not declared.++### Input items++A string `input` becomes one user message. In an array, an object with `role`+and no `type` is a message. The accepted item types are `message`,+`function_call`, `function_call_output`, `custom_tool_call`,+`custom_tool_call_output` and `reasoning`; every item may carry `id` and+`status`, which are ignored. Any other type is refused with param+`input[i].type`: `items of type '<type>' are not supported`.++- **System text.** `instructions`, then every `system` and `developer` message+ that comes before the first item of another kind, joined with `"\n\n"`,+ form one leading chat system message. A `system` or `developer` message+ after that is translated in place as a chat `system` message.+- **Content.** `content` is a string or a list of parts: `input_text`,+ `output_text` (its `annotations` and `logprobs` are ignored), `text`, and,+ in user messages only, `input_image`. Texts are concatenated without a+ separator. A message with an image becomes a list of chat `text` and+ `image_url` parts in order, adjacent texts joined and empty texts dropped.+ `input_image` takes a base64 `data:` URL (`detail` is ignored); an http(s)+ URL or a `file_id` is refused at that field with+ `only base64 data: URLs are supported`. Other part types (`input_file`,+ `input_audio`, `refusal` and the rest) are refused with param+ `input[i].content[j].type`.+- **Roles.** `user` and `assistant` keep their role; `system` and `developer`+ become `system`. Any other role is refused.+- **Assistant output.** An assistant message and the `function_call` and+ `custom_tool_call` items next to it become one chat assistant message: the+ concatenated text (`null` when there is none and there are calls) and the+ calls in order. A `function_call` becomes+ `{"id": call_id, "type": "function", "function": {"name", "arguments"}}` with+ `arguments` as sent; a `custom_tool_call` passes its `input` as the+ arguments `{"input": <input>}`, serialized as compact JSON.+- **Tool outputs.** `function_call_output` and `custom_tool_call_output` become+ `{"role": "tool", "tool_call_id": call_id, "content": <text>}`. `output` is a+ string or a list of text parts (concatenated) and `input_image` parts. The+ images of a run of consecutive tool outputs become one chat user message+ right after that run's tool messages. When the next item is a user message,+ its content follows the images in that same message, as `/v1/messages` does.+- **Reasoning.** `reasoning` items are dropped. They do not end a run of+ assistant output or of tool outputs.++### Tools and tool_choice++- `{"type":"function","name","description"?,"parameters"?,"strict"?}` becomes+ `{"type":"function","function":{"name","description"?,"parameters"?}}`.+ `strict: false` is accepted and dropped; `strict: true` is refused at+ `tools[i].strict`: `strict function schemas are not supported`.+- `{"type":"custom","name","description"?,"format"?}` becomes a function whose+ parameters are one required string `input`. `format` is accepted and not+ enforced. A call to a custom tool comes back as a `custom_tool_call` item.+- Every other tool type (`web_search`, `web_search_preview`, `file_search`,+ `code_interpreter`, `computer_use_preview`, `mcp`, `local_shell`,+ `image_generation`, `namespace` and unknown types) is refused at+ `tools[i].type`: `'<type>' tools are not supported; send function or custom tools`.+- Tool names and the tool count are checked by the chat route (64 tools, names+ matching `^[a-zA-Z0-9_-]{1,64}$`); its error comes back with the param+ `tools[i].function.name` renamed to `tools[i].name` (see [Errors](#errors)).+- `tool_choice` `"auto"`, `"none"` and `"required"` pass through.+ `{"type":"function","name"}` and `{"type":"custom","name"}` become+ `{"type":"function","function":{"name"}}`; the name must be a declared tool.+ `{"type":"allowed_tools"}` and hosted-tool choices are refused at+ `tool_choice.type`. Without tools, `"auto"` and `"none"` are dropped.++## Buffered answer++A chat completion with the content `"Hello."` for request `r1` becomes:++```json+{+ "id": "resp-r1", "object": "response", "created_at": 0,+ "model": "m", "status": "completed",+ "incomplete_details": null, "error": null, "store": false,+ "parallel_tool_calls": true, "tool_choice": "auto",+ "output": [+ {"type": "message", "id": "msg-r1", "role": "assistant", "status": "completed",+ "content": [{"type": "output_text", "text": "Hello.", "annotations": []}]}+ ],+ "usage": {+ "input_tokens": 10, "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 3, "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 13+ }+}+```++`model` is the model the request named. `parallel_tool_calls` and+`tool_choice` echo the request as sent, defaulting to `true` and `"auto"`. `output` holds a `message` item with one `output_text`+part when the chat content is non-empty, then one item per tool call: a+`function_call` with the arguments string, or a `custom_tool_call` whose+`input` is the `input` string of the arguments, or the raw arguments when they+are not a JSON object with a string `input`. The finish reasons `length` and+`content_filter` make the response `incomplete` with+`incomplete_details.reason` `max_output_tokens` or `content_filter`; every+other finish reason (`stop`, `tool_calls` or any other value) completes it. Usage is `input_tokens`, `input_tokens_details.cached_tokens`,+`output_tokens`, `output_tokens_details.reasoning_tokens` and `total_tokens`+from the chat usage, with absent details counted as 0.++## Streaming++Each event is sent as `event: <type>` and `data: <JSON>`. Every `data` object+carries `type`, equal to the event name, and `sequence_number`, counting from+0. Lifecycle events (`response.created`, `response.in_progress`,+`response.completed`, `response.incomplete`, `response.failed`) carry only+`response`, the buffered-answer object, which is `in_progress` with an empty+`output` and `usage: null` until the terminal event. `output_item.added` and+`output_item.done` carry `output_index` and `item`. The other item events carry+`item_id` and `output_index`, and the text and content-part events also carry+`content_index: 0`.++1. `response.created` and `response.in_progress` open the stream.+2. The first non-empty text delta adds the message item and its `output_text`+ part; each text delta is a `response.output_text.delta`.+3. Text ends at the first tool-call delta or at the finish:+ `output_text.done`, `content_part.done`, `output_item.done`. Text that+ arrives after a tool call ends that call and opens a new message item at+ the next `output_index`, with id `msg-<request_id>-<output_index>`.+4. Each new chat tool call adds a `function_call` item with empty arguments,+ then one `function_call_arguments.delta` per non-empty arguments fragment.+ A custom tool call adds a `custom_tool_call` item; its fragments are+ buffered and sent at the end as one `custom_tool_call_input.delta` with the+ decoded input. A call ends at the next call or at the finish with+ `function_call_arguments.done` (or `custom_tool_call_input.done`) and+ `output_item.done`.+5. After the usage chunk and `[DONE]`, `response.completed` (or+ `response.incomplete` for a `length` or `content_filter` finish) carries the+ full answer; a chat stream that closes after a finish without `[DONE]` ends+ the same way. The stream ends there, without a `[DONE]` frame of its own.+6. A chat error chunk after the stream opened becomes `response.failed` with+ `status: "failed"`, `error: {"code", "message"}` from the chat error, the+ items completed so far as `output` (an item still open is left out) and+ `usage: null`, and the stream ends.+7. A chat stream that ends without a finish reason fails the same way with+ `error: {"code": "server_error", "message": "the generation stream ended without a finish reason"}`,+ and one that breaks with+ `error: {"code": "server_error", "message": "the generation stream ended unexpectedly"}`.+8. Tool-call chunks are routed by their chat `index`, as on `/v1/messages`. A+ call starts at the first chunk for an index the stream has not used; that+ chunk must carry the call `id` and function `name`, otherwise the stream+ fails with `server_error` and+ `"a tool call arrived without its id and name"`. A non-empty arguments+ fragment for a call whose item has already closed, because a later call or+ text started, fails the stream with `server_error` and+ `"tool call arguments arrived after another output item started"`.++## Errors++A chat error returned before the stream opens is returned as it is: the same+status, `Retry-After` and `x-sie-error-code` headers, and OpenAI error body.+The route adds no header of its own. The only change is the `param` when it+names a chat field, which is renamed to the Responses field the caller sent;+the message keeps the chat route's wording.++| Chat `param` | Responses `param` |+|---|---|+| `tools[i].function.<path>` | `tools[i].<path>` |+| `max_completion_tokens` | `max_output_tokens` |+| `reasoning_effort` | `reasoning.effort` |+| `response_format` | `text.format` |+| `response_format.json_schema.<path>` | `text.format.<path>` |++Every other param, for example `messages[i].content[j].image_url`, is returned+unchanged.++## Codex CLI requests++`codex_requests.json` holds requests Codex CLI 0.167.0 sent in headless runs+against a local stub; no model was called. Developer instructions and the+environment context are replaced by placeholders with their original length;+ids, UUIDs, `client_metadata` values and local paths are replaced; headers are+dropped. Tool definitions and the `input_image` data URL are as captured. With+Codex's default configuration the request carries a `namespace` tool and a+`web_search` tool and is refused at the first of them; with web search,+multi-agent and goal tools turned off, every request translates.diff --git a/conformance/openai_responses/codex_requests.json b/conformance/openai_responses/codex_requests.jsonnew file mode 100644index 000000000..88cc3b7df--- /dev/null+++ b/conformance/openai_responses/codex_requests.json@@ -0,0 +1,1939 @@+{+ "description": "Requests Codex CLI sent to POST /v1/responses in headless runs (codex exec) against a local stub that answered canned Responses streams; no model was called. Developer instructions and the environment context are placeholders with their original length, ids, UUIDs, client_metadata values and local paths are replaced, and headers are dropped. Tool definitions and input_image data URIs are as captured. expect.refused is the refusal; expect.chat summarizes the translated chat body.",+ "client": "codex-cli 0.167.0",+ "requests": [+ {+ "name": "default config",+ "config": "Codex defaults with only the SIE provider block (wire_api = \"responses\"): web search, multi-agent and goal tools are on",+ "body": {+ "model": "zai-org/GLM-5.3-Flash",+ "stream": true,+ "input": [+ {+ "type": "message",+ "id": "msg_1",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 16979 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_2",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 7893 characters>"+ },+ {+ "type": "input_text",+ "text": "<codex developer instructions, 341 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_3",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "<codex environment context, 764 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_4",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "Say hello."+ }+ ]+ }+ ],+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Runs a command in a PTY, returning output or a session ID for ongoing interaction.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string",+ "description": "Shell command to execute."+ },+ "justification": {+ "type": "string",+ "description": "User-facing approval question for `require_escalated`; omit otherwise."+ },+ "login": {+ "type": "boolean",+ "description": "True runs the shell with -l/-i semantics; false disables them. Defaults to true."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "prefix_rule": {+ "type": "array",+ "description": "Reusable approval prefix for `cmd`, only with `sandbox_permissions: \"require_escalated\"`; for example [\"git\", \"pull\"].",+ "items": {+ "type": "string"+ }+ },+ "sandbox_permissions": {+ "type": "string",+ "description": "Per-command sandbox override. Defaults to `use_default`; use `require_escalated` for unsandboxed execution.",+ "enum": [+ "use_default",+ "require_escalated"+ ]+ },+ "shell": {+ "type": "string",+ "description": "Shell binary to launch. Defaults to the user's default shell."+ },+ "tty": {+ "type": "boolean",+ "description": "True allocates a PTY for the command; false or omitted uses plain pipes."+ },+ "workdir": {+ "type": "string",+ "description": "Working directory for the command. Defaults to the turn cwd."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms."+ }+ },+ "required": [+ "cmd"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "write_stdin",+ "description": "Writes characters to an existing unified exec session and returns recent output.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "chars": {+ "type": "string",+ "description": "Bytes to write to stdin. Defaults to empty, which polls without writing."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "session_id": {+ "type": "number",+ "description": "Identifier of the running unified exec session."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Non-empty writes default to 250 ms and cap at 30000 ms; empty polls wait 5000-300000 ms by default."+ }+ },+ "required": [+ "session_id"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "request_user_input",+ "description": "Request user input for one to three short questions and wait for the response. This tool is only available in Plan mode.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "questions": {+ "type": "array",+ "description": "Questions to show the user. Prefer 1 and do not exceed 3",+ "items": {+ "type": "object",+ "properties": {+ "header": {+ "type": "string",+ "description": "Short header label shown in the UI (12 or fewer chars)."+ },+ "id": {+ "type": "string",+ "description": "Stable identifier for mapping answers (snake_case)."+ },+ "options": {+ "type": "array",+ "description": "Provide 2-3 mutually exclusive choices. Put the recommended option first and suffix its label with \"(Recommended)\". Do not include an \"Other\" option in this list; the client will add a free-form \"Other\" option automatically.",+ "items": {+ "type": "object",+ "properties": {+ "description": {+ "type": "string",+ "description": "One short sentence explaining impact/tradeoff if selected."+ },+ "label": {+ "type": "string",+ "description": "User-facing label (1-5 words)."+ }+ },+ "required": [+ "label",+ "description"+ ],+ "additionalProperties": false+ }+ },+ "question": {+ "type": "string",+ "description": "Single-sentence prompt shown to the user."+ }+ },+ "required": [+ "id",+ "header",+ "question",+ "options"+ ],+ "additionalProperties": false+ }+ }+ },+ "required": [+ "questions"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "view_image",+ "description": "View a local image file from the filesystem when visual inspection is needed. Use this for images already available on disk.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "path": {+ "type": "string",+ "description": "Local filesystem path to an image file."+ }+ },+ "required": [+ "path"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "namespace",+ "name": "multi_agent_v1",+ "description": "Tools for spawning and managing sub-agents.",+ "tools": [+ {+ "type": "function",+ "name": "close_agent",+ "description": "Close an agent and any open descendants when they are no longer needed, and return the target agent's previous status before shutdown was requested. Completed agents remain open and count toward the concurrency limit until closed. Don't keep agents open for too long if they are not needed anymore.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "target": {+ "type": "string",+ "description": "Agent id to close (from spawn_agent)."+ }+ },+ "required": [+ "target"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "resume_agent",+ "description": "Resume a previously closed agent by id so it can receive send_input and wait_agent calls.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string",+ "description": "Agent id to resume."+ }+ },+ "required": [+ "id"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "send_input",+ "description": "Send a message to an existing agent. Use interrupt=true to redirect work immediately. You should reuse the agent by send_input if you believe your assigned task is highly dependent on the context of a previous task.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "interrupt": {+ "type": "boolean",+ "description": "True interrupts the current task and handles this message immediately; false or omitted queues it."+ },+ "items": {+ "type": "array",+ "description": "Structured input items. Use this to pass explicit mentions (for example app:// connector paths).",+ "items": {+ "type": "object",+ "properties": {+ "audio_url": {+ "type": "string",+ "description": "Audio data URL when type is audio."+ },+ "image_url": {+ "type": "string",+ "description": "Image URL when type is image."+ },+ "name": {+ "type": "string",+ "description": "Display name when type is skill or mention."+ },+ "path": {+ "type": "string",+ "description": "Path when type is local_image/local_audio/skill, or structured mention target such as app://<connector-id> or plugin://<plugin-name>@<marketplace-name> when type is mention."+ },+ "text": {+ "type": "string",+ "description": "Text content when type is text."+ },+ "type": {+ "type": "string",+ "description": "Input item type: text, image, local_image, audio, local_audio, skill, or mention."+ }+ },+ "additionalProperties": false+ }+ },+ "message": {+ "type": "string",+ "description": "Legacy plain-text message to send to the agent. Use either message or items."+ },+ "target": {+ "type": "string",+ "description": "Agent id to message (from spawn_agent)."+ }+ },+ "required": [+ "target"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "spawn_agent",+ "description": "\n \n Available model overrides (optional; inherited parent model is preferred):\n- `gpt-6.1-sol`: Latest workhorse model for coding and everyday work. Reasoning efforts: low (default), medium, high, xhigh, max, ultra. Service tiers: priority.\n- `gpt-6-astra`: Frontier intelligence for the most demanding work. Reasoning efforts: low (default), medium, high, xhigh, max, ultra. Service tiers: priority.\n- `gpt-6-sol`: Previous generation workhorse model. Reasoning efforts: low, medium (default), high, xhigh, max, ultra. Service tiers: priority.\n- `gpt-6-luna`: Fast and affordable model for easier tasks. Reasoning efforts: low, medium (default), high, xhigh, max. Service tiers: priority.\n- `gpt-5.6-sol`: Older generation workhorse model. Reasoning efforts: low (default), medium, high, xhigh, max, ultra. Service tiers: priority.\n Spawn a sub-agent for a well-scoped task. Returns the spawned agent id plus the user-facing nickname when available. Spawned agents inherit your current model by default. Omit `model` to use that preferred default; set `model` only when an explicit override is needed.\nThis spawn_agent tool provides you access to sub-agents that inherit your current model by default. Do not set the `model` field unless the user explicitly asks for a different model. You should follow the rules and guidelines below to use this tool.\n\nDo not spawn sub-agents unless the user or applicable AGENTS.md/skill instructions explicitly ask for sub-agents, delegation, or parallel agent work.\nRequests for depth, thoroughness, research, investigation, or detailed codebase analysis do not count as permission to spawn.\nAgent-role guidance below only helps choose which agent to use after spawning is already authorized; it never authorizes spawning by itself.\n\n### When to delegate vs. do the subtask yourself\n- First, quickly analyze the overall user task and form a succinct high-level plan. Identify which tasks are immediate blockers on the critical path, and which tasks are sidecar tasks that are needed but can run in parallel without blocking the next local step. As part of that plan, explicitly decide what immediate task you should do locally right now. Do this planning step before delegating to agents so you do not hand off the immediate blocking task to a submodel and then waste time waiting on it.\n- Use a subagent when a subtask is easy enough for it to handle and can run in parallel with your local work. Prefer delegating concrete, bounded sidecar tasks that materially advance the main task without blocking your immediate next local step.\n- Do not delegate urgent blocking work when your immediate next step depends on that result. If the very next action is blocked on that task, the main rollout should usually do it locally to keep the critical path moving.\n- Keep work local when the subtask is too difficult to delegate well and when it is tightly coupled, urgent, or likely to block your immediate next step.\n\n### Designing delegated subtasks\n- Subtasks must be concrete, well-defined, and self-contained.\n- Delegated subtasks must materially advance the main task.\n- Do not duplicate work between the main rollout and delegated subtasks.\n- Avoid issuing multiple delegate calls on the same unresolved thread unless the new delegated task is genuinely different and necessary.\n- Narrow the delegated ask to the concrete output you need next.\n- For coding tasks, prefer delegating concrete code-change worker subtasks over read-only explorer analysis when the subagent can make a bounded patch in a clear write scope.\n- When delegating coding work, instruct the submodel to edit files directly in its forked workspace and list the file paths it changed in the final answer.\n- For code-edit subtasks, decompose work so each delegated task has a disjoint write set.\n\n### After you delegate\n- Call wait_agent very sparingly. Only call wait_agent when you need the result immediately for the next critical-path step and you are blocked until it returns.\n- Do not redo delegated subagent tasks yourself; focus on integrating results or tackling non-overlapping work.\n- While the subagent is running in the background, do meaningful non-overlapping work immediately.\n- Do not repeatedly wait by reflex.\n- When a delegated coding task returns, quickly review the uploaded changes, then integrate or refine them.\n\n### Parallel delegation patterns\n- Run multiple independent information-seeking subtasks in parallel when you have distinct questions that can be answered independently.\n- Split implementation into disjoint codebase slices and spawn multiple agents for them in parallel when the write scopes do not overlap.\n- Delegate verification only when it can run in parallel with ongoing implementation and is likely to catch a concrete risk before final integration.\n- The key is to find opportunities to spawn multiple independent subtasks in parallel within the same round, while ensuring each subtask is well-defined, self-contained, and materially advances the main task.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "fork_context": {+ "type": "boolean",+ "description": "True forks the current thread history into the new agent; false or omitted starts with only the initial prompt."+ },+ "items": {+ "type": "array",+ "description": "Structured input items. Use this to pass explicit mentions (for example app:// connector paths).",+ "items": {+ "type": "object",+ "properties": {+ "audio_url": {+ "type": "string",+ "description": "Audio data URL when type is audio."+ },+ "image_url": {+ "type": "string",+ "description": "Image URL when type is image."+ },+ "name": {+ "type": "string",+ "description": "Display name when type is skill or mention."+ },+ "path": {+ "type": "string",+ "description": "Path when type is local_image/local_audio/skill, or structured mention target such as app://<connector-id> or plugin://<plugin-name>@<marketplace-name> when type is mention."+ },+ "text": {+ "type": "string",+ "description": "Text content when type is text."+ },+ "type": {+ "type": "string",+ "description": "Input item type: text, image, local_image, audio, local_audio, skill, or mention."+ }+ },+ "additionalProperties": false+ }+ },+ "message": {+ "type": "string",+ "description": "Initial plain-text task for the new agent. Use either message or items."+ },+ "model": {+ "type": "string",+ "description": "Model override for the new agent. Omit unless an explicit override is needed."+ },+ "reasoning_effort": {+ "type": "string",+ "description": "Reasoning effort override for the new agent. Omit to inherit the parent effort."+ }+ },+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "wait_agent",+ "description": "Wait for agents to reach a final status. Completed statuses may include the agent's final message. Returns empty status when timed out. Once the agent reaches a final status, a notification message will be received containing the same completed status.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "targets": {+ "type": "array",+ "description": "Agent ids to wait on. Pass multiple ids to wait for whichever finishes first.",+ "items": {+ "type": "string"+ }+ },+ "timeout_ms": {+ "type": "number",+ "description": "Timeout in milliseconds. Defaults to 30000, min 10000, max 3600000. Prefer longer waits (minutes) to avoid busy polling."+ }+ },+ "required": [+ "targets"+ ],+ "additionalProperties": false+ }+ }+ ]+ },+ {+ "type": "function",+ "name": "get_goal",+ "description": "Get the current goal for this thread, including status, budgets, token and elapsed-time usage, and remaining token budget.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {},+ "required": [],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "create_goal",+ "description": "Create a goal only when explicitly requested by the user or system/developer instructions; do not infer goals from ordinary tasks.\nSet token_budget only when an explicit token budget is requested. Fails if an unfinished goal exists; use update_goal only for status.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "objective": {+ "type": "string",+ "description": "Required. The concrete objective to start pursuing. This starts a new active goal when no goal exists or replaces the current goal when it is complete."+ },+ "token_budget": {+ "type": "integer",+ "description": "Positive token budget for the new goal. Omit unless explicitly requested."+ }+ },+ "required": [+ "objective"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "update_goal",+ "description": "Update the existing goal.\nSet status to `paused` only at the user's explicit request to pause this goal, never on your own initiative. Ask if unclear; a later resume revokes that request. Report the returned status and stop goal work. Budget limits take precedence over pausing.\nSet status to `complete` only when the objective has actually been achieved and no required work remains.\nSet status to `blocked` only when the same blocking condition has repeated for at least three consecutive goal turns, counting the original/user-triggered turn and any automatic continuations, and the agent cannot make meaningful progress without user input or an external-state change.\nIf the user resumes a goal that was previously marked `blocked`, treat the resumed run as a fresh blocked audit. If the same blocking condition then repeats for at least three consecutive resumed goal turns, set status to `blocked` again.\nOnce the blocked threshold is satisfied, do not keep reporting that you are still blocked while leaving the goal active; set status to `blocked`.\nDo not use `blocked` merely because the work is hard, slow, uncertain, incomplete, or would benefit from clarification.\nDo not mark a goal complete merely because its budget is nearly exhausted or because you are stopping work.\nYou cannot use this tool to resume, budget-limit, or usage-limit a goal; those status changes are controlled by the user or system.\nWhen marking a budgeted goal achieved with status `complete`, report the final token usage from the tool result to the user.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "status": {+ "type": "string",+ "description": "Required. `paused` requires an explicit user request. Set to `complete` only when the objective is achieved and no required work remains. Set to `blocked` only after the same blocking condition has recurred for at least three consecutive goal turns and the agent is at an impasse. After a previously blocked goal is resumed, the resumed run starts a fresh blocked audit.",+ "enum": [+ "complete",+ "blocked",+ "paused"+ ]+ }+ },+ "required": [+ "status"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "web_search",+ "external_web_access": false+ }+ ],+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "reasoning": {+ "summary": "auto"+ },+ "store": false,+ "include": [+ "reasoning.encrypted_content"+ ],+ "prompt_cache_key": "00000000-0000-4000-8000-000000000001",+ "client_metadata": {+ "session_id": "00000000-0000-4000-8000-000000000001",+ "x-codex-installation-id": "00000000-0000-4000-8000-000000000002",+ "thread_id": "00000000-0000-4000-8000-000000000001",+ "turn_id": "00000000-0000-4000-8000-000000000003",+ "x-codex-turn-metadata": "<codex turn metadata, 978 characters>",+ "root_turn_id": "00000000-0000-4000-8000-000000000003",+ "x-codex-window-id": "00000000-0000-4000-8000-000000000001:0"+ }+ },+ "expect": {+ "refused": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[4].type",+ "message": "tools[4].type: 'namespace' tools are not supported; send function or custom tools"+ }+ }+ },+ {+ "name": "recommended config",+ "config": "the SIE provider block with web search, multi-agent and goal tools turned off",+ "body": {+ "model": "zai-org/GLM-5.3-Flash",+ "stream": true,+ "input": [+ {+ "type": "message",+ "id": "msg_5",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 16979 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_6",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 7893 characters>"+ },+ {+ "type": "input_text",+ "text": "<codex developer instructions, 341 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_7",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "<codex environment context, 764 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_8",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "Say hello."+ }+ ]+ }+ ],+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Runs a command in a PTY, returning output or a session ID for ongoing interaction.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string",+ "description": "Shell command to execute."+ },+ "justification": {+ "type": "string",+ "description": "User-facing approval question for `require_escalated`; omit otherwise."+ },+ "login": {+ "type": "boolean",+ "description": "True runs the shell with -l/-i semantics; false disables them. Defaults to true."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "prefix_rule": {+ "type": "array",+ "description": "Reusable approval prefix for `cmd`, only with `sandbox_permissions: \"require_escalated\"`; for example [\"git\", \"pull\"].",+ "items": {+ "type": "string"+ }+ },+ "sandbox_permissions": {+ "type": "string",+ "description": "Per-command sandbox override. Defaults to `use_default`; use `require_escalated` for unsandboxed execution.",+ "enum": [+ "use_default",+ "require_escalated"+ ]+ },+ "shell": {+ "type": "string",+ "description": "Shell binary to launch. Defaults to the user's default shell."+ },+ "tty": {+ "type": "boolean",+ "description": "True allocates a PTY for the command; false or omitted uses plain pipes."+ },+ "workdir": {+ "type": "string",+ "description": "Working directory for the command. Defaults to the turn cwd."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms."+ }+ },+ "required": [+ "cmd"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "write_stdin",+ "description": "Writes characters to an existing unified exec session and returns recent output.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "chars": {+ "type": "string",+ "description": "Bytes to write to stdin. Defaults to empty, which polls without writing."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "session_id": {+ "type": "number",+ "description": "Identifier of the running unified exec session."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Non-empty writes default to 250 ms and cap at 30000 ms; empty polls wait 5000-300000 ms by default."+ }+ },+ "required": [+ "session_id"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "request_user_input",+ "description": "Request user input for one to three short questions and wait for the response. This tool is only available in Plan mode.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "questions": {+ "type": "array",+ "description": "Questions to show the user. Prefer 1 and do not exceed 3",+ "items": {+ "type": "object",+ "properties": {+ "header": {+ "type": "string",+ "description": "Short header label shown in the UI (12 or fewer chars)."+ },+ "id": {+ "type": "string",+ "description": "Stable identifier for mapping answers (snake_case)."+ },+ "options": {+ "type": "array",+ "description": "Provide 2-3 mutually exclusive choices. Put the recommended option first and suffix its label with \"(Recommended)\". Do not include an \"Other\" option in this list; the client will add a free-form \"Other\" option automatically.",+ "items": {+ "type": "object",+ "properties": {+ "description": {+ "type": "string",+ "description": "One short sentence explaining impact/tradeoff if selected."+ },+ "label": {+ "type": "string",+ "description": "User-facing label (1-5 words)."+ }+ },+ "required": [+ "label",+ "description"+ ],+ "additionalProperties": false+ }+ },+ "question": {+ "type": "string",+ "description": "Single-sentence prompt shown to the user."+ }+ },+ "required": [+ "id",+ "header",+ "question",+ "options"+ ],+ "additionalProperties": false+ }+ }+ },+ "required": [+ "questions"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "view_image",+ "description": "View a local image file from the filesystem when visual inspection is needed. Use this for images already available on disk.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "path": {+ "type": "string",+ "description": "Local filesystem path to an image file."+ }+ },+ "required": [+ "path"+ ],+ "additionalProperties": false+ }+ }+ ],+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "reasoning": {+ "summary": "auto"+ },+ "store": false,+ "include": [+ "reasoning.encrypted_content"+ ],+ "prompt_cache_key": "00000000-0000-4000-8000-000000000004",+ "client_metadata": {+ "x-codex-installation-id": "00000000-0000-4000-8000-000000000002",+ "thread_id": "00000000-0000-4000-8000-000000000004",+ "x-codex-window-id": "00000000-0000-4000-8000-000000000004:0",+ "turn_id": "00000000-0000-4000-8000-000000000005",+ "root_turn_id": "00000000-0000-4000-8000-000000000005",+ "x-codex-turn-metadata": "<codex turn metadata, 978 characters>",+ "session_id": "00000000-0000-4000-8000-000000000004"+ }+ },+ "expect": {+ "chat": {+ "roles": [+ "system",+ "user",+ "user"+ ],+ "stream": true,+ "tool_count": 4,+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "image_parts": 0,+ "include_reasoning": false+ }+ }+ },+ {+ "name": "tool loop turn 1",+ "config": "recommended config; the stub answered with an exec_command call",+ "body": {+ "model": "zai-org/GLM-5.3-Flash",+ "stream": true,+ "input": [+ {+ "type": "message",+ "id": "msg_9",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 16979 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_10",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 7893 characters>"+ },+ {+ "type": "input_text",+ "text": "<codex developer instructions, 341 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_11",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "<codex environment context, 764 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_12",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "List the files, then look at dot.png."+ }+ ]+ }+ ],+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Runs a command in a PTY, returning output or a session ID for ongoing interaction.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string",+ "description": "Shell command to execute."+ },+ "justification": {+ "type": "string",+ "description": "User-facing approval question for `require_escalated`; omit otherwise."+ },+ "login": {+ "type": "boolean",+ "description": "True runs the shell with -l/-i semantics; false disables them. Defaults to true."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "prefix_rule": {+ "type": "array",+ "description": "Reusable approval prefix for `cmd`, only with `sandbox_permissions: \"require_escalated\"`; for example [\"git\", \"pull\"].",+ "items": {+ "type": "string"+ }+ },+ "sandbox_permissions": {+ "type": "string",+ "description": "Per-command sandbox override. Defaults to `use_default`; use `require_escalated` for unsandboxed execution.",+ "enum": [+ "use_default",+ "require_escalated"+ ]+ },+ "shell": {+ "type": "string",+ "description": "Shell binary to launch. Defaults to the user's default shell."+ },+ "tty": {+ "type": "boolean",+ "description": "True allocates a PTY for the command; false or omitted uses plain pipes."+ },+ "workdir": {+ "type": "string",+ "description": "Working directory for the command. Defaults to the turn cwd."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms."+ }+ },+ "required": [+ "cmd"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "write_stdin",+ "description": "Writes characters to an existing unified exec session and returns recent output.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "chars": {+ "type": "string",+ "description": "Bytes to write to stdin. Defaults to empty, which polls without writing."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "session_id": {+ "type": "number",+ "description": "Identifier of the running unified exec session."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Non-empty writes default to 250 ms and cap at 30000 ms; empty polls wait 5000-300000 ms by default."+ }+ },+ "required": [+ "session_id"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "request_user_input",+ "description": "Request user input for one to three short questions and wait for the response. This tool is only available in Plan mode.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "questions": {+ "type": "array",+ "description": "Questions to show the user. Prefer 1 and do not exceed 3",+ "items": {+ "type": "object",+ "properties": {+ "header": {+ "type": "string",+ "description": "Short header label shown in the UI (12 or fewer chars)."+ },+ "id": {+ "type": "string",+ "description": "Stable identifier for mapping answers (snake_case)."+ },+ "options": {+ "type": "array",+ "description": "Provide 2-3 mutually exclusive choices. Put the recommended option first and suffix its label with \"(Recommended)\". Do not include an \"Other\" option in this list; the client will add a free-form \"Other\" option automatically.",+ "items": {+ "type": "object",+ "properties": {+ "description": {+ "type": "string",+ "description": "One short sentence explaining impact/tradeoff if selected."+ },+ "label": {+ "type": "string",+ "description": "User-facing label (1-5 words)."+ }+ },+ "required": [+ "label",+ "description"+ ],+ "additionalProperties": false+ }+ },+ "question": {+ "type": "string",+ "description": "Single-sentence prompt shown to the user."+ }+ },+ "required": [+ "id",+ "header",+ "question",+ "options"+ ],+ "additionalProperties": false+ }+ }+ },+ "required": [+ "questions"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "view_image",+ "description": "View a local image file from the filesystem when visual inspection is needed. Use this for images already available on disk.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "path": {+ "type": "string",+ "description": "Local filesystem path to an image file."+ }+ },+ "required": [+ "path"+ ],+ "additionalProperties": false+ }+ }+ ],+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "reasoning": {+ "summary": "auto"+ },+ "store": false,+ "include": [+ "reasoning.encrypted_content"+ ],+ "prompt_cache_key": "00000000-0000-4000-8000-000000000006",+ "client_metadata": {+ "x-codex-installation-id": "00000000-0000-4000-8000-000000000002",+ "x-codex-window-id": "00000000-0000-4000-8000-000000000006:0",+ "root_turn_id": "00000000-0000-4000-8000-000000000007",+ "thread_id": "00000000-0000-4000-8000-000000000006",+ "x-codex-turn-metadata": "<codex turn metadata, 978 characters>",+ "turn_id": "00000000-0000-4000-8000-000000000007",+ "session_id": "00000000-0000-4000-8000-000000000006"+ }+ },+ "expect": {+ "chat": {+ "roles": [+ "system",+ "user",+ "user"+ ],+ "stream": true,+ "tool_count": 4,+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "image_parts": 0,+ "include_reasoning": false+ }+ }+ },+ {+ "name": "tool loop turn 2",+ "config": "recommended config; the stub answered with a view_image call",+ "body": {+ "model": "zai-org/GLM-5.3-Flash",+ "stream": true,+ "input": [+ {+ "type": "message",+ "id": "msg_9",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 16979 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_10",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 7893 characters>"+ },+ {+ "type": "input_text",+ "text": "<codex developer instructions, 341 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_11",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "<codex environment context, 764 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_12",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "List the files, then look at dot.png."+ }+ ]+ },+ {+ "type": "function_call",+ "status": "completed",+ "id": "fc_1",+ "name": "exec_command",+ "arguments": "{\"cmd\": \"ls\"}",+ "call_id": "call_1"+ },+ {+ "type": "function_call_output",+ "id": "fco_1",+ "call_id": "call_1",+ "output": "Chunk ID: d84674\nWall time: 0.0000 seconds\nProcess exited with code 0\nOriginal token count: 14\nOutput:\nREADME.md\ndot.png\ninvoice_totals\npyproject.toml\ntests\n"+ }+ ],+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Runs a command in a PTY, returning output or a session ID for ongoing interaction.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string",+ "description": "Shell command to execute."+ },+ "justification": {+ "type": "string",+ "description": "User-facing approval question for `require_escalated`; omit otherwise."+ },+ "login": {+ "type": "boolean",+ "description": "True runs the shell with -l/-i semantics; false disables them. Defaults to true."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "prefix_rule": {+ "type": "array",+ "description": "Reusable approval prefix for `cmd`, only with `sandbox_permissions: \"require_escalated\"`; for example [\"git\", \"pull\"].",+ "items": {+ "type": "string"+ }+ },+ "sandbox_permissions": {+ "type": "string",+ "description": "Per-command sandbox override. Defaults to `use_default`; use `require_escalated` for unsandboxed execution.",+ "enum": [+ "use_default",+ "require_escalated"+ ]+ },+ "shell": {+ "type": "string",+ "description": "Shell binary to launch. Defaults to the user's default shell."+ },+ "tty": {+ "type": "boolean",+ "description": "True allocates a PTY for the command; false or omitted uses plain pipes."+ },+ "workdir": {+ "type": "string",+ "description": "Working directory for the command. Defaults to the turn cwd."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms."+ }+ },+ "required": [+ "cmd"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "write_stdin",+ "description": "Writes characters to an existing unified exec session and returns recent output.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "chars": {+ "type": "string",+ "description": "Bytes to write to stdin. Defaults to empty, which polls without writing."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "session_id": {+ "type": "number",+ "description": "Identifier of the running unified exec session."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Non-empty writes default to 250 ms and cap at 30000 ms; empty polls wait 5000-300000 ms by default."+ }+ },+ "required": [+ "session_id"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "request_user_input",+ "description": "Request user input for one to three short questions and wait for the response. This tool is only available in Plan mode.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "questions": {+ "type": "array",+ "description": "Questions to show the user. Prefer 1 and do not exceed 3",+ "items": {+ "type": "object",+ "properties": {+ "header": {+ "type": "string",+ "description": "Short header label shown in the UI (12 or fewer chars)."+ },+ "id": {+ "type": "string",+ "description": "Stable identifier for mapping answers (snake_case)."+ },+ "options": {+ "type": "array",+ "description": "Provide 2-3 mutually exclusive choices. Put the recommended option first and suffix its label with \"(Recommended)\". Do not include an \"Other\" option in this list; the client will add a free-form \"Other\" option automatically.",+ "items": {+ "type": "object",+ "properties": {+ "description": {+ "type": "string",+ "description": "One short sentence explaining impact/tradeoff if selected."+ },+ "label": {+ "type": "string",+ "description": "User-facing label (1-5 words)."+ }+ },+ "required": [+ "label",+ "description"+ ],+ "additionalProperties": false+ }+ },+ "question": {+ "type": "string",+ "description": "Single-sentence prompt shown to the user."+ }+ },+ "required": [+ "id",+ "header",+ "question",+ "options"+ ],+ "additionalProperties": false+ }+ }+ },+ "required": [+ "questions"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "view_image",+ "description": "View a local image file from the filesystem when visual inspection is needed. Use this for images already available on disk.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "path": {+ "type": "string",+ "description": "Local filesystem path to an image file."+ }+ },+ "required": [+ "path"+ ],+ "additionalProperties": false+ }+ }+ ],+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "reasoning": {+ "summary": "auto"+ },+ "store": false,+ "include": [+ "reasoning.encrypted_content"+ ],+ "prompt_cache_key": "00000000-0000-4000-8000-000000000006",+ "client_metadata": {+ "x-codex-turn-metadata": "<codex turn metadata, 978 characters>",+ "turn_id": "00000000-0000-4000-8000-000000000007",+ "x-codex-window-id": "00000000-0000-4000-8000-000000000006:0",+ "root_turn_id": "00000000-0000-4000-8000-000000000007",+ "x-codex-installation-id": "00000000-0000-4000-8000-000000000002",+ "thread_id": "00000000-0000-4000-8000-000000000006",+ "session_id": "00000000-0000-4000-8000-000000000006"+ }+ },+ "expect": {+ "chat": {+ "roles": [+ "system",+ "user",+ "user",+ "assistant",+ "tool"+ ],+ "stream": true,+ "tool_count": 4,+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "image_parts": 0,+ "include_reasoning": false+ }+ }+ },+ {+ "name": "tool loop turn 3",+ "config": "recommended config; the view_image output is an input_image",+ "body": {+ "model": "zai-org/GLM-5.3-Flash",+ "stream": true,+ "input": [+ {+ "type": "message",+ "id": "msg_9",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 16979 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_10",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 7893 characters>"+ },+ {+ "type": "input_text",+ "text": "<codex developer instructions, 341 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_11",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "<codex environment context, 764 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_12",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "List the files, then look at dot.png."+ }+ ]+ },+ {+ "type": "function_call",+ "status": "completed",+ "id": "fc_1",+ "name": "exec_command",+ "arguments": "{\"cmd\": \"ls\"}",+ "call_id": "call_1"+ },+ {+ "type": "function_call_output",+ "id": "fco_1",+ "call_id": "call_1",+ "output": "Chunk ID: d84674\nWall time: 0.0000 seconds\nProcess exited with code 0\nOriginal token count: 14\nOutput:\nREADME.md\ndot.png\ninvoice_totals\npyproject.toml\ntests\n"+ },+ {+ "type": "function_call",+ "status": "completed",+ "id": "fc_2",+ "name": "view_image",+ "arguments": "{\"path\": \"/workspace/dot.png\"}",+ "call_id": "call_2"+ },+ {+ "type": "function_call_output",+ "id": "fco_2",+ "call_id": "call_2",+ "output": [+ {+ "type": "input_image",+ "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==",+ "detail": "high"+ }+ ]+ }+ ],+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Runs a command in a PTY, returning output or a session ID for ongoing interaction.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string",+ "description": "Shell command to execute."+ },+ "justification": {+ "type": "string",+ "description": "User-facing approval question for `require_escalated`; omit otherwise."+ },+ "login": {+ "type": "boolean",+ "description": "True runs the shell with -l/-i semantics; false disables them. Defaults to true."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "prefix_rule": {+ "type": "array",+ "description": "Reusable approval prefix for `cmd`, only with `sandbox_permissions: \"require_escalated\"`; for example [\"git\", \"pull\"].",+ "items": {+ "type": "string"+ }+ },+ "sandbox_permissions": {+ "type": "string",+ "description": "Per-command sandbox override. Defaults to `use_default`; use `require_escalated` for unsandboxed execution.",+ "enum": [+ "use_default",+ "require_escalated"+ ]+ },+ "shell": {+ "type": "string",+ "description": "Shell binary to launch. Defaults to the user's default shell."+ },+ "tty": {+ "type": "boolean",+ "description": "True allocates a PTY for the command; false or omitted uses plain pipes."+ },+ "workdir": {+ "type": "string",+ "description": "Working directory for the command. Defaults to the turn cwd."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms."+ }+ },+ "required": [+ "cmd"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "write_stdin",+ "description": "Writes characters to an existing unified exec session and returns recent output.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "chars": {+ "type": "string",+ "description": "Bytes to write to stdin. Defaults to empty, which polls without writing."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "session_id": {+ "type": "number",+ "description": "Identifier of the running unified exec session."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Non-empty writes default to 250 ms and cap at 30000 ms; empty polls wait 5000-300000 ms by default."+ }+ },+ "required": [+ "session_id"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "request_user_input",+ "description": "Request user input for one to three short questions and wait for the response. This tool is only available in Plan mode.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "questions": {+ "type": "array",+ "description": "Questions to show the user. Prefer 1 and do not exceed 3",+ "items": {+ "type": "object",+ "properties": {+ "header": {+ "type": "string",+ "description": "Short header label shown in the UI (12 or fewer chars)."+ },+ "id": {+ "type": "string",+ "description": "Stable identifier for mapping answers (snake_case)."+ },+ "options": {+ "type": "array",+ "description": "Provide 2-3 mutually exclusive choices. Put the recommended option first and suffix its label with \"(Recommended)\". Do not include an \"Other\" option in this list; the client will add a free-form \"Other\" option automatically.",+ "items": {+ "type": "object",+ "properties": {+ "description": {+ "type": "string",+ "description": "One short sentence explaining impact/tradeoff if selected."+ },+ "label": {+ "type": "string",+ "description": "User-facing label (1-5 words)."+ }+ },+ "required": [+ "label",+ "description"+ ],+ "additionalProperties": false+ }+ },+ "question": {+ "type": "string",+ "description": "Single-sentence prompt shown to the user."+ }+ },+ "required": [+ "id",+ "header",+ "question",+ "options"+ ],+ "additionalProperties": false+ }+ }+ },+ "required": [+ "questions"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "view_image",+ "description": "View a local image file from the filesystem when visual inspection is needed. Use this for images already available on disk.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "path": {+ "type": "string",+ "description": "Local filesystem path to an image file."+ }+ },+ "required": [+ "path"+ ],+ "additionalProperties": false+ }+ }+ ],+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "reasoning": {+ "summary": "auto"+ },+ "store": false,+ "include": [+ "reasoning.encrypted_content"+ ],+ "prompt_cache_key": "00000000-0000-4000-8000-000000000006",+ "client_metadata": {+ "x-codex-window-id": "00000000-0000-4000-8000-000000000006:0",+ "turn_id": "00000000-0000-4000-8000-000000000007",+ "thread_id": "00000000-0000-4000-8000-000000000006",+ "session_id": "00000000-0000-4000-8000-000000000006",+ "x-codex-installation-id": "00000000-0000-4000-8000-000000000002",+ "root_turn_id": "00000000-0000-4000-8000-000000000007",+ "x-codex-turn-metadata": "<codex turn metadata, 978 characters>"+ }+ },+ "expect": {+ "chat": {+ "roles": [+ "system",+ "user",+ "user",+ "assistant",+ "tool",+ "assistant",+ "tool",+ "user"+ ],+ "stream": true,+ "tool_count": 4,+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "image_parts": 1,+ "include_reasoning": false+ }+ }+ },+ {+ "name": "reasoning effort high",+ "config": "recommended config with reasoning effort high",+ "body": {+ "model": "zai-org/GLM-5.3-Flash",+ "stream": true,+ "input": [+ {+ "type": "message",+ "id": "msg_13",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 16979 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_14",+ "role": "developer",+ "content": [+ {+ "type": "input_text",+ "text": "<codex developer instructions, 7893 characters>"+ },+ {+ "type": "input_text",+ "text": "<codex developer instructions, 341 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_15",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "<codex environment context, 764 characters>"+ }+ ]+ },+ {+ "type": "message",+ "id": "msg_16",+ "role": "user",+ "content": [+ {+ "type": "input_text",+ "text": "Say hello."+ }+ ]+ }+ ],+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Runs a command in a PTY, returning output or a session ID for ongoing interaction.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string",+ "description": "Shell command to execute."+ },+ "justification": {+ "type": "string",+ "description": "User-facing approval question for `require_escalated`; omit otherwise."+ },+ "login": {+ "type": "boolean",+ "description": "True runs the shell with -l/-i semantics; false disables them. Defaults to true."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "prefix_rule": {+ "type": "array",+ "description": "Reusable approval prefix for `cmd`, only with `sandbox_permissions: \"require_escalated\"`; for example [\"git\", \"pull\"].",+ "items": {+ "type": "string"+ }+ },+ "sandbox_permissions": {+ "type": "string",+ "description": "Per-command sandbox override. Defaults to `use_default`; use `require_escalated` for unsandboxed execution.",+ "enum": [+ "use_default",+ "require_escalated"+ ]+ },+ "shell": {+ "type": "string",+ "description": "Shell binary to launch. Defaults to the user's default shell."+ },+ "tty": {+ "type": "boolean",+ "description": "True allocates a PTY for the command; false or omitted uses plain pipes."+ },+ "workdir": {+ "type": "string",+ "description": "Working directory for the command. Defaults to the turn cwd."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms."+ }+ },+ "required": [+ "cmd"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "write_stdin",+ "description": "Writes characters to an existing unified exec session and returns recent output.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "chars": {+ "type": "string",+ "description": "Bytes to write to stdin. Defaults to empty, which polls without writing."+ },+ "max_output_tokens": {+ "type": "number",+ "description": "Output token budget. Defaults to 10000 tokens; larger requests may be capped by policy."+ },+ "session_id": {+ "type": "number",+ "description": "Identifier of the running unified exec session."+ },+ "yield_time_ms": {+ "type": "number",+ "description": "Wait before yielding output. Non-empty writes default to 250 ms and cap at 30000 ms; empty polls wait 5000-300000 ms by default."+ }+ },+ "required": [+ "session_id"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "request_user_input",+ "description": "Request user input for one to three short questions and wait for the response. This tool is only available in Plan mode.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "questions": {+ "type": "array",+ "description": "Questions to show the user. Prefer 1 and do not exceed 3",+ "items": {+ "type": "object",+ "properties": {+ "header": {+ "type": "string",+ "description": "Short header label shown in the UI (12 or fewer chars)."+ },+ "id": {+ "type": "string",+ "description": "Stable identifier for mapping answers (snake_case)."+ },+ "options": {+ "type": "array",+ "description": "Provide 2-3 mutually exclusive choices. Put the recommended option first and suffix its label with \"(Recommended)\". Do not include an \"Other\" option in this list; the client will add a free-form \"Other\" option automatically.",+ "items": {+ "type": "object",+ "properties": {+ "description": {+ "type": "string",+ "description": "One short sentence explaining impact/tradeoff if selected."+ },+ "label": {+ "type": "string",+ "description": "User-facing label (1-5 words)."+ }+ },+ "required": [+ "label",+ "description"+ ],+ "additionalProperties": false+ }+ },+ "question": {+ "type": "string",+ "description": "Single-sentence prompt shown to the user."+ }+ },+ "required": [+ "id",+ "header",+ "question",+ "options"+ ],+ "additionalProperties": false+ }+ }+ },+ "required": [+ "questions"+ ],+ "additionalProperties": false+ }+ },+ {+ "type": "function",+ "name": "view_image",+ "description": "View a local image file from the filesystem when visual inspection is needed. Use this for images already available on disk.",+ "strict": false,+ "parameters": {+ "type": "object",+ "properties": {+ "path": {+ "type": "string",+ "description": "Local filesystem path to an image file."+ }+ },+ "required": [+ "path"+ ],+ "additionalProperties": false+ }+ }+ ],+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "reasoning": {+ "effort": "high"+ },+ "store": false,+ "include": [+ "reasoning.encrypted_content"+ ],+ "prompt_cache_key": "00000000-0000-4000-8000-000000000009",+ "client_metadata": {+ "session_id": "00000000-0000-4000-8000-000000000009",+ "thread_id": "00000000-0000-4000-8000-000000000009",+ "root_turn_id": "00000000-0000-4000-8000-000000000010",+ "turn_id": "00000000-0000-4000-8000-000000000010",+ "x-codex-turn-metadata": "<codex turn metadata, 1004 characters>",+ "x-codex-installation-id": "00000000-0000-4000-8000-000000000002",+ "x-codex-window-id": "00000000-0000-4000-8000-000000000009:0"+ }+ },+ "expect": {+ "chat": {+ "roles": [+ "system",+ "user",+ "user"+ ],+ "stream": true,+ "tool_count": 4,+ "tool_choice": "auto",+ "parallel_tool_calls": true,+ "image_parts": 0,+ "include_reasoning": false,+ "reasoning_effort": "high"+ }+ }+ }+ ]+}diff --git a/conformance/openai_responses/error_vectors.json b/conformance/openai_responses/error_vectors.jsonnew file mode 100644index 000000000..81a19c937--- /dev/null+++ b/conformance/openai_responses/error_vectors.json@@ -0,0 +1,302 @@+{+ "description": "A chat error answer returned before the stream opens (status, headers, JSON body) and the answer the Responses route gives: the same status, Retry-After and x-sie-error-code, and the same OpenAI error body, except that a param naming a chat field is renamed to the Responses field. Headers not listed under expect.headers are not asserted, except that expect.absent_headers must be missing.",+ "errors": [+ {+ "name": "capacity is a 503 with Retry-After and x-sie-error-code",+ "status": 503,+ "headers": {"retry-after": "60", "x-sie-error-code": "PROVISIONING"},+ "body": {+ "error": {+ "message": "Capacity for model 'm' is starting. Retry after the number of seconds in Retry-After.",+ "type": "server_error",+ "param": null,+ "code": "provisioning"+ }+ },+ "expect": {+ "status": 503,+ "headers": {"retry-after": "60", "x-sie-error-code": "PROVISIONING"},+ "body": {+ "error": {+ "message": "Capacity for model 'm' is starting. Retry after the number of seconds in Retry-After.",+ "type": "server_error",+ "param": null,+ "code": "provisioning"+ }+ }+ }+ },+ {+ "name": "busy upstream",+ "status": 503,+ "headers": {"retry-after": "5", "x-sie-error-code": "RESOURCE_EXHAUSTED"},+ "body": {+ "error": {+ "message": "The upstream serving the model is busy, please retry",+ "type": "server_error",+ "param": null,+ "code": "RESOURCE_EXHAUSTED",+ "attempt_id": "attempt-1"+ }+ },+ "expect": {+ "status": 503,+ "headers": {"retry-after": "5", "x-sie-error-code": "RESOURCE_EXHAUSTED"},+ "body": {+ "error": {+ "message": "The upstream serving the model is busy, please retry",+ "type": "server_error",+ "param": null,+ "code": "RESOURCE_EXHAUSTED",+ "attempt_id": "attempt-1"+ }+ }+ }+ },+ {+ "name": "rate limited",+ "status": 429,+ "headers": {"retry-after": "1"},+ "body": {"error": {"message": "rate limit exceeded", "type": "rate_limit_error", "param": null, "code": "rate_limit_exceeded"}},+ "expect": {+ "status": 429,+ "headers": {"retry-after": "1"},+ "body": {"error": {"message": "rate limit exceeded", "type": "rate_limit_error", "param": null, "code": "rate_limit_exceeded"}}+ }+ },+ {+ "name": "tool name pattern names the Responses tool, gateway wording",+ "status": 400,+ "body": {+ "error": {+ "message": "tools[1].function.name must match ^[a-zA-Z0-9_-]{1,64}$",+ "type": "invalid_request_error",+ "param": "tools[1].function.name",+ "code": "invalid_request"+ }+ },+ "expect": {+ "status": 400,+ "body": {+ "error": {+ "message": "tools[1].function.name must match ^[a-zA-Z0-9_-]{1,64}$",+ "type": "invalid_request_error",+ "param": "tools[1].name",+ "code": "invalid_request"+ }+ }+ }+ },+ {+ "name": "tool name pattern names the Responses tool, server wording",+ "status": 400,+ "body": {+ "error": {+ "message": "'tools[12].function.name' must match ^[a-zA-Z0-9_-]{1,64}$",+ "type": "invalid_request_error",+ "param": "tools[12].function.name",+ "code": "invalid_request"+ }+ },+ "expect": {+ "status": 400,+ "body": {+ "error": {+ "message": "'tools[12].function.name' must match ^[a-zA-Z0-9_-]{1,64}$",+ "type": "invalid_request_error",+ "param": "tools[12].name",+ "code": "invalid_request"+ }+ }+ }+ },+ {+ "name": "too many tools",+ "status": 400,+ "body": {"error": {"message": "'tools' length 65 exceeds limit (64)", "type": "invalid_request_error", "param": "tools", "code": "invalid_request"}},+ "expect": {+ "status": 400,+ "body": {"error": {"message": "'tools' length 65 exceeds limit (64)", "type": "invalid_request_error", "param": "tools", "code": "invalid_request"}}+ }+ },+ {+ "name": "model without tool calling",+ "status": 400,+ "body": {"error": {"message": "Model 'm' does not support tool calling", "type": "invalid_request_error", "param": "tools", "code": "unsupported_field"}},+ "expect": {+ "status": 400,+ "body": {+ "error": {"message": "Model 'm' does not support tool calling", "type": "invalid_request_error", "param": "tools", "code": "unsupported_field"}+ }+ }+ },+ {+ "name": "unknown model",+ "status": 404,+ "body": {"error": {"message": "Model 'nope' not found", "type": "invalid_request_error", "param": "model", "code": "model_not_found"}},+ "expect": {+ "status": 404,+ "body": {"error": {"message": "Model 'nope' not found", "type": "invalid_request_error", "param": "model", "code": "model_not_found"}}+ }+ },+ {+ "name": "first-chunk timeout carries no retry headers",+ "status": 504,+ "body": {"error": {"message": "Generation aborted: first_chunk timeout", "type": "server_error", "param": null, "code": "first_chunk_timeout"}},+ "expect": {+ "status": 504,+ "body": {"error": {"message": "Generation aborted: first_chunk timeout", "type": "server_error", "param": null, "code": "first_chunk_timeout"}},+ "absent_headers": ["retry-after", "x-sie-error-code"]+ }+ },+ {+ "name": "extra error fields are kept",+ "status": 500,+ "body": {"error": {"message": "internal error during generation", "type": "server_error", "param": null, "code": "inference_error", "attempt_id": "a1"}},+ "expect": {+ "status": 500,+ "body": {+ "error": {"message": "internal error during generation", "type": "server_error", "param": null, "code": "inference_error", "attempt_id": "a1"}+ }+ }+ },+ {+ "name": "output cap names max_output_tokens",+ "status": 400,+ "body": {+ "error": {+ "message": "max_completion_tokens (40000) exceeds model max_output_tokens (32768)",+ "type": "invalid_request_error",+ "param": "max_completion_tokens",+ "code": "invalid_request"+ }+ },+ "expect": {+ "status": 400,+ "body": {+ "error": {+ "message": "max_completion_tokens (40000) exceeds model max_output_tokens (32768)",+ "type": "invalid_request_error",+ "param": "max_output_tokens",+ "code": "invalid_request"+ }+ }+ }+ },+ {+ "name": "reasoning effort refusal names reasoning.effort",+ "status": 400,+ "body": {+ "error": {+ "message": "Model 'm' does not support reasoning_effort",+ "type": "invalid_request_error",+ "param": "reasoning_effort",+ "code": "unsupported_field"+ }+ },+ "expect": {+ "status": 400,+ "body": {+ "error": {+ "message": "Model 'm' does not support reasoning_effort",+ "type": "invalid_request_error",+ "param": "reasoning.effort",+ "code": "unsupported_field"+ }+ }+ }+ },+ {+ "name": "structured output refusal names text.format",+ "status": 400,+ "body": {+ "error": {+ "message": "Model 'm' does not support response_format",+ "type": "invalid_request_error",+ "param": "response_format",+ "code": "unsupported_field"+ }+ },+ "expect": {+ "status": 400,+ "body": {+ "error": {+ "message": "Model 'm' does not support response_format",+ "type": "invalid_request_error",+ "param": "text.format",+ "code": "unsupported_field"+ }+ }+ }+ },+ {+ "name": "json_schema field names text.format",+ "status": 400,+ "body": {+ "error": {+ "message": "'response_format.json_schema.schema' is required",+ "type": "invalid_request_error",+ "param": "response_format.json_schema.schema",+ "code": "invalid_request"+ }+ },+ "expect": {+ "status": 400,+ "body": {+ "error": {+ "message": "'response_format.json_schema.schema' is required",+ "type": "invalid_request_error",+ "param": "text.format.schema",+ "code": "invalid_request"+ }+ }+ }+ },+ {+ "name": "tool parameter schema path names the Responses tool",+ "status": 400,+ "body": {+ "error": {+ "message": "tools[0].function.parameters: unresolved internal '$ref' \"#/$defs/Missing\"",+ "type": "invalid_request_error",+ "param": "tools[0].function.parameters.properties.a.$ref",+ "code": "invalid_request"+ }+ },+ "expect": {+ "status": 400,+ "body": {+ "error": {+ "message": "tools[0].function.parameters: unresolved internal '$ref' \"#/$defs/Missing\"",+ "type": "invalid_request_error",+ "param": "tools[0].parameters.properties.a.$ref",+ "code": "invalid_request"+ }+ }+ }+ },+ {+ "name": "a messages param passes unchanged",+ "status": 400,+ "body": {+ "error": {+ "message": "messages[3].content[0]: image data URI must be base64-encoded",+ "type": "invalid_request_error",+ "param": "messages[3].content[0].image_url",+ "code": "invalid_request"+ }+ },+ "expect": {+ "status": 400,+ "body": {+ "error": {+ "message": "messages[3].content[0]: image data URI must be base64-encoded",+ "type": "invalid_request_error",+ "param": "messages[3].content[0].image_url",+ "code": "invalid_request"+ }+ }+ }+ }+ ]+}diff --git a/conformance/openai_responses/request_vectors.json b/conformance/openai_responses/request_vectors.jsonnew file mode 100644index 000000000..95b4de17b--- /dev/null+++ b/conformance/openai_responses/request_vectors.json@@ -0,0 +1,1858 @@+{+ "accepted": [+ {+ "name": "string input, absent max_output_tokens is omitted",+ "body": {"model": "m", "input": "Hi"},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "include_reasoning": false}+ },+ {+ "name": "max_output_tokens becomes max_completion_tokens",+ "body": {"model": "m", "input": "Hi", "max_output_tokens": 256},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "max_completion_tokens": 256, "stream": false, "include_reasoning": false}+ },+ {+ "name": "null optional fields are omitted",+ "body": {+ "model": "m",+ "input": "Hi",+ "instructions": null,+ "max_output_tokens": null,+ "temperature": null,+ "top_p": null,+ "seed": null,+ "stream": null,+ "tools": null,+ "tool_choice": null,+ "parallel_tool_calls": null,+ "reasoning": null,+ "text": null,+ "metadata": null,+ "store": null,+ "background": null,+ "truncation": null,+ "include": null,+ "previous_response_id": null,+ "conversation": null+ },+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "include_reasoning": false}+ },+ {+ "name": "instructions and the leading developer and system messages form one system message",+ "body": {+ "model": "m",+ "instructions": "You are a coding agent.",+ "input": [+ {"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "Follow the repository rules."}]},+ {"role": "developer", "content": [{"type": "input_text", "text": "Sandbox: read-only."}, {"type": "input_text", "text": " Network: off."}]},+ {"role": "system", "content": "Answer briefly."},+ {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "List the files."}]}+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "system", "content": "You are a coding agent.\n\nFollow the repository rules.\n\nSandbox: read-only. Network: off.\n\nAnswer briefly."},+ {"role": "user", "content": "List the files."}+ ],+ "stream": false,+ "include_reasoning": false+ }+ },+ {+ "name": "leading developer messages without instructions, consecutive user messages stay separate",+ "body": {+ "model": "m",+ "input": [+ {"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "Be careful."}]},+ {"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "Ask before deleting."}]},+ {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "<context>cwd</context>"}]},+ {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "Say hello."}]}+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "system", "content": "Be careful.\n\nAsk before deleting."},+ {"role": "user", "content": "<context>cwd</context>"},+ {"role": "user", "content": "Say hello."}+ ],+ "stream": false,+ "include_reasoning": false+ }+ },+ {+ "name": "a later system or developer message is translated in place",+ "body": {+ "model": "m",+ "instructions": "Be helpful.",+ "input": [+ {"role": "user", "content": "Hi"},+ {"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": "Hello."}]},+ {"type": "message", "role": "developer", "content": "Reply in French from now on."},+ {"role": "system", "content": [{"type": "input_text", "text": "Keep it short."}]},+ {"role": "user", "content": "How are you?"}+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "system", "content": "Be helpful."},+ {"role": "user", "content": "Hi"},+ {"role": "assistant", "content": "Hello."},+ {"role": "system", "content": "Reply in French from now on."},+ {"role": "system", "content": "Keep it short."},+ {"role": "user", "content": "How are you?"}+ ],+ "stream": false,+ "include_reasoning": false+ }+ },+ {+ "name": "text parts are concatenated without a separator",+ "body": {+ "model": "m",+ "input": [+ {"role": "user", "content": [{"type": "input_text", "text": "Hello, "}, {"type": "text", "text": "world"}, {"type": "input_text", "text": "!"}]},+ {+ "type": "message",+ "role": "assistant",+ "content": [{"type": "output_text", "text": "Hi ", "annotations": [], "logprobs": []}, {"type": "output_text", "text": "there."}]+ },+ {"role": "user", "content": [{"type": "input_text", "text": "Again."}]}+ ]+ },+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Hello, world!"}, {"role": "assistant", "content": "Hi there."}, {"role": "user", "content": "Again."}],+ "stream": false,+ "include_reasoning": false+ }+ },+ {+ "name": "data URI image parts keep their position, adjacent texts join, detail is ignored",+ "body": {+ "model": "m",+ "input": [+ {+ "role": "user",+ "content": [+ {"type": "input_text", "text": "Before "},+ {"type": "input_text", "text": ""},+ {+ "type": "input_image",+ "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==",+ "detail": "high"+ },+ {"type": "input_text", "text": "a"},+ {"type": "text", "text": "b"},+ {+ "type": "input_image",+ "image_url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAD//Z",+ "detail": "auto"+ }+ ]+ }+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {+ "role": "user",+ "content": [+ {"type": "text", "text": "Before "},+ {+ "type": "image_url",+ "image_url": {"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="}+ },+ {"type": "text", "text": "ab"},+ {+ "type": "image_url",+ "image_url": {+ "url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAD//Z"+ }+ }+ ]+ }+ ],+ "stream": false,+ "include_reasoning": false+ }+ },+ {+ "name": "assistant text and parallel function calls become one assistant message",+ "body": {+ "model": "m",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "input": [+ {"role": "user", "content": "Run both."},+ {"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": "Running both."}]},+ {"type": "function_call", "call_id": "call_1", "name": "exec_command", "arguments": "{\"cmd\":\"echo one\"}"},+ {"type": "function_call", "call_id": "call_2", "name": "exec_command", "arguments": "{\"cmd\": \"echo two\"}"},+ {"type": "function_call_output", "call_id": "call_1", "output": "one\n"},+ {"type": "function_call_output", "call_id": "call_2", "output": "two\n"},+ {"role": "user", "content": "Thanks."}+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "user", "content": "Run both."},+ {+ "role": "assistant",+ "content": "Running both.",+ "tool_calls": [+ {"id": "call_1", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\":\"echo one\"}"}},+ {"id": "call_2", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\": \"echo two\"}"}}+ ]+ },+ {"role": "tool", "tool_call_id": "call_1", "content": "one\n"},+ {"role": "tool", "tool_call_id": "call_2", "content": "two\n"},+ {"role": "user", "content": "Thanks."}+ ],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ }+ ],+ "include_reasoning": false+ }+ },+ {+ "name": "consecutive assistant messages merge, reasoning items are dropped and do not split assistant output",+ "body": {+ "model": "m",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "input": [+ {"role": "user", "content": "What is here?"},+ {"type": "reasoning", "id": "rs_1", "summary": [], "encrypted_content": "opaque-1"},+ {"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": "Checking."}]},+ {"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": " One moment."}]},+ {"type": "reasoning", "id": "rs_2", "summary": [{"type": "summary_text", "text": "List files."}]},+ {"type": "function_call", "call_id": "call_1", "name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"},+ {"type": "reasoning", "id": "rs_3", "summary": [], "content": [], "encrypted_content": "opaque-3"},+ {"type": "function_call_output", "call_id": "call_1", "output": "README.md\n"},+ {"type": "reasoning", "id": "rs_4", "summary": []},+ {"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": "One file."}]},+ {"role": "user", "content": "Thanks."}+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "user", "content": "What is here?"},+ {+ "role": "assistant",+ "content": "Checking. One moment.",+ "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"}}]+ },+ {"role": "tool", "tool_call_id": "call_1", "content": "README.md\n"},+ {"role": "assistant", "content": "One file."},+ {"role": "user", "content": "Thanks."}+ ],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ }+ ],+ "include_reasoning": false+ }+ },+ {+ "name": "a custom tool becomes a function with one string input, its call carries the input as JSON",+ "body": {+ "model": "m",+ "tools": [+ {+ "type": "custom",+ "name": "apply_patch",+ "description": "Apply a patch to files.",+ "format": {"type": "grammar", "syntax": "lark", "definition": "start: /.+/"}+ }+ ],+ "input": [+ {"role": "user", "content": "Add a line."},+ {+ "type": "custom_tool_call",+ "call_id": "call_p",+ "name": "apply_patch",+ "input": "*** Begin Patch\n*** Update File: notes.txt\n+café\n*** End Patch\n"+ },+ {"type": "custom_tool_call_output", "call_id": "call_p", "output": "Success."},+ {"role": "user", "content": "Thanks."}+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "user", "content": "Add a line."},+ {+ "role": "assistant",+ "content": null,+ "tool_calls": [+ {+ "id": "call_p",+ "type": "function",+ "function": {"name": "apply_patch", "arguments": "{\"input\":\"*** Begin Patch\\n*** Update File: notes.txt\\n+café\\n*** End Patch\\n\"}"}+ }+ ]+ },+ {"role": "tool", "tool_call_id": "call_p", "content": "Success."},+ {"role": "user", "content": "Thanks."}+ ],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "apply_patch",+ "description": "Apply a patch to files.",+ "parameters": {"type": "object", "properties": {"input": {"type": "string"}}, "required": ["input"], "additionalProperties": false}+ }+ }+ ],+ "include_reasoning": false+ }+ },+ {+ "name": "function and custom tool outputs given as text part arrays",+ "body": {+ "model": "m",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ },+ {"type": "custom", "name": "apply_patch"}+ ],+ "input": [+ {"role": "user", "content": "Patch and test."},+ {"type": "custom_tool_call", "call_id": "call_p", "name": "apply_patch", "input": "*** Begin Patch\n*** End Patch\n"},+ {"type": "function_call", "call_id": "call_t", "name": "exec_command", "arguments": "{\"cmd\":\"pytest\"}"},+ {"type": "custom_tool_call_output", "call_id": "call_p", "output": [{"type": "input_text", "text": "Patch "}, {"type": "text", "text": "applied."}]},+ {+ "type": "function_call_output",+ "call_id": "call_t",+ "output": [{"type": "input_text", "text": "3 passed\n"}, {"type": "output_text", "text": "ok", "annotations": []}]+ }+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "user", "content": "Patch and test."},+ {+ "role": "assistant",+ "content": null,+ "tool_calls": [+ {"id": "call_p", "type": "function", "function": {"name": "apply_patch", "arguments": "{\"input\":\"*** Begin Patch\\n*** End Patch\\n\"}"}},+ {"id": "call_t", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\":\"pytest\"}"}}+ ]+ },+ {"role": "tool", "tool_call_id": "call_p", "content": "Patch applied."},+ {"role": "tool", "tool_call_id": "call_t", "content": "3 passed\nok"}+ ],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ },+ {+ "type": "function",+ "function": {+ "name": "apply_patch",+ "parameters": {"type": "object", "properties": {"input": {"type": "string"}}, "required": ["input"], "additionalProperties": false}+ }+ }+ ],+ "include_reasoning": false+ }+ },+ {+ "name": "tool output images move into the following user message, images first",+ "body": {+ "model": "m",+ "tools": [+ {"type": "function", "name": "view_image", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}+ ],+ "input": [+ {"role": "user", "content": "Look at dot.png."},+ {"type": "function_call", "call_id": "call_v", "name": "view_image", "arguments": "{\"path\":\"dot.png\"}"},+ {+ "type": "function_call_output",+ "call_id": "call_v",+ "output": [+ {"type": "input_text", "text": "dot.png"},+ {+ "type": "input_image",+ "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==",+ "detail": "high"+ }+ ]+ },+ {+ "role": "user",+ "content": [+ {"type": "input_text", "text": "Compare it with this one."},+ {+ "type": "input_image",+ "image_url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAD//Z"+ }+ ]+ }+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "user", "content": "Look at dot.png."},+ {+ "role": "assistant",+ "content": null,+ "tool_calls": [{"id": "call_v", "type": "function", "function": {"name": "view_image", "arguments": "{\"path\":\"dot.png\"}"}}]+ },+ {"role": "tool", "tool_call_id": "call_v", "content": "dot.png"},+ {+ "role": "user",+ "content": [+ {+ "type": "image_url",+ "image_url": {"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="}+ },+ {"type": "text", "text": "Compare it with this one."},+ {+ "type": "image_url",+ "image_url": {+ "url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAD//Z"+ }+ }+ ]+ }+ ],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {"name": "view_image", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}+ }+ ],+ "include_reasoning": false+ }+ },+ {+ "name": "tool output images without a following user message form a user message after the run",+ "body": {+ "model": "m",+ "tools": [+ {"type": "function", "name": "view_image", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}+ ],+ "input": [+ {"role": "user", "content": "Look at both images."},+ {"type": "function_call", "call_id": "call_a", "name": "view_image", "arguments": "{\"path\":\"a.png\"}"},+ {"type": "function_call", "call_id": "call_b", "name": "view_image", "arguments": "{\"path\":\"b.jpg\"}"},+ {+ "type": "function_call_output",+ "call_id": "call_a",+ "output": [+ {+ "type": "input_image",+ "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==",+ "detail": "high"+ }+ ]+ },+ {+ "type": "function_call_output",+ "call_id": "call_b",+ "output": [+ {"type": "input_text", "text": "b.jpg"},+ {+ "type": "input_image",+ "image_url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAD//Z"+ }+ ]+ }+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "user", "content": "Look at both images."},+ {+ "role": "assistant",+ "content": null,+ "tool_calls": [+ {"id": "call_a", "type": "function", "function": {"name": "view_image", "arguments": "{\"path\":\"a.png\"}"}},+ {"id": "call_b", "type": "function", "function": {"name": "view_image", "arguments": "{\"path\":\"b.jpg\"}"}}+ ]+ },+ {"role": "tool", "tool_call_id": "call_a", "content": ""},+ {"role": "tool", "tool_call_id": "call_b", "content": "b.jpg"},+ {+ "role": "user",+ "content": [+ {+ "type": "image_url",+ "image_url": {"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="}+ },+ {+ "type": "image_url",+ "image_url": {+ "url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AKAAD//Z"+ }+ }+ ]+ }+ ],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {"name": "view_image", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}+ }+ ],+ "include_reasoning": false+ }+ },+ {+ "name": "tool output images are emitted before the next assistant output",+ "body": {+ "model": "m",+ "tools": [+ {"type": "function", "name": "view_image", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}+ ],+ "input": [+ {"role": "user", "content": "Look at the image."},+ {"type": "function_call", "call_id": "call_a", "name": "view_image", "arguments": "{\"path\":\"a.png\"}"},+ {+ "type": "function_call_output",+ "call_id": "call_a",+ "output": [+ {+ "type": "input_image",+ "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="+ }+ ]+ },+ {"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": "A single pixel."}]},+ {"role": "user", "content": "Thanks."}+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "user", "content": "Look at the image."},+ {+ "role": "assistant",+ "content": null,+ "tool_calls": [{"id": "call_a", "type": "function", "function": {"name": "view_image", "arguments": "{\"path\":\"a.png\"}"}}]+ },+ {"role": "tool", "tool_call_id": "call_a", "content": ""},+ {+ "role": "user",+ "content": [+ {+ "type": "image_url",+ "image_url": {"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="}+ }+ ]+ },+ {"role": "assistant", "content": "A single pixel."},+ {"role": "user", "content": "Thanks."}+ ],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {"name": "view_image", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}+ }+ ],+ "include_reasoning": false+ }+ },+ {+ "name": "item id and status are ignored",+ "body": {+ "model": "m",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "input": [+ {"type": "message", "id": "msg_1", "status": "completed", "role": "user", "content": [{"type": "input_text", "text": "List."}]},+ {"type": "function_call", "id": "fc_1", "status": "completed", "call_id": "call_1", "name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"},+ {"type": "function_call_output", "id": "fco_1", "status": "completed", "call_id": "call_1", "output": "a\n"},+ {"type": "reasoning", "id": "rs_1", "status": "completed", "summary": []},+ {"id": "msg_2", "status": "completed", "role": "user", "content": "Thanks."}+ ]+ },+ "chat": {+ "model": "m",+ "messages": [+ {"role": "user", "content": "List."},+ {+ "role": "assistant",+ "content": null,+ "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"}}]+ },+ {"role": "tool", "tool_call_id": "call_1", "content": "a\n"},+ {"role": "user", "content": "Thanks."}+ ],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ }+ ],+ "include_reasoning": false+ }+ },+ {+ "name": "every ignore-list field is accepted with no effect",+ "body": {+ "model": "m",+ "input": "Hi",+ "store": false,+ "background": false,+ "truncation": "disabled",+ "include": ["reasoning.encrypted_content"],+ "client_metadata": {"session_id": "s-1", "turn": "t-1"},+ "reasoning": {"summary": "auto", "generate_summary": "concise"},+ "text": {"verbosity": "low"}+ },+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "include_reasoning": false}+ },+ {+ "name": "an empty include list is accepted",+ "body": {"model": "m", "input": "Hi", "include": []},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "include_reasoning": false}+ },+ {+ "name": "text.format text adds nothing",+ "body": {"model": "m", "input": "Hi", "text": {"format": {"type": "text"}, "verbosity": "medium"}},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "include_reasoning": false}+ },+ {+ "name": "text.format json_object",+ "body": {"model": "m", "input": "Reply in JSON.", "text": {"format": {"type": "json_object"}}},+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Reply in JSON."}],+ "stream": false,+ "response_format": {"type": "json_object"},+ "include_reasoning": false+ }+ },+ {+ "name": "text.format json_schema",+ "body": {+ "model": "m",+ "input": "Name a city.",+ "text": {+ "format": {+ "type": "json_schema",+ "name": "city",+ "description": "A city and its country.",+ "schema": {+ "type": "object",+ "properties": {"city": {"type": "string"}, "country": {"type": "string"}},+ "required": ["city", "country"],+ "additionalProperties": false+ },+ "strict": true+ }+ }+ },+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Name a city."}],+ "stream": false,+ "response_format": {+ "type": "json_schema",+ "json_schema": {+ "name": "city",+ "schema": {+ "type": "object",+ "properties": {"city": {"type": "string"}, "country": {"type": "string"}},+ "required": ["city", "country"],+ "additionalProperties": false+ },+ "strict": true,+ "description": "A city and its country."+ }+ },+ "include_reasoning": false+ }+ },+ {+ "name": "text.format json_schema without strict or description",+ "body": {"model": "m", "input": "Name a city.", "text": {"format": {"type": "json_schema", "name": "city", "schema": {"type": "object"}}}},+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Name a city."}],+ "stream": false,+ "response_format": {"type": "json_schema", "json_schema": {"name": "city", "schema": {"type": "object"}}},+ "include_reasoning": false+ }+ },+ {+ "name": "reasoning.effort becomes reasoning_effort",+ "body": {"model": "m", "input": "Think hard.", "reasoning": {"effort": "high", "summary": "auto"}},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Think hard."}], "stream": false, "include_reasoning": false, "reasoning_effort": "high"}+ },+ {+ "name": "reasoning with a null effort adds nothing",+ "body": {"model": "m", "input": "Hi", "reasoning": {"effort": null}},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "include_reasoning": false}+ },+ {+ "name": "stream adds stream_options",+ "body": {"model": "m", "input": "Hi", "stream": true},+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Hi"}],+ "stream": true,+ "stream_options": {"include_usage": true},+ "include_reasoning": false+ }+ },+ {+ "name": "stream false",+ "body": {"model": "m", "input": "Hi", "stream": false},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "include_reasoning": false}+ },+ {+ "name": "sampling and passed-through fields",+ "body": {+ "model": "m",+ "input": "Hi",+ "max_output_tokens": 64,+ "temperature": 0.2,+ "top_p": 0.9,+ "seed": 7,+ "parallel_tool_calls": false,+ "metadata": {"trace": "t-1"},+ "user": "u-1",+ "safety_identifier": "s-1",+ "service_tier": "auto"+ },+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Hi"}],+ "max_completion_tokens": 64,+ "temperature": 0.2,+ "top_p": 0.9,+ "seed": 7,+ "stream": false,+ "parallel_tool_calls": false,+ "metadata": {"trace": "t-1"},+ "user": "u-1",+ "safety_identifier": "s-1",+ "service_tier": "auto",+ "include_reasoning": false+ }+ },+ {+ "name": "prompt_cache_key is passed through",+ "body": {"model": "m", "input": "Hi", "prompt_cache_key": "cache-1"},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "prompt_cache_key": "cache-1", "include_reasoning": false}+ },+ {+ "name": "function tools, strict false is accepted and dropped, tool_choice required passes through",+ "body": {+ "model": "m",+ "input": "Run ls.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]},+ "strict": false+ },+ {"type": "function", "name": "noop"}+ ],+ "tool_choice": "required",+ "parallel_tool_calls": true+ },+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Run ls."}],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ },+ {"type": "function", "function": {"name": "noop"}}+ ],+ "tool_choice": "required",+ "parallel_tool_calls": true,+ "include_reasoning": false+ }+ },+ {+ "name": "tool_choice auto passes through with tools",+ "body": {+ "model": "m",+ "input": "Run ls.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "tool_choice": "auto"+ },+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Run ls."}],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ }+ ],+ "tool_choice": "auto",+ "include_reasoning": false+ }+ },+ {+ "name": "tool_choice none passes through with tools",+ "body": {+ "model": "m",+ "input": "Run ls.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "tool_choice": "none"+ },+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Run ls."}],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ }+ ],+ "tool_choice": "none",+ "include_reasoning": false+ }+ },+ {+ "name": "named function tool_choice",+ "body": {+ "model": "m",+ "input": "Run ls.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "tool_choice": {"type": "function", "name": "exec_command"}+ },+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Run ls."}],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ }+ ],+ "tool_choice": {"type": "function", "function": {"name": "exec_command"}},+ "include_reasoning": false+ }+ },+ {+ "name": "named custom tool_choice",+ "body": {+ "model": "m",+ "input": "Patch it.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ },+ {"type": "custom", "name": "apply_patch", "description": "Apply a patch to files."}+ ],+ "tool_choice": {"type": "custom", "name": "apply_patch"}+ },+ "chat": {+ "model": "m",+ "messages": [{"role": "user", "content": "Patch it."}],+ "stream": false,+ "tools": [+ {+ "type": "function",+ "function": {+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ },+ {+ "type": "function",+ "function": {+ "name": "apply_patch",+ "description": "Apply a patch to files.",+ "parameters": {"type": "object", "properties": {"input": {"type": "string"}}, "required": ["input"], "additionalProperties": false}+ }+ }+ ],+ "tool_choice": {"type": "function", "function": {"name": "apply_patch"}},+ "include_reasoning": false+ }+ },+ {+ "name": "tool_choice auto without tools is dropped",+ "body": {"model": "m", "input": "Hi", "tool_choice": "auto"},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "include_reasoning": false}+ },+ {+ "name": "tool_choice none with an empty tools list is dropped with the list",+ "body": {"model": "m", "input": "Hi", "tools": [], "tool_choice": "none"},+ "chat": {"model": "m", "messages": [{"role": "user", "content": "Hi"}], "stream": false, "include_reasoning": false}+ }+ ],+ "rejected": [+ {+ "name": "missing model",+ "body": {"input": "x"},+ "expect": {"status": 400, "type": "invalid_request_error", "code": "invalid_request", "param": "model", "message": "model: Field required"}+ },+ {+ "name": "missing input",+ "body": {"model": "m"},+ "expect": {"status": 400, "type": "invalid_request_error", "code": "invalid_request", "param": "input", "message": "input: Field required"}+ },+ {+ "name": "empty input list",+ "body": {"model": "m", "input": []},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "invalid_request",+ "param": "input",+ "message": "input: List should have at least 1 item"+ }+ },+ {+ "name": "max_output_tokens as a string",+ "body": {"model": "m", "input": "x", "max_output_tokens": "16"},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "invalid_request",+ "param": "max_output_tokens",+ "message": "max_output_tokens: Input should be a valid integer"+ }+ },+ {+ "name": "zero max_output_tokens",+ "body": {"model": "m", "input": "x", "max_output_tokens": 0},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "invalid_request",+ "param": "max_output_tokens",+ "message": "max_output_tokens: Input should be greater than or equal to 1"+ }+ },+ {+ "name": "stream as a string",+ "body": {"model": "m", "input": "x", "stream": "true"},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "invalid_request",+ "param": "stream",+ "message": "stream: Input should be a valid boolean"+ }+ },+ {+ "name": "store true",+ "body": {"model": "m", "input": "x", "store": true},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "store",+ "message": "store: SIE does not store responses; send the full conversation in input"+ }+ },+ {+ "name": "previous_response_id",+ "body": {"model": "m", "input": "x", "previous_response_id": "resp_123"},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "previous_response_id",+ "message": "previous_response_id: SIE does not store responses; send the full conversation in input"+ }+ },+ {+ "name": "conversation id",+ "body": {"model": "m", "input": "x", "conversation": "conv_123"},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "conversation",+ "message": "conversation: SIE does not store responses; send the full conversation in input"+ }+ },+ {+ "name": "conversation object",+ "body": {"model": "m", "input": "x", "conversation": {"id": "conv_123"}},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "conversation",+ "message": "conversation: SIE does not store responses; send the full conversation in input"+ }+ },+ {+ "name": "background true",+ "body": {"model": "m", "input": "x", "background": true},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "background",+ "message": "background: background responses are not supported"+ }+ },+ {+ "name": "truncation auto",+ "body": {"model": "m", "input": "x", "truncation": "auto"},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "truncation",+ "message": "truncation: only \"disabled\" is supported"+ }+ },+ {+ "name": "include another value",+ "body": {"model": "m", "input": "x", "include": ["reasoning.encrypted_content", "message.output_text.logprobs"]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "include[1]",+ "message": "include[1]: 'message.output_text.logprobs' is not supported"+ }+ },+ {+ "name": "prompt template",+ "body": {"model": "m", "input": "x", "prompt": {"id": "pmpt_123", "variables": {"city": "Paris"}}},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "prompt",+ "message": "prompt: Extra inputs are not permitted"+ }+ },+ {+ "name": "max_tool_calls",+ "body": {"model": "m", "input": "x", "max_tool_calls": 4},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "max_tool_calls",+ "message": "max_tool_calls: Extra inputs are not permitted"+ }+ },+ {+ "name": "top_logprobs",+ "body": {"model": "m", "input": "x", "top_logprobs": 2},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "top_logprobs",+ "message": "top_logprobs: Extra inputs are not permitted"+ }+ },+ {+ "name": "stream_options",+ "body": {"model": "m", "input": "x", "stream": true, "stream_options": {"include_obfuscation": false}},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "stream_options",+ "message": "stream_options: Extra inputs are not permitted"+ }+ },+ {+ "name": "unknown top-level field",+ "body": {"model": "m", "input": "x", "stop": ["END"]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "stop",+ "message": "stop: Extra inputs are not permitted"+ }+ },+ {+ "name": "unknown reasoning key",+ "body": {"model": "m", "input": "x", "reasoning": {"effort": "low", "budget_tokens": 1024}},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "reasoning.budget_tokens",+ "message": "reasoning.budget_tokens: Extra inputs are not permitted"+ }+ },+ {+ "name": "unknown text key",+ "body": {"model": "m", "input": "x", "text": {"format": {"type": "text"}, "stop": ["END"]}},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "text.stop",+ "message": "text.stop: Extra inputs are not permitted"+ }+ },+ {+ "name": "unknown text.format type",+ "body": {"model": "m", "input": "x", "text": {"format": {"type": "grammar"}}},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "text.format.type",+ "message": "text.format.type: 'grammar' is not supported"+ }+ },+ {+ "name": "unknown text.format key",+ "body": {"model": "m", "input": "x", "text": {"format": {"type": "json_object", "schema": {"type": "object"}}}},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "text.format.schema",+ "message": "text.format.schema: Extra inputs are not permitted"+ }+ },+ {+ "name": "item_reference item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "item_reference", "id": "msg_1"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'item_reference' are not supported"+ }+ },+ {+ "name": "web_search_call item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "web_search_call", "id": "ws_1", "status": "completed"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'web_search_call' are not supported"+ }+ },+ {+ "name": "file_search_call item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "file_search_call", "id": "fs_1", "queries": []}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'file_search_call' are not supported"+ }+ },+ {+ "name": "computer_call item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "computer_call", "id": "cu_1", "call_id": "c1"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'computer_call' are not supported"+ }+ },+ {+ "name": "computer_call_output item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "computer_call_output", "call_id": "c1", "output": {}}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'computer_call_output' are not supported"+ }+ },+ {+ "name": "local_shell_call item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "local_shell_call", "id": "ls_1", "call_id": "c1"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'local_shell_call' are not supported"+ }+ },+ {+ "name": "local_shell_call_output item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "local_shell_call_output", "id": "c1", "output": "ok"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'local_shell_call_output' are not supported"+ }+ },+ {+ "name": "mcp_call item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "mcp_call", "id": "mcp_1", "name": "t", "server_label": "s"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'mcp_call' are not supported"+ }+ },+ {+ "name": "mcp_list_tools item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "mcp_list_tools", "id": "mcp_2", "server_label": "s", "tools": []}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'mcp_list_tools' are not supported"+ }+ },+ {+ "name": "image_generation_call item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "image_generation_call", "id": "ig_1"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'image_generation_call' are not supported"+ }+ },+ {+ "name": "code_interpreter_call item",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "code_interpreter_call", "id": "ci_1"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'code_interpreter_call' are not supported"+ }+ },+ {+ "name": "unknown item type",+ "body": {"model": "m", "input": [{"role": "user", "content": "x"}, {"type": "note", "text": "y"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].type",+ "message": "input[1].type: items of type 'note' are not supported"+ }+ },+ {+ "name": "unknown message key",+ "body": {"model": "m", "input": [{"role": "user", "content": "x", "name": "caller"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[0].name",+ "message": "input[0].name: Extra inputs are not permitted"+ }+ },+ {+ "name": "unknown function_call_output key",+ "body": {+ "model": "m",+ "input": [+ {"role": "user", "content": "x"},+ {"type": "function_call", "call_id": "call_1", "name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"},+ {"type": "function_call_output", "call_id": "call_1", "output": "a", "is_error": false}+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[2].is_error",+ "message": "input[2].is_error: Extra inputs are not permitted"+ }+ },+ {+ "name": "unknown content part key",+ "body": {"model": "m", "input": [{"role": "user", "content": [{"type": "input_text", "text": "x", "cache_control": {"type": "ephemeral"}}]}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[0].content[0].cache_control",+ "message": "input[0].content[0].cache_control: Extra inputs are not permitted"+ }+ },+ {+ "name": "missing role",+ "body": {"model": "m", "input": [{"content": "x"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "invalid_request",+ "param": "input[0].role",+ "message": "input[0].role: Field required"+ }+ },+ {+ "name": "tool role",+ "body": {"model": "m", "input": [{"role": "tool", "content": "x"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "invalid_request",+ "param": "input[0].role",+ "message": "input[0].role: Input should be 'user', 'assistant', 'system' or 'developer'"+ }+ },+ {+ "name": "input_file part",+ "body": {+ "model": "m",+ "input": [{"role": "user", "content": [{"type": "input_text", "text": "Read this."}, {"type": "input_file", "file_id": "file_1"}]}]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[0].content[1].type",+ "message": "input[0].content[1].type: parts of type 'input_file' are not supported"+ }+ },+ {+ "name": "input_audio part",+ "body": {"model": "m", "input": [{"role": "user", "content": [{"type": "input_audio", "input_audio": {"data": "UklGRg==", "format": "wav"}}]}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[0].content[0].type",+ "message": "input[0].content[0].type: parts of type 'input_audio' are not supported"+ }+ },+ {+ "name": "refusal part",+ "body": {+ "model": "m",+ "input": [+ {"role": "user", "content": "x"},+ {"type": "message", "role": "assistant", "content": [{"type": "refusal", "refusal": "No."}]},+ {"role": "user", "content": "y"}+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].content[0].type",+ "message": "input[1].content[0].type: parts of type 'refusal' are not supported"+ }+ },+ {+ "name": "image in an assistant message",+ "body": {+ "model": "m",+ "input": [+ {"role": "user", "content": "x"},+ {+ "role": "assistant",+ "content": [+ {+ "type": "input_image",+ "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="+ }+ ]+ },+ {"role": "user", "content": "y"}+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[1].content[0].type",+ "message": "input[1].content[0].type: parts of type 'input_image' are only supported in user messages"+ }+ },+ {+ "name": "image in a developer message",+ "body": {+ "model": "m",+ "input": [+ {+ "role": "developer",+ "content": [+ {+ "type": "input_image",+ "image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="+ }+ ]+ },+ {"role": "user", "content": "y"}+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[0].content[0].type",+ "message": "input[0].content[0].type: parts of type 'input_image' are only supported in user messages"+ }+ },+ {+ "name": "remote image URL",+ "body": {"model": "m", "input": [{"role": "user", "content": [{"type": "input_image", "image_url": "https://example.com/a.png"}]}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[0].content[0].image_url",+ "message": "input[0].content[0].image_url: only base64 data: URLs are supported"+ }+ },+ {+ "name": "file_id image",+ "body": {"model": "m", "input": [{"role": "user", "content": [{"type": "input_image", "file_id": "file_123", "detail": "auto"}]}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[0].content[0].file_id",+ "message": "input[0].content[0].file_id: only base64 data: URLs are supported"+ }+ },+ {+ "name": "input_file in a tool output",+ "body": {+ "model": "m",+ "input": [+ {"role": "user", "content": "x"},+ {"type": "function_call", "call_id": "call_1", "name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"},+ {"type": "function_call_output", "call_id": "call_1", "output": [{"type": "input_file", "file_id": "file_1"}]}+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[2].output[0].type",+ "message": "input[2].output[0].type: parts of type 'input_file' are not supported"+ }+ },+ {+ "name": "remote image URL in a tool output",+ "body": {+ "model": "m",+ "input": [+ {"role": "user", "content": "x"},+ {"type": "function_call", "call_id": "call_1", "name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"},+ {+ "type": "function_call_output",+ "call_id": "call_1",+ "output": [{"type": "input_text", "text": "a"}, {"type": "input_image", "image_url": "https://example.com/a.png"}]+ }+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "input[2].output[1].image_url",+ "message": "input[2].output[1].image_url: only base64 data: URLs are supported"+ }+ },+ {+ "name": "web_search tool",+ "body": {+ "model": "m",+ "input": "x",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ },+ {"type": "web_search"}+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[1].type",+ "message": "tools[1].type: 'web_search' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "web_search_preview tool",+ "body": {"model": "m", "input": "x", "tools": [{"type": "web_search_preview"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].type",+ "message": "tools[0].type: 'web_search_preview' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "file_search tool",+ "body": {"model": "m", "input": "x", "tools": [{"type": "file_search", "vector_store_ids": ["vs_1"]}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].type",+ "message": "tools[0].type: 'file_search' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "code_interpreter tool",+ "body": {"model": "m", "input": "x", "tools": [{"type": "code_interpreter", "container": {"type": "auto"}}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].type",+ "message": "tools[0].type: 'code_interpreter' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "computer_use_preview tool",+ "body": {"model": "m", "input": "x", "tools": [{"type": "computer_use_preview", "display_width": 1024, "display_height": 768, "environment": "browser"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].type",+ "message": "tools[0].type: 'computer_use_preview' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "mcp tool",+ "body": {"model": "m", "input": "x", "tools": [{"type": "mcp", "server_label": "docs", "server_url": "https://example.com/mcp"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].type",+ "message": "tools[0].type: 'mcp' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "local_shell tool",+ "body": {"model": "m", "input": "x", "tools": [{"type": "local_shell"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].type",+ "message": "tools[0].type: 'local_shell' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "image_generation tool",+ "body": {"model": "m", "input": "x", "tools": [{"type": "image_generation"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].type",+ "message": "tools[0].type: 'image_generation' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "namespace tool",+ "body": {+ "model": "m",+ "input": "x",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ },+ {"type": "custom", "name": "apply_patch", "description": "Apply a patch to files."},+ {"type": "namespace", "name": "agents", "description": "d", "tools": [{"type": "function", "name": "spawn"}]}+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[2].type",+ "message": "tools[2].type: 'namespace' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "unknown tool type",+ "body": {"model": "m", "input": "x", "tools": [{"type": "shell"}]},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].type",+ "message": "tools[0].type: 'shell' tools are not supported; send function or custom tools"+ }+ },+ {+ "name": "strict function tool",+ "body": {+ "model": "m",+ "input": "x",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]},+ "strict": true+ }+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].strict",+ "message": "tools[0].strict: strict function schemas are not supported"+ }+ },+ {+ "name": "unknown function tool key",+ "body": {+ "model": "m",+ "input": "x",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]},+ "defer_loading": true+ }+ ]+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tools[0].defer_loading",+ "message": "tools[0].defer_loading: Extra inputs are not permitted"+ }+ },+ {+ "name": "allowed_tools tool_choice",+ "body": {+ "model": "m",+ "input": "x",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "tool_choice": {"type": "allowed_tools", "mode": "auto", "tools": [{"type": "function", "name": "exec_command"}]}+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tool_choice.type",+ "message": "tool_choice.type: 'allowed_tools' is not supported"+ }+ },+ {+ "name": "hosted tool_choice",+ "body": {+ "model": "m",+ "input": "x",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "tool_choice": {"type": "web_search_preview"}+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "unsupported_field",+ "param": "tool_choice.type",+ "message": "tool_choice.type: 'web_search_preview' is not supported"+ }+ },+ {+ "name": "undeclared named function tool_choice",+ "body": {+ "model": "m",+ "input": "x",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "tool_choice": {"type": "function", "name": "read_file"}+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "invalid_request",+ "param": "tool_choice.name",+ "message": "tool_choice.name: tool 'read_file' is not declared in tools"+ }+ },+ {+ "name": "undeclared named custom tool_choice",+ "body": {+ "model": "m",+ "input": "x",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "tool_choice": {"type": "custom", "name": "apply_patch"}+ },+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "invalid_request",+ "param": "tool_choice.name",+ "message": "tool_choice.name: tool 'apply_patch' is not declared in tools"+ }+ },+ {+ "name": "named tool_choice without tools",+ "body": {"model": "m", "input": "x", "tool_choice": {"type": "function", "name": "exec_command"}},+ "expect": {+ "status": 400,+ "type": "invalid_request_error",+ "code": "invalid_request",+ "param": "tool_choice.name",+ "message": "tool_choice.name: tool 'exec_command' is not declared in tools"+ }+ }+ ]+}diff --git a/conformance/openai_responses/response_vectors.json b/conformance/openai_responses/response_vectors.jsonnew file mode 100644index 000000000..61e862628--- /dev/null+++ b/conformance/openai_responses/response_vectors.json@@ -0,0 +1,626 @@+{+ "translated": [+ {+ "name": "text",+ "model": "m",+ "request_id": "r1",+ "request": {"model": "m", "input": "Hi"},+ "chat": {+ "id": "chatcmpl-r1",+ "object": "chat.completion",+ "model": "m",+ "choices": [{"index": 0, "message": {"role": "assistant", "content": "Hello."}, "finish_reason": "stop", "logprobs": null}],+ "usage": {"prompt_tokens": 10, "completion_tokens": 3, "total_tokens": 13}+ },+ "response": {+ "id": "resp-r1",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r1",+ "role": "assistant",+ "status": "completed",+ "content": [{"type": "output_text", "text": "Hello.", "annotations": []}]+ }+ ],+ "usage": {+ "input_tokens": 10,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 3,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 13+ }+ }+ },+ {+ "name": "text and parallel function calls",+ "model": "m",+ "request_id": "r2",+ "request": {+ "model": "m",+ "input": "Run both.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "tool_choice": "auto",+ "parallel_tool_calls": true+ },+ "chat": {+ "choices": [+ {+ "index": 0,+ "message": {+ "role": "assistant",+ "content": "Running both.",+ "tool_calls": [+ {"id": "call_1", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\": \"echo one\"}"}},+ {"id": "call_2", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\": \"echo two\"}"}}+ ]+ },+ "finish_reason": "tool_calls"+ }+ ],+ "usage": {"prompt_tokens": 20, "completion_tokens": 12, "total_tokens": 32}+ },+ "response": {+ "id": "resp-r2",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r2",+ "role": "assistant",+ "status": "completed",+ "content": [{"type": "output_text", "text": "Running both.", "annotations": []}]+ },+ {+ "type": "function_call",+ "id": "fc-r2-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\": \"echo one\"}",+ "status": "completed"+ },+ {+ "type": "function_call",+ "id": "fc-r2-1",+ "call_id": "call_2",+ "name": "exec_command",+ "arguments": "{\"cmd\": \"echo two\"}",+ "status": "completed"+ }+ ],+ "usage": {+ "input_tokens": 20,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 12,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 32+ }+ }+ },+ {+ "name": "custom tool call",+ "model": "m",+ "request_id": "r3",+ "request": {+ "model": "m",+ "input": "Add a line.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ },+ {"type": "custom", "name": "apply_patch", "description": "Apply a patch to files."}+ ]+ },+ "chat": {+ "choices": [+ {+ "index": 0,+ "message": {+ "role": "assistant",+ "content": null,+ "tool_calls": [+ {+ "id": "call_p",+ "type": "function",+ "function": {"name": "apply_patch", "arguments": "{\"input\": \"*** Begin Patch\\n*** Update File: notes.txt\\n+café\\n*** End Patch\\n\"}"}+ }+ ]+ },+ "finish_reason": "tool_calls"+ }+ ],+ "usage": {"prompt_tokens": 30, "completion_tokens": 25, "total_tokens": 55}+ },+ "response": {+ "id": "resp-r3",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "custom_tool_call",+ "id": "ctc-r3-0",+ "call_id": "call_p",+ "name": "apply_patch",+ "input": "*** Begin Patch\n*** Update File: notes.txt\n+café\n*** End Patch\n",+ "status": "completed"+ }+ ],+ "usage": {+ "input_tokens": 30,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 25,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 55+ }+ }+ },+ {+ "name": "custom tool call whose arguments are not JSON keeps them as the input",+ "model": "m",+ "request_id": "r4",+ "request": {"model": "m", "input": "Add a line.", "tools": [{"type": "custom", "name": "apply_patch", "description": "Apply a patch to files."}]},+ "chat": {+ "choices": [+ {+ "index": 0,+ "message": {+ "role": "assistant",+ "content": null,+ "tool_calls": [{"id": "call_p", "type": "function", "function": {"name": "apply_patch", "arguments": "*** Begin Patch\n*** End Patch\n"}}]+ },+ "finish_reason": "tool_calls"+ }+ ],+ "usage": {"prompt_tokens": 30, "completion_tokens": 9, "total_tokens": 39}+ },+ "response": {+ "id": "resp-r4",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "custom_tool_call",+ "id": "ctc-r4-0",+ "call_id": "call_p",+ "name": "apply_patch",+ "input": "*** Begin Patch\n*** End Patch\n",+ "status": "completed"+ }+ ],+ "usage": {+ "input_tokens": 30,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 9,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 39+ }+ }+ },+ {+ "name": "calls are numbered by position, a custom call without a string input keeps its arguments",+ "model": "m",+ "request_id": "r5",+ "request": {+ "model": "m",+ "input": "Do three things.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ },+ {"type": "custom", "name": "apply_patch", "description": "Apply a patch to files."}+ ]+ },+ "chat": {+ "choices": [+ {+ "index": 0,+ "message": {+ "role": "assistant",+ "content": null,+ "tool_calls": [+ {"id": "call_a", "type": "function", "function": {"name": "apply_patch", "arguments": "{\"input\":\"*** Begin Patch\\n*** End Patch\\n\"}"}},+ {"id": "call_b", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"}},+ {"id": "call_c", "type": "function", "function": {"name": "apply_patch", "arguments": "{\"patch\":\"x\"}"}}+ ]+ },+ "finish_reason": "tool_calls"+ }+ ],+ "usage": {"prompt_tokens": 40, "completion_tokens": 30, "total_tokens": 70}+ },+ "response": {+ "id": "resp-r5",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "custom_tool_call",+ "id": "ctc-r5-0",+ "call_id": "call_a",+ "name": "apply_patch",+ "input": "*** Begin Patch\n*** End Patch\n",+ "status": "completed"+ },+ {"type": "function_call", "id": "fc-r5-1", "call_id": "call_b", "name": "exec_command", "arguments": "{\"cmd\":\"ls\"}", "status": "completed"},+ {"type": "custom_tool_call", "id": "ctc-r5-2", "call_id": "call_c", "name": "apply_patch", "input": "{\"patch\":\"x\"}", "status": "completed"}+ ],+ "usage": {+ "input_tokens": 40,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 30,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 70+ }+ }+ },+ {+ "name": "length is incomplete with reason max_output_tokens",+ "model": "m",+ "request_id": "r6",+ "request": {"model": "m", "input": "Write a long story.", "max_output_tokens": 16},+ "chat": {+ "choices": [{"index": 0, "message": {"role": "assistant", "content": "Once upon a time"}, "finish_reason": "length"}],+ "usage": {"prompt_tokens": 5, "completion_tokens": 16, "total_tokens": 21}+ },+ "response": {+ "id": "resp-r6",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "incomplete",+ "incomplete_details": {"reason": "max_output_tokens"},+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r6",+ "role": "assistant",+ "status": "completed",+ "content": [{"type": "output_text", "text": "Once upon a time", "annotations": []}]+ }+ ],+ "usage": {+ "input_tokens": 5,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 16,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 21+ }+ }+ },+ {+ "name": "content_filter is incomplete with reason content_filter, empty content has no message item",+ "model": "m",+ "request_id": "r7",+ "request": {"model": "m", "input": "x"},+ "chat": {+ "choices": [{"index": 0, "message": {"role": "assistant", "content": ""}, "finish_reason": "content_filter"}],+ "usage": {"prompt_tokens": 5, "completion_tokens": 0, "total_tokens": 5}+ },+ "response": {+ "id": "resp-r7",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "incomplete",+ "incomplete_details": {"reason": "content_filter"},+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": {+ "input_tokens": 5,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 0,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 5+ }+ }+ },+ {+ "name": "cached and reasoning tokens",+ "model": "org/model:profile",+ "request_id": "r8",+ "request": {"model": "org/model:profile", "input": "Think.", "reasoning": {"effort": "high"}},+ "chat": {+ "choices": [{"index": 0, "message": {"role": "assistant", "content": "42"}, "finish_reason": "stop"}],+ "usage": {+ "prompt_tokens": 100,+ "completion_tokens": 30,+ "total_tokens": 130,+ "prompt_tokens_details": {"cached_tokens": 60},+ "completion_tokens_details": {"reasoning_tokens": 20}+ }+ },+ "response": {+ "id": "resp-r8",+ "object": "response",+ "created_at": 0,+ "model": "org/model:profile",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r8",+ "role": "assistant",+ "status": "completed",+ "content": [{"type": "output_text", "text": "42", "annotations": []}]+ }+ ],+ "usage": {+ "input_tokens": 100,+ "input_tokens_details": {"cached_tokens": 60},+ "output_tokens": 30,+ "output_tokens_details": {"reasoning_tokens": 20},+ "total_tokens": 130+ }+ }+ },+ {+ "name": "null content with only a tool call, request tool_choice and parallel_tool_calls are echoed",+ "model": "m",+ "request_id": "r9",+ "request": {+ "model": "m",+ "input": "Run ls.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ],+ "tool_choice": {"type": "function", "name": "exec_command"},+ "parallel_tool_calls": false+ },+ "chat": {+ "choices": [+ {+ "index": 0,+ "message": {+ "role": "assistant",+ "content": null,+ "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"}}]+ },+ "finish_reason": "tool_calls"+ }+ ],+ "usage": {"prompt_tokens": 12, "completion_tokens": 8, "total_tokens": 20}+ },+ "response": {+ "id": "resp-r9",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": false,+ "tool_choice": {"type": "function", "name": "exec_command"},+ "output": [+ {"type": "function_call", "id": "fc-r9-0", "call_id": "call_1", "name": "exec_command", "arguments": "{\"cmd\":\"ls\"}", "status": "completed"}+ ],+ "usage": {+ "input_tokens": 12,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 8,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 20+ }+ }+ },+ {+ "name": "empty content with only a tool call",+ "model": "m",+ "request_id": "r10",+ "request": {+ "model": "m",+ "input": "Run ls.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ]+ },+ "chat": {+ "choices": [+ {+ "index": 0,+ "message": {+ "role": "assistant",+ "content": "",+ "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"}}]+ },+ "finish_reason": "tool_calls"+ }+ ],+ "usage": {"prompt_tokens": 12, "completion_tokens": 8, "total_tokens": 20}+ },+ "response": {+ "id": "resp-r10",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {"type": "function_call", "id": "fc-r10-0", "call_id": "call_1", "name": "exec_command", "arguments": "{\"cmd\":\"ls\"}", "status": "completed"}+ ],+ "usage": {+ "input_tokens": 12,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 8,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 20+ }+ }+ },+ {+ "name": "whitespace-only content is non-empty and stays a message item",+ "model": "m",+ "request_id": "r11",+ "request": {+ "model": "m",+ "input": "Run ls.",+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}+ }+ ]+ },+ "chat": {+ "choices": [+ {+ "index": 0,+ "message": {+ "role": "assistant",+ "content": "\n\n",+ "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "exec_command", "arguments": "{\"cmd\":\"ls\"}"}}]+ },+ "finish_reason": "stop"+ }+ ],+ "usage": {"prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21}+ },+ "response": {+ "id": "resp-r11",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r11",+ "role": "assistant",+ "status": "completed",+ "content": [{"type": "output_text", "text": "\n\n", "annotations": []}]+ },+ {"type": "function_call", "id": "fc-r11-0", "call_id": "call_1", "name": "exec_command", "arguments": "{\"cmd\":\"ls\"}", "status": "completed"}+ ],+ "usage": {+ "input_tokens": 12,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 9,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 21+ }+ }+ },+ {+ "name": "a finish reason other than length and content_filter completes",+ "model": "m",+ "request_id": "r12",+ "request": {"model": "m", "input": "Hi"},+ "chat": {+ "choices": [{"index": 0, "message": {"role": "assistant", "content": "Hello."}, "finish_reason": "function_call"}],+ "usage": {"prompt_tokens": 10, "completion_tokens": 3, "total_tokens": 13}+ },+ "response": {+ "id": "resp-r12",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r12",+ "role": "assistant",+ "status": "completed",+ "content": [{"type": "output_text", "text": "Hello.", "annotations": []}]+ }+ ],+ "usage": {+ "input_tokens": 10,+ "input_tokens_details": {"cached_tokens": 0},+ "output_tokens": 3,+ "output_tokens_details": {"reasoning_tokens": 0},+ "total_tokens": 13+ }+ }+ }+ ]+}diff --git a/conformance/openai_responses/stream_vectors.json b/conformance/openai_responses/stream_vectors.jsonnew file mode 100644index 000000000..d0c663369--- /dev/null+++ b/conformance/openai_responses/stream_vectors.json@@ -0,0 +1,3406 @@+{+ "description": "Chat completion SSE data payloads in, Responses events out, with created_at 0. Each event is sent as 'event: <type>' and 'data: <JSON>'. The stream ends after the terminal event, with no [DONE] frame.",+ "streams": [+ {+ "name": "text",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Hi",+ "stream": true+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "role": "assistant",+ "content": ""+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": "Hel"+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": "lo"+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": "stop"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 10,+ "completion_tokens": 2,+ "total_tokens": 12+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 3,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 4,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "Hel"+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 5,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "lo"+ }+ },+ {+ "event": "response.output_text.done",+ "data": {+ "type": "response.output_text.done",+ "sequence_number": 6,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "text": "Hello"+ }+ },+ {+ "event": "response.content_part.done",+ "data": {+ "type": "response.content_part.done",+ "sequence_number": 7,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "Hello",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 8,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Hello",+ "annotations": []+ }+ ]+ }+ }+ },+ {+ "event": "response.completed",+ "data": {+ "type": "response.completed",+ "sequence_number": 9,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Hello",+ "annotations": []+ }+ ]+ }+ ],+ "usage": {+ "input_tokens": 10,+ "input_tokens_details": {+ "cached_tokens": 0+ },+ "output_tokens": 2,+ "output_tokens_details": {+ "reasoning_tokens": 0+ },+ "total_tokens": 12+ }+ }+ }+ }+ ]+ },+ {+ "name": "text then a tool call",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "List the files.",+ "stream": true,+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string"+ }+ },+ "required": [+ "cmd"+ ]+ }+ }+ ],+ "tool_choice": "auto",+ "parallel_tool_calls": true+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "role": "assistant",+ "content": "Let me look."+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "id": "call_1",+ "type": "function",+ "function": {+ "name": "exec_command",+ "arguments": ""+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "function": {+ "arguments": "{\"cmd\":"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "function": {+ "arguments": "\"ls\"}"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": "tool_calls"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 50,+ "completion_tokens": 9,+ "total_tokens": 59,+ "prompt_tokens_details": {+ "cached_tokens": 32+ },+ "completion_tokens_details": {+ "reasoning_tokens": 4+ }+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 3,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 4,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "Let me look."+ }+ },+ {+ "event": "response.output_text.done",+ "data": {+ "type": "response.output_text.done",+ "sequence_number": 5,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "text": "Let me look."+ }+ },+ {+ "event": "response.content_part.done",+ "data": {+ "type": "response.content_part.done",+ "sequence_number": 6,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "Let me look.",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 7,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Let me look.",+ "annotations": []+ }+ ]+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 8,+ "output_index": 1,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "",+ "status": "in_progress"+ }+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 9,+ "item_id": "fc-r-0",+ "output_index": 1,+ "delta": "{\"cmd\":"+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 10,+ "item_id": "fc-r-0",+ "output_index": 1,+ "delta": "\"ls\"}"+ }+ },+ {+ "event": "response.function_call_arguments.done",+ "data": {+ "type": "response.function_call_arguments.done",+ "sequence_number": 11,+ "item_id": "fc-r-0",+ "output_index": 1,+ "arguments": "{\"cmd\":\"ls\"}"+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 12,+ "output_index": 1,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"ls\"}",+ "status": "completed"+ }+ }+ },+ {+ "event": "response.completed",+ "data": {+ "type": "response.completed",+ "sequence_number": 13,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Let me look.",+ "annotations": []+ }+ ]+ },+ {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"ls\"}",+ "status": "completed"+ }+ ],+ "usage": {+ "input_tokens": 50,+ "input_tokens_details": {+ "cached_tokens": 32+ },+ "output_tokens": 9,+ "output_tokens_details": {+ "reasoning_tokens": 4+ },+ "total_tokens": 59+ }+ }+ }+ }+ ]+ },+ {+ "name": "two parallel tool calls",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Run both.",+ "stream": true,+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string"+ }+ },+ "required": [+ "cmd"+ ]+ }+ }+ ]+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "role": "assistant"+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "id": "call_1",+ "type": "function",+ "function": {+ "name": "exec_command",+ "arguments": "{\"cmd\":\"echo one\"}"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 1,+ "id": "call_2",+ "type": "function",+ "function": {+ "name": "exec_command",+ "arguments": "{\"cmd\""+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 1,+ "function": {+ "arguments": ":\"echo two\"}"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": "tool_calls"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 30,+ "completion_tokens": 20,+ "total_tokens": 50+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "",+ "status": "in_progress"+ }+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 3,+ "item_id": "fc-r-0",+ "output_index": 0,+ "delta": "{\"cmd\":\"echo one\"}"+ }+ },+ {+ "event": "response.function_call_arguments.done",+ "data": {+ "type": "response.function_call_arguments.done",+ "sequence_number": 4,+ "item_id": "fc-r-0",+ "output_index": 0,+ "arguments": "{\"cmd\":\"echo one\"}"+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 5,+ "output_index": 0,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"echo one\"}",+ "status": "completed"+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 6,+ "output_index": 1,+ "item": {+ "type": "function_call",+ "id": "fc-r-1",+ "call_id": "call_2",+ "name": "exec_command",+ "arguments": "",+ "status": "in_progress"+ }+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 7,+ "item_id": "fc-r-1",+ "output_index": 1,+ "delta": "{\"cmd\""+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 8,+ "item_id": "fc-r-1",+ "output_index": 1,+ "delta": ":\"echo two\"}"+ }+ },+ {+ "event": "response.function_call_arguments.done",+ "data": {+ "type": "response.function_call_arguments.done",+ "sequence_number": 9,+ "item_id": "fc-r-1",+ "output_index": 1,+ "arguments": "{\"cmd\":\"echo two\"}"+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 10,+ "output_index": 1,+ "item": {+ "type": "function_call",+ "id": "fc-r-1",+ "call_id": "call_2",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"echo two\"}",+ "status": "completed"+ }+ }+ },+ {+ "event": "response.completed",+ "data": {+ "type": "response.completed",+ "sequence_number": 11,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"echo one\"}",+ "status": "completed"+ },+ {+ "type": "function_call",+ "id": "fc-r-1",+ "call_id": "call_2",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"echo two\"}",+ "status": "completed"+ }+ ],+ "usage": {+ "input_tokens": 30,+ "input_tokens_details": {+ "cached_tokens": 0+ },+ "output_tokens": 20,+ "output_tokens_details": {+ "reasoning_tokens": 0+ },+ "total_tokens": 50+ }+ }+ }+ }+ ]+ },+ {+ "name": "custom tool call",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Add a line.",+ "stream": true,+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string"+ }+ },+ "required": [+ "cmd"+ ]+ }+ },+ {+ "type": "custom",+ "name": "apply_patch",+ "description": "Apply a patch to files."+ }+ ]+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "id": "call_p",+ "type": "function",+ "function": {+ "name": "apply_patch",+ "arguments": "{\"input\":\"*** Begin Patch\\n"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "function": {+ "arguments": "*** Update File: notes.txt\\n+café\\n"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "function": {+ "arguments": "*** End Patch\\n\"}"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": "tool_calls"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 30,+ "completion_tokens": 25,+ "total_tokens": 55+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "custom_tool_call",+ "id": "ctc-r-0",+ "call_id": "call_p",+ "name": "apply_patch",+ "input": "",+ "status": "in_progress"+ }+ }+ },+ {+ "event": "response.custom_tool_call_input.delta",+ "data": {+ "type": "response.custom_tool_call_input.delta",+ "sequence_number": 3,+ "item_id": "ctc-r-0",+ "output_index": 0,+ "delta": "*** Begin Patch\n*** Update File: notes.txt\n+café\n*** End Patch\n"+ }+ },+ {+ "event": "response.custom_tool_call_input.done",+ "data": {+ "type": "response.custom_tool_call_input.done",+ "sequence_number": 4,+ "item_id": "ctc-r-0",+ "output_index": 0,+ "input": "*** Begin Patch\n*** Update File: notes.txt\n+café\n*** End Patch\n"+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 5,+ "output_index": 0,+ "item": {+ "type": "custom_tool_call",+ "id": "ctc-r-0",+ "call_id": "call_p",+ "name": "apply_patch",+ "input": "*** Begin Patch\n*** Update File: notes.txt\n+café\n*** End Patch\n",+ "status": "completed"+ }+ }+ },+ {+ "event": "response.completed",+ "data": {+ "type": "response.completed",+ "sequence_number": 6,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "custom_tool_call",+ "id": "ctc-r-0",+ "call_id": "call_p",+ "name": "apply_patch",+ "input": "*** Begin Patch\n*** Update File: notes.txt\n+café\n*** End Patch\n",+ "status": "completed"+ }+ ],+ "usage": {+ "input_tokens": 30,+ "input_tokens_details": {+ "cached_tokens": 0+ },+ "output_tokens": 25,+ "output_tokens_details": {+ "reasoning_tokens": 0+ },+ "total_tokens": 55+ }+ }+ }+ }+ ]+ },+ {+ "name": "length stop with the finish on the last text frame",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Write a long story.",+ "stream": true,+ "max_output_tokens": 4+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": "Once upon"+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": " a time"+ },+ "finish_reason": "length"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 5,+ "completion_tokens": 4,+ "total_tokens": 9+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 3,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 4,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "Once upon"+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 5,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": " a time"+ }+ },+ {+ "event": "response.output_text.done",+ "data": {+ "type": "response.output_text.done",+ "sequence_number": 6,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "text": "Once upon a time"+ }+ },+ {+ "event": "response.content_part.done",+ "data": {+ "type": "response.content_part.done",+ "sequence_number": 7,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "Once upon a time",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 8,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Once upon a time",+ "annotations": []+ }+ ]+ }+ }+ },+ {+ "event": "response.incomplete",+ "data": {+ "type": "response.incomplete",+ "sequence_number": 9,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "incomplete",+ "incomplete_details": {+ "reason": "max_output_tokens"+ },+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Once upon a time",+ "annotations": []+ }+ ]+ }+ ],+ "usage": {+ "input_tokens": 5,+ "input_tokens_details": {+ "cached_tokens": 0+ },+ "output_tokens": 4,+ "output_tokens_details": {+ "reasoning_tokens": 0+ },+ "total_tokens": 9+ }+ }+ }+ }+ ]+ },+ {+ "name": "error frame after output fails the response",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Hi",+ "stream": true+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": "par"+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": null+ }+ ],+ "error": {+ "message": "Generation aborted: inter_chunk timeout",+ "type": "server_error",+ "param": null,+ "code": "inter_chunk_timeout"+ },+ "request_id": "r"+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 3,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 4,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "par"+ }+ },+ {+ "event": "response.failed",+ "data": {+ "type": "response.failed",+ "sequence_number": 5,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "failed",+ "incomplete_details": null,+ "error": {+ "code": "inter_chunk_timeout",+ "message": "Generation aborted: inter_chunk timeout"+ },+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ }+ ]+ },+ {+ "name": "error frame before output fails the response",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Hi",+ "stream": true+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": null+ }+ ],+ "error": {+ "message": "The upstream serving the model is busy, please retry",+ "type": "server_error",+ "param": null,+ "code": "RESOURCE_EXHAUSTED",+ "retry_after_s": 5+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.failed",+ "data": {+ "type": "response.failed",+ "sequence_number": 2,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "failed",+ "incomplete_details": null,+ "error": {+ "code": "RESOURCE_EXHAUSTED",+ "message": "The upstream serving the model is busy, please retry"+ },+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ }+ ]+ },+ {+ "name": "text after a tool call opens a new message item",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "List the files.",+ "stream": true,+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string"+ }+ },+ "required": [+ "cmd"+ ]+ }+ }+ ]+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "role": "assistant",+ "content": "Listing."+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "id": "call_1",+ "type": "function",+ "function": {+ "name": "exec_command",+ "arguments": "{\"cmd\":\"ls\"}"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": "Waiting for "+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": "the output."+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": "tool_calls"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 40,+ "completion_tokens": 12,+ "total_tokens": 52+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 3,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 4,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "Listing."+ }+ },+ {+ "event": "response.output_text.done",+ "data": {+ "type": "response.output_text.done",+ "sequence_number": 5,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "text": "Listing."+ }+ },+ {+ "event": "response.content_part.done",+ "data": {+ "type": "response.content_part.done",+ "sequence_number": 6,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "Listing.",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 7,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Listing.",+ "annotations": []+ }+ ]+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 8,+ "output_index": 1,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "",+ "status": "in_progress"+ }+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 9,+ "item_id": "fc-r-0",+ "output_index": 1,+ "delta": "{\"cmd\":\"ls\"}"+ }+ },+ {+ "event": "response.function_call_arguments.done",+ "data": {+ "type": "response.function_call_arguments.done",+ "sequence_number": 10,+ "item_id": "fc-r-0",+ "output_index": 1,+ "arguments": "{\"cmd\":\"ls\"}"+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 11,+ "output_index": 1,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"ls\"}",+ "status": "completed"+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 12,+ "output_index": 2,+ "item": {+ "type": "message",+ "id": "msg-r-2",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 13,+ "item_id": "msg-r-2",+ "output_index": 2,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 14,+ "item_id": "msg-r-2",+ "output_index": 2,+ "content_index": 0,+ "delta": "Waiting for "+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 15,+ "item_id": "msg-r-2",+ "output_index": 2,+ "content_index": 0,+ "delta": "the output."+ }+ },+ {+ "event": "response.output_text.done",+ "data": {+ "type": "response.output_text.done",+ "sequence_number": 16,+ "item_id": "msg-r-2",+ "output_index": 2,+ "content_index": 0,+ "text": "Waiting for the output."+ }+ },+ {+ "event": "response.content_part.done",+ "data": {+ "type": "response.content_part.done",+ "sequence_number": 17,+ "item_id": "msg-r-2",+ "output_index": 2,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "Waiting for the output.",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 18,+ "output_index": 2,+ "item": {+ "type": "message",+ "id": "msg-r-2",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Waiting for the output.",+ "annotations": []+ }+ ]+ }+ }+ },+ {+ "event": "response.completed",+ "data": {+ "type": "response.completed",+ "sequence_number": 19,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Listing.",+ "annotations": []+ }+ ]+ },+ {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"ls\"}",+ "status": "completed"+ },+ {+ "type": "message",+ "id": "msg-r-2",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Waiting for the output.",+ "annotations": []+ }+ ]+ }+ ],+ "usage": {+ "input_tokens": 40,+ "input_tokens_details": {+ "cached_tokens": 0+ },+ "output_tokens": 12,+ "output_tokens_details": {+ "reasoning_tokens": 0+ },+ "total_tokens": 52+ }+ }+ }+ }+ ]+ },+ {+ "name": "a tool call completed before an error frame stays in the failed response",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Run both.",+ "stream": true,+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string"+ }+ },+ "required": [+ "cmd"+ ]+ }+ }+ ]+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "id": "call_1",+ "type": "function",+ "function": {+ "name": "exec_command",+ "arguments": "{\"cmd\":\"echo one\"}"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 1,+ "id": "call_2",+ "type": "function",+ "function": {+ "name": "exec_command",+ "arguments": "{\"cmd\""+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": null+ }+ ],+ "error": {+ "message": "Generation aborted: inter_chunk timeout",+ "type": "server_error",+ "param": null,+ "code": "inter_chunk_timeout"+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "",+ "status": "in_progress"+ }+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 3,+ "item_id": "fc-r-0",+ "output_index": 0,+ "delta": "{\"cmd\":\"echo one\"}"+ }+ },+ {+ "event": "response.function_call_arguments.done",+ "data": {+ "type": "response.function_call_arguments.done",+ "sequence_number": 4,+ "item_id": "fc-r-0",+ "output_index": 0,+ "arguments": "{\"cmd\":\"echo one\"}"+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 5,+ "output_index": 0,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"echo one\"}",+ "status": "completed"+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 6,+ "output_index": 1,+ "item": {+ "type": "function_call",+ "id": "fc-r-1",+ "call_id": "call_2",+ "name": "exec_command",+ "arguments": "",+ "status": "in_progress"+ }+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 7,+ "item_id": "fc-r-1",+ "output_index": 1,+ "delta": "{\"cmd\""+ }+ },+ {+ "event": "response.failed",+ "data": {+ "type": "response.failed",+ "sequence_number": 8,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "failed",+ "incomplete_details": null,+ "error": {+ "code": "inter_chunk_timeout",+ "message": "Generation aborted: inter_chunk timeout"+ },+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":\"echo one\"}",+ "status": "completed"+ }+ ],+ "usage": null+ }+ }+ }+ ]+ },+ {+ "name": "a stream that ends with neither a finish reason nor [DONE] fails",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Hi",+ "stream": true+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "role": "assistant",+ "content": "par"+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": "tial"+ },+ "finish_reason": null+ }+ ]+ }+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 3,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 4,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "par"+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 5,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "tial"+ }+ },+ {+ "event": "response.failed",+ "data": {+ "type": "response.failed",+ "sequence_number": 6,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "failed",+ "incomplete_details": null,+ "error": {+ "code": "server_error",+ "message": "the generation stream ended without a finish reason"+ },+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ }+ ]+ },+ {+ "name": "a stream that ends after a finish without [DONE] completes",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Hi",+ "stream": true+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": "Hello."+ },+ "finish_reason": "stop"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 10,+ "completion_tokens": 2,+ "total_tokens": 12+ }+ }+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 3,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 4,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "Hello."+ }+ },+ {+ "event": "response.output_text.done",+ "data": {+ "type": "response.output_text.done",+ "sequence_number": 5,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "text": "Hello."+ }+ },+ {+ "event": "response.content_part.done",+ "data": {+ "type": "response.content_part.done",+ "sequence_number": 6,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "Hello.",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 7,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Hello.",+ "annotations": []+ }+ ]+ }+ }+ },+ {+ "event": "response.completed",+ "data": {+ "type": "response.completed",+ "sequence_number": 8,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Hello.",+ "annotations": []+ }+ ]+ }+ ],+ "usage": {+ "input_tokens": 10,+ "input_tokens_details": {+ "cached_tokens": 0+ },+ "output_tokens": 2,+ "output_tokens_details": {+ "reasoning_tokens": 0+ },+ "total_tokens": 12+ }+ }+ }+ }+ ]+ },+ {+ "name": "a finish reason other than length and content_filter completes",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Hi",+ "stream": true+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "content": "Hello."+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": "function_call"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 10,+ "completion_tokens": 2,+ "total_tokens": 12+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 3,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 4,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "Hello."+ }+ },+ {+ "event": "response.output_text.done",+ "data": {+ "type": "response.output_text.done",+ "sequence_number": 5,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "text": "Hello."+ }+ },+ {+ "event": "response.content_part.done",+ "data": {+ "type": "response.content_part.done",+ "sequence_number": 6,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "Hello.",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 7,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Hello.",+ "annotations": []+ }+ ]+ }+ }+ },+ {+ "event": "response.completed",+ "data": {+ "type": "response.completed",+ "sequence_number": 8,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "completed",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "completed",+ "content": [+ {+ "type": "output_text",+ "text": "Hello.",+ "annotations": []+ }+ ]+ }+ ],+ "usage": {+ "input_tokens": 10,+ "input_tokens_details": {+ "cached_tokens": 0+ },+ "output_tokens": 2,+ "output_tokens_details": {+ "reasoning_tokens": 0+ },+ "total_tokens": 12+ }+ }+ }+ }+ ]+ },+ {+ "name": "arguments for a call whose item already closed fail the stream",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Run both.",+ "stream": true,+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string"+ }+ },+ "required": [+ "cmd"+ ]+ }+ }+ ]+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "id": "call_1",+ "type": "function",+ "function": {+ "name": "exec_command",+ "arguments": "{\"cmd\":"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 1,+ "id": "call_2",+ "type": "function",+ "function": {+ "name": "exec_command",+ "arguments": "{\"cmd\":\"echo two\"}"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "function": {+ "arguments": "\"echo one\"}"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": "tool_calls"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 30,+ "completion_tokens": 20,+ "total_tokens": 50+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "",+ "status": "in_progress"+ }+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 3,+ "item_id": "fc-r-0",+ "output_index": 0,+ "delta": "{\"cmd\":"+ }+ },+ {+ "event": "response.function_call_arguments.done",+ "data": {+ "type": "response.function_call_arguments.done",+ "sequence_number": 4,+ "item_id": "fc-r-0",+ "output_index": 0,+ "arguments": "{\"cmd\":"+ }+ },+ {+ "event": "response.output_item.done",+ "data": {+ "type": "response.output_item.done",+ "sequence_number": 5,+ "output_index": 0,+ "item": {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":",+ "status": "completed"+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 6,+ "output_index": 1,+ "item": {+ "type": "function_call",+ "id": "fc-r-1",+ "call_id": "call_2",+ "name": "exec_command",+ "arguments": "",+ "status": "in_progress"+ }+ }+ },+ {+ "event": "response.function_call_arguments.delta",+ "data": {+ "type": "response.function_call_arguments.delta",+ "sequence_number": 7,+ "item_id": "fc-r-1",+ "output_index": 1,+ "delta": "{\"cmd\":\"echo two\"}"+ }+ },+ {+ "event": "response.failed",+ "data": {+ "type": "response.failed",+ "sequence_number": 8,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "failed",+ "incomplete_details": null,+ "error": {+ "code": "server_error",+ "message": "tool call arguments arrived after another output item started"+ },+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [+ {+ "type": "function_call",+ "id": "fc-r-0",+ "call_id": "call_1",+ "name": "exec_command",+ "arguments": "{\"cmd\":",+ "status": "completed"+ }+ ],+ "usage": null+ }+ }+ }+ ]+ },+ {+ "name": "a new tool call without its id and name fails the stream",+ "request_id": "r",+ "model": "m",+ "request": {+ "model": "m",+ "input": "Run ls.",+ "stream": true,+ "tools": [+ {+ "type": "function",+ "name": "exec_command",+ "description": "Run a shell command.",+ "parameters": {+ "type": "object",+ "properties": {+ "cmd": {+ "type": "string"+ }+ },+ "required": [+ "cmd"+ ]+ }+ }+ ]+ },+ "frames": [+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "role": "assistant",+ "content": "Running."+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {+ "tool_calls": [+ {+ "index": 0,+ "function": {+ "arguments": "{\"cmd\":\"ls\"}"+ }+ }+ ]+ },+ "finish_reason": null+ }+ ]+ },+ {+ "choices": [+ {+ "index": 0,+ "delta": {},+ "finish_reason": "tool_calls"+ }+ ]+ },+ {+ "choices": [],+ "usage": {+ "prompt_tokens": 20,+ "completion_tokens": 8,+ "total_tokens": 28+ }+ },+ "[DONE]"+ ],+ "events": [+ {+ "event": "response.created",+ "data": {+ "type": "response.created",+ "sequence_number": 0,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.in_progress",+ "data": {+ "type": "response.in_progress",+ "sequence_number": 1,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "in_progress",+ "incomplete_details": null,+ "error": null,+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ },+ {+ "event": "response.output_item.added",+ "data": {+ "type": "response.output_item.added",+ "sequence_number": 2,+ "output_index": 0,+ "item": {+ "type": "message",+ "id": "msg-r",+ "role": "assistant",+ "status": "in_progress",+ "content": []+ }+ }+ },+ {+ "event": "response.content_part.added",+ "data": {+ "type": "response.content_part.added",+ "sequence_number": 3,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "part": {+ "type": "output_text",+ "text": "",+ "annotations": []+ }+ }+ },+ {+ "event": "response.output_text.delta",+ "data": {+ "type": "response.output_text.delta",+ "sequence_number": 4,+ "item_id": "msg-r",+ "output_index": 0,+ "content_index": 0,+ "delta": "Running."+ }+ },+ {+ "event": "response.failed",+ "data": {+ "type": "response.failed",+ "sequence_number": 5,+ "response": {+ "id": "resp-r",+ "object": "response",+ "created_at": 0,+ "model": "m",+ "status": "failed",+ "incomplete_details": null,+ "error": {+ "code": "server_error",+ "message": "a tool call arrived without its id and name"+ },+ "store": false,+ "parallel_tool_calls": true,+ "tool_choice": "auto",+ "output": [],+ "usage": null+ }+ }+ }+ ]+ }+ ]+}