Skip to content

support gpt-5.6 parameters#339

Merged
Ken Jiang (knjiang) merged 14 commits into
mainfrom
07-10-support_gpt-5.6_parameters
Jul 12, 2026
Merged

support gpt-5.6 parameters#339
Ken Jiang (knjiang) merged 14 commits into
mainfrom
07-10-support_gpt-5.6_parameters

Conversation

@knjiang

@knjiang Ken Jiang (knjiang) commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for GPT-5.6 Responses programmatic tool calling roundtrips, including OpenAI program /
program_output items, caller metadata, pending tool-call status, and programmatic tool restrictions.

Changes

  • Regenerated OpenAI TypeScript bindings for new programmatic tool variants.
  • Preserved caller metadata when importing/exporting Responses function and custom tool calls/results.
  • Preserved pending Responses tool-call status such as status: "in_progress".
  • Included caller in assistant/tool dedup hashes so programmatic traces with different callers are not collapsed.
  • Preserved allowed_callers and output_schema for Responses additional_tools / tool discovery serialization.
  • Updated Responses follow-up capture generation to replay program items and carry caller onto generated tool
    outputs.
  • Removed the hand-authored continuation fixture and made responsesProgrammaticToolCallingToolsParam the canonical
    generated continuation test.
  • Made Anthropic conversion reject unsupported OpenAI programmatic caller restrictions instead of silently
    broadening them.
  • Narrowed expected differences/errors to non-Responses targets where programmatic Responses semantics cannot be
    represented.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@knjiang Ken Jiang (knjiang) marked this pull request as ready for review July 10, 2026 18:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/lingua/src/providers/openai/params.rs
Comment thread crates/lingua/src/providers/openai/convert.rs Outdated
Comment thread crates/coverage-report/src/runner.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/lingua/src/providers/openai/convert.rs Outdated
Comment thread crates/lingua/src/providers/openai/convert.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread payloads/transforms/transform_errors.json Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/lingua/src/providers/openai/generated.rs
Comment thread crates/lingua/src/providers/openai/convert.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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>>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +569 to +570
"target": "*",
"skip": true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/lingua/src/providers/openai/tool_discovery.rs
Comment thread crates/lingua/src/universal/message.rs
@knjiang

Copy link
Copy Markdown
Contributor Author

Codex (@codex) review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +143 to +158
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());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +214 to +218
"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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +20 to +22
"caller": {
"type": "program",
"caller_id": "call_4DEyilA0eOIRmtXTIZkd1XaU"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines 211 to +214
followUpInput.push({
type: "function_call_output",
call_id: message.call_id,
output: "71 degrees",
output,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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": "*",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1367 to +1370
provider_options: provider_options_from_openai_tool_call(
input.namespace,
None,
)?,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread crates/lingua/src/universal/response.rs Outdated
Comment on lines +596 to +598
if let Some(cache_write) = self.prompt_cache_creation_tokens {
input_details
.insert("cache_write_tokens".into(), serde_json::json!(cache_write));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/coverage-report/src/streaming_expected_differences.json Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +530 to +531
#[serde(rename = "_output_item_status")]
output_item_status: Option<openai::FunctionCallItemStatus>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread crates/lingua/build.rs
Comment on lines +44 to +46
"responsesGpt56PromptCacheOptionsParam",
"responsesGpt56ReasoningMaxProContextParam",
"responsesProgrammaticToolCallingToolsParam",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@knjiang Ken Jiang (knjiang) merged commit 49c63f3 into main Jul 12, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants