Version: v0.19.2
When context_management compaction is enabled on a Responses API request, the API returns an output item of type: "compaction". OutputObjects::parse() (src/Actions/Responses/OutputObjects.php) uses a match ($item['type']) with no arm for compaction and no default arm, so the entire response fails to parse with:
UnhandledMatchError: Unhandled match case 'compaction'
This is fatal — the whole response is unparseable, so even the message output in the same response is lost.
Reproduce
$client->responses()->create([
'model' => 'gpt-5.4',
'input' => $input,
'conversation' => $conversationId,
'context_management' => [
['type' => 'compaction', 'compact_threshold' => 50000],
],
]);
// throws once the conversation crosses the threshold and the API compacts
Request
Add handling for the compaction output item (e.g. an OutputCompaction response class + a 'compaction' => OutputCompaction::from($item) arm). At minimum, add a non-throwing default arm so an unrecognized output type doesn't make the entire response unparseable. Newer Responses API output types (context_management/compaction) are otherwise unusable with the client.
Environment
PHP 8.x, OpenAI Responses API, gpt-5.4.
Version: v0.19.2
When
context_managementcompaction is enabled on a Responses API request, the API returns an output item oftype: "compaction".OutputObjects::parse()(src/Actions/Responses/OutputObjects.php) uses amatch ($item['type'])with no arm forcompactionand nodefaultarm, so the entire response fails to parse with:This is fatal — the whole response is unparseable, so even the
messageoutput in the same response is lost.Reproduce
Request
Add handling for the
compactionoutput item (e.g. anOutputCompactionresponse class + a'compaction' => OutputCompaction::from($item)arm). At minimum, add a non-throwingdefaultarm so an unrecognized output type doesn't make the entire response unparseable. Newer Responses API output types (context_management/compaction) are otherwise unusable with the client.Environment
PHP 8.x, OpenAI Responses API,
gpt-5.4.