[BUG] OpenAI Responses requests crash on audio inputs advertised by provider constraints
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
Línea de trabajo
Read lib/crewai-files/src/crewai_files/processing/constraints.py around OPENAI_RESPONSES_CONSTRAINTS and lib/crewai-files/src/crewai_files/formatting/openai.py around OpenAIResponsesFormatter.format_block. Run the named tests in lib/crewai-files/tests/test_openai_responses_files.py to reproduce the failure and confirm the expected behavior. Done means Responses no longer advertises audio support and formatting an audio input returns an empty list; linked pull request #9175 is already open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
OPENAI_RESPONSES_CONSTRAINTS advertises audio support, so an audio file attached to a task is auto-injected into the OpenAI Responses request instead of being handled by the file tools. The Responses formatter, however, only knows how to emit image and PDF blocks, so formatting the file raises:
TypeError: Unsupported content type for Responses API: audio/mpeg
lib/crewai-files/src/crewai_files/processing/constraints.py:241:
OPENAI_RESPONSES_CONSTRAINTS = ProviderConstraints(
name="openai_responses",
...
audio=AudioConstraints(
max_size_bytes=26_214_400, # 25 MB - whisper limit
max_duration_seconds=1500, # 25 minutes, arbitrary-ish, this is from the transcriptions limit
),
...
)
The comment points at the transcription endpoint, not the Responses file-input API, and OpenAIResponsesFormatter.format_block (lib/crewai-files/src/crewai_files/formatting/openai.py:38) only handles input_image and input_file; every other content type falls through to TypeError at line 97.
get_supported_content_types("openai", api="responses") therefore returns ['image/', 'application/pdf', 'audio/'], which drives both the task auto-injection decision (lib/crewai/src/crewai/task.py:1041, lib/crewai/src/crewai/crew.py:1718) and the formatter dispatch. An audio attachment that should have gone to the tool fallback is instead sent down a path that cannot format it.
Reproduction
from unittest.mock import patch
from crewai_files import AudioFile, format_multimodal_content
from crewai_files.core.sources import FileBytes
with patch(
"crewai_files.core.sources.detect_content_type", return_value="audio/mpeg"
):
audio = AudioFile(
source=FileBytes(data=b"ID3\x04\x00\x00\x00\x00\x00\x00payload", filename="clip.mp3")
)
format_multimodal_content({"clip": audio}, "openai", api="responses")
# TypeError: Unsupported content type for Responses API: audio/mpeg
Expected behaviour
Audio is not a supported Responses file input in this code path, so it should not be advertised as one. The audio file should be filtered out of the multimodal blocks (and handled by the file tool fallback) exactly like other unsupported types, instead of aborting the whole request.
Suggested fix
Remove the audio=AudioConstraints(...) entry from OPENAI_RESPONSES_CONSTRAINTS (the typo-shaped limits came from the transcription endpoint). The provider then advertises only the types its formatter implements; no formatter change is needed.
Tests
lib/crewai-files/tests/test_openai_responses_files.py adds:
test_responses_does_not_advertise_audio_supportasserts"audio/"is absent fromget_supported_content_types("openai", api="responses").test_audio_input_is_skipped_instead_of_raisingformats an MP3 and asserts the result is[]rather than an exception.
Both pass with the fix. On main they fail with the assertion above and with TypeError: Unsupported content type for Responses API: audio/mpeg.
Prepared with an AI coding agent. Please apply the llm-generated label; this account cannot set repository labels.
- Lenguaje dominante
- Python
- Estrellas
- 60.6k
- Forks
- 9.1k
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 214
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de crewAIInc/crewAI
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
Feature request: GoldenDirectiveTool (harmonic relationship score, full vs cropped reporting)Abiertofeature-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
crewAIInc/crewAI#9200 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
crewAIInc/crewAI#9132 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] Scrape tools reject the documented cookies mapping and drop cookies when the URL is passed at runtimePosiblemente ocupada @Luckyou-d la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionPosiblemente ocupada @gokay-ai la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
crewAIInc/crewAI#8761 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de crewAIInc/crewAI
Issues similares
-
`destroy` sans terminal répond « Aborted. » au lieu de réclamer `--yes` comme `clean` et `reset`Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
stephrobert/dsoxlab#354 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
jasonacox/pypowerwall#472 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: DoubleMLRDDData accepts a score_col that is no data column (as in its docstring example); the running variable then becomes a covariate and RDFlex failsPosiblemente ocupada @vrjdev la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DoubleML/doubleml-for-py#455 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Python mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes)Posiblemente ocupada @rohit-jsfreaky la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Graphify-Labs/graphify#5110 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
assafelovic/gpt-researcher#2277 ·
Los mantenedores suelen responder en 10 días