mirror of
https://github.com/openai/codex.git
synced 2026-11-01 19:33:35 +00:00
Add audio file references with explicit runtime rejection (#58430)
## What changed - Allow audio inputs to carry uploaded file references via `fileId` in the app-server API and `file_id` in model content, preserving existing inline audio shapes and Python class names. - Preserve mixed inline and file-backed audio ordering through history reconstruction and migration, and budget file-backed audio conservatively when duration is unknown. - Keep uploaded audio disabled at runtime: reject it before inference or raw history injection, preserve accompanying text, and prevent rejected attachments from reaching follow-up or resumed requests. ## Testing Add coverage for wire-format round trips, SDK compatibility, mixed audio history ordering, and rejection during turn start, steering, task completion, and raw injection. GitOrigin-RevId: 70895c47a2494c0c9936348ad1250eb1b7b892a6
This commit is contained in:
@@ -605,7 +605,7 @@ def generate_v2_all(schema_dir: Path, *, format_output: bool = True) -> None:
|
||||
+ (["--formatters", "ruff-format"] if format_output else []),
|
||||
cwd=sdk_root() if format_output else Path(td),
|
||||
)
|
||||
_preserve_inline_image_class_names(out_path)
|
||||
_preserve_inline_media_class_names(out_path)
|
||||
_add_legacy_image_generation_thread_item_alias(out_path)
|
||||
_preserve_open_enum(out_path, "CodexErrorInfoValue", allow_empty=True)
|
||||
_preserve_reasoning_effort_enum(out_path)
|
||||
@@ -614,13 +614,15 @@ def generate_v2_all(schema_dir: Path, *, format_output: bool = True) -> None:
|
||||
_normalize_generated_timestamps(out_path)
|
||||
|
||||
|
||||
def _preserve_inline_image_class_names(out_path: Path) -> None:
|
||||
"""Keep the public class names used before ImageReference was introduced."""
|
||||
def _preserve_inline_media_class_names(out_path: Path) -> None:
|
||||
"""Keep the public inline class names used before file references were introduced."""
|
||||
source = out_path.read_text()
|
||||
stable_names = {
|
||||
"UrlUserInput": "ImageUserInput",
|
||||
"ImageUrlContentItem": "InputImageContentItem",
|
||||
"ImageUrlFunctionCallOutputContentItem": "InputImageFunctionCallOutputContentItem",
|
||||
"UrlUserInput1": "AudioUserInput",
|
||||
"AudioUrlContentItem": "InputAudioContentItem",
|
||||
}
|
||||
for generated_name, stable_name in stable_names.items():
|
||||
if source.count(f"class {generated_name}(") != 1:
|
||||
|
||||
Reference in New Issue
Block a user