Please read this first
- Have you read the docs? yes
- Have you searched for related issues? yes
Describe the bug
After OpenAIResponsesCompactionSession runs compaction it converts prompt images to Responses API format which is not supported by Agents SDK.
That means, it changes
{type: 'input_image', image: 'data:image/jpeg;base64,xxx'}
to:
{type: 'input_image', detail:'auto', file_id:null, image_url: 'data:image/jpeg;base64,xxx'}
Debug information
- Agents SDK version: (e.g.
v0.8.3)
- Runtime environment (e.g.
Node.js 24.11.1)
Repro steps
const session = new OpenAIResponsesCompactionSession({
client: openai,
model: 'gpt-5.4',
underlyingSession: new MemorySession(),
shouldTriggerCompaction: ({ compactionCandidateItems }) => {
return compactionCandidateItems.length >= 2;
}
});
const content = [
{type: 'input_text', text: 'analyse these images'},
{type: 'input_image', image: `data:image/jpeg;base64,${Buffer.from(datafile).toString('base64')}`},
];
const history = [
{role: 'user', content},
{role: 'assistant', content: [{type: 'output_text', text: 'how can I help?'}]},
];
const prompt = [{role: 'user', content: [{type: 'input_text', text: 'analyse these images'}]}];
await session.addItems(history);
await session.runCompaction();
const agent = new Agent({name: 'agent', model: 'gpt-5.4', modelSettings: {store: false}});
const res = await run(agent, prompt, {session});
Error
Error: 400 Missing mutually exclusive parameters: 'input[0].content[1]'. Ensure you are providing exactly one of: 'file_id' or 'image_url'.
Expected behavior
Agents SDK should either support "image_url" or OpenAIResponsesCompactionSession should convert back from "image_url" to "image".
Please read this first
Describe the bug
After OpenAIResponsesCompactionSession runs compaction it converts prompt images to Responses API format which is not supported by Agents SDK.
That means, it changes
{type: 'input_image', image: 'data:image/jpeg;base64,xxx'}to:
{type: 'input_image', detail:'auto', file_id:null, image_url: 'data:image/jpeg;base64,xxx'}Debug information
v0.8.3)Node.js 24.11.1)Repro steps
Error
Error: 400 Missing mutually exclusive parameters: 'input[0].content[1]'. Ensure you are providing exactly one of: 'file_id' or 'image_url'.
Expected behavior
Agents SDK should either support "image_url" or OpenAIResponsesCompactionSession should convert back from "image_url" to "image".