support gpt-5.6 parameters#339
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0f5643a4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f47c7bdf90
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 500eb85483
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e6e5734b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf50db6008
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
|
|
||
| /// Which execution environments may call this tool. | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub allowed_callers: Option<Vec<UniversalToolCaller>>, |
There was a problem hiding this comment.
Mark optional tool fields optional in TS
When this is None, serde skips the field, but ts-rs generates it as a required allowed_callers: ... | null because there is no #[ts(optional)]/optional_fields (the checked-in UniversalTool.ts reflects this). Existing serialized tools and UniversalTool::function/custom/builtin outputs omit the key, so TS consumers now reject valid Lingua tool objects unless they add null; output_schema below has the same issue.
Useful? React with 👍 / 👎.
| "target": "*", | ||
| "skip": true, |
There was a problem hiding this comment.
Do not skip Responses self-roundtrips
With the runner now passing a comparison context for same-provider checks, this target: "*" skip applies to Responses→Responses as well as cross-provider transforms. That masks same-provider response roundtrip loss for responsesProgrammaticToolCallingToolsParam (for example program/caller fields) as an expected limitation, so coverage will not catch Responses-specific preservation regressions; restrict the skip to non-Responses targets or enumerate those targets.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f6c8f5537
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
|
Codex (@codex) review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 410d314c01
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| field: "Responses input item".to_string(), | ||
| error: e.to_string(), | ||
| })?; | ||
| match item.input_item_type { |
There was a problem hiding this comment.
Borrow item types before matching them
These helpers iterate over &openai::InputItem/&openai::OutputItem, but matching on item.input_item_type (and the analogous output_item_type match below) moves the Option<...> out of a shared reference. The generated item-type enums derive Clone but not Copy, so builds that include the OpenAI adapter fail here; match on as_ref() or clone the option before matching.
Useful? React with 👍 / 👎.
| if let Some(allowed_callers) = &tool.allowed_callers { | ||
| obj.insert( | ||
| "allowed_callers".to_string(), | ||
| serde_json::to_value(allowed_callers).map_err(|e| { | ||
| ConvertError::JsonSerializationFailed { | ||
| field: format!( | ||
| "Responses discovery function tool allowed_callers '{}'", | ||
| tool.name | ||
| ), | ||
| error: e.to_string(), | ||
| } | ||
| })?, | ||
| ); | ||
| } | ||
| if let Some(output_schema) = &tool.output_schema { | ||
| obj.insert("output_schema".to_string(), output_schema.clone()); |
There was a problem hiding this comment.
Keep new tool fields in the typed conversion path
In the exported universal_to_responses_input path, this object is immediately deserialized into the generated OpenAI tool structs, but those structs do not model allowed_callers or output_schema, so serde drops these newly inserted fields before the typed InputItem is returned. The private adapter rehydration preserves them only when request_from_universal serializes with the original messages, leaving direct typed conversions and typed roundtrips lossy for the GPT-5.6 tool fields.
Useful? React with 👍 / 👎.
| "testCase": "responsesAdditionalToolsMultipleToolsParam", | ||
| "source": "Responses", | ||
| "target": "*", | ||
| "skip": true, | ||
| "reason": "Responses additional_tools streaming events are provider-specific and do not round-trip through universal streaming deltas" |
There was a problem hiding this comment.
Scope Responses streaming skips to non-Responses targets
Because the runner now creates comparison context for same-provider streaming runs too, this target: "*" skip also matches Responses→Responses for responsesAdditionalToolsMultipleToolsParam. That turns any Responses self-roundtrip regression for this case into an expected limitation even though the reason is about provider-specific data not round-tripping through non-Responses streaming formats; enumerate the non-Responses targets or otherwise exclude the source==target pair.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb02b6c521
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| "caller": { | ||
| "type": "program", | ||
| "caller_id": "call_4DEyilA0eOIRmtXTIZkd1XaU" |
There was a problem hiding this comment.
Replay program items in programmatic follow-ups
This follow-up input contains a function_call.caller that references call_4DEyilA0eOIRmtXTIZkd1XaU, but the preceding program item from the captured response is not replayed, because the follow-up builder filters out program/program_output items. That leaves a dangling caller reference and means the generated GPT-5.6 programmatic-tool continuation is not a valid replay of the response context; include program items when building the follow-up input.
Useful? React with 👍 / 👎.
| followUpInput.push({ | ||
| type: "function_call_output", | ||
| call_id: message.call_id, | ||
| output: "71 degrees", | ||
| output, |
There was a problem hiding this comment.
Carry caller onto generated tool outputs
When the captured function_call was invoked by a program, message.caller needs to be copied onto the generated function_call_output; otherwise the follow-up loses the program-to-tool-result association even though the original call had a caller. The new continuation fixture models function_call_output.caller, so add caller: message.caller here when present.
Useful? React with 👍 / 👎.
| { | ||
| "testCase": "responsesProgrammaticToolCallingContinuationParam", | ||
| "source": "Responses", | ||
| "target": "*", |
There was a problem hiding this comment.
Exclude Responses self-roundtrips from program diffs
Because request comparisons now create a CompareContext even when source and target are both Responses, this target: "*" rule also marks Responses→Responses losses of program code, call_id, caller, status, etc. as expected, despite the reasons being specific to non-Responses targets. That masks same-provider continuation regressions; enumerate the non-Responses targets or otherwise exclude Responses as the target.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00db321aad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| provider_options: provider_options_from_openai_tool_call( | ||
| input.namespace, | ||
| None, | ||
| )?, |
There was a problem hiding this comment.
Preserve Responses function-call status
When a Responses input/output item is a function_call or custom_tool_call with a non-completed status, such as the new programmatic-tool follow-up status: "in_progress", this imports the call with None instead of input.status. The Universal message then has no way to distinguish the original status, and the Responses export path defaults these calls back to completed, so same-provider continuations can replay a still-pending programmatic call as completed. Please carry input.status through the provider options/export path.
Useful? React with 👍 / 👎.
| if let Some(cache_write) = self.prompt_cache_creation_tokens { | ||
| input_details | ||
| .insert("cache_write_tokens".into(), serde_json::json!(cache_write)); |
There was a problem hiding this comment.
Emit split cache writes as Responses cache_write_tokens
When Universal usage comes from Anthropic-style split cache creation (prompt_cache_creation_5m_tokens/prompt_cache_creation_1h_tokens) without the aggregate prompt_cache_creation_tokens, input_tokens above already includes the split sum via inclusive_prompt_tokens(), but this branch omits cache_write_tokens. Transforming that usage to Responses and parsing it back loses the cache-write total even though the Responses shape now has an aggregate field; use the existing prompt-cache-creation sum rather than only the aggregate field.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2369e1e632
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d9eea18c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| #[serde(rename = "_output_item_status")] | ||
| output_item_status: Option<openai::FunctionCallItemStatus>, |
There was a problem hiding this comment.
Model status canonically instead of hidden marker
This adds _output_item_status as an internal provider_options key to reconstruct Responses function-call status. /workspace/lingua/AGENTS.md explicitly says not to encode provider semantics via hidden marker fields in provider_options, so any import of an in_progress/incomplete function call now exposes an undocumented OpenAI-only marker in Universal instead of a typed/canonical status field or an explicit loss.
Useful? React with 👍 / 👎.
| "responsesGpt56PromptCacheOptionsParam", | ||
| "responsesGpt56ReasoningMaxProContextParam", | ||
| "responsesProgrammaticToolCallingToolsParam", |
There was a problem hiding this comment.
Keep GPT-5.6 fixtures in roundtrip tests
Adding these cases to RESPONSES_ROUNDTRIP_SKIP_CASES means generate_test_cases never emits first-turn/follow-up Responses roundtrip tests for the new GPT-5.6 snapshots. In practice, cargo test -p lingua can pass even if the newly added include, prompt-cache, reasoning, or programmatic-tool fields stop roundtripping through the Responses adapter despite snapshots existing for exactly those behaviors.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd4fb8f6f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| if self.availability == ToolAvailability::Deferred { | ||
| obj.insert("defer_loading".into(), Value::Bool(true)); | ||
| } | ||
| if let Some(allowed_callers) = &self.allowed_callers { |
There was a problem hiding this comment.
Reject non-OpenAI allowed callers for Responses
When a UniversalTool comes from Anthropic with allowed_callers such as CodeExecution20260521, this branch serializes those enum values directly into an OpenAI Responses tool. OpenAI's Responses docs specify allowed_callers values as only direct or programmatic (docs), so Anthropic code-execution callers become invalid OpenAI payloads instead of a clear transform limitation; please reject or map non-OpenAI caller values before emitting the Responses tool.
Useful? React with 👍 / 👎.

Summary
Adds support for GPT-5.6 Responses programmatic tool calling roundtrips, including OpenAI
program/program_outputitems, caller metadata, pending tool-call status, and programmatic tool restrictions.Changes
callermetadata when importing/exporting Responses function and custom tool calls/results.status: "in_progress".callerin assistant/tool dedup hashes so programmatic traces with different callers are not collapsed.allowed_callersandoutput_schemafor Responsesadditional_tools/ tool discovery serialization.programitems and carrycalleronto generated tooloutputs.
responsesProgrammaticToolCallingToolsParamthe canonicalgenerated continuation test.
programmaticcaller restrictions instead of silentlybroadening them.
represented.