Handle computer_call outputs that return actions[] instead of action#759
Draft
Handle computer_call outputs that return actions[] instead of action#759
computer_call outputs that return actions[] instead of action#759Conversation
Agent-Logs-Url: https://github.com/openai-php/client/sessions/18ddc838-e520-4048-879d-4a1218823f7a Co-authored-by: iBotPeaches <611784+iBotPeaches@users.noreply.github.com>
Agent-Logs-Url: https://github.com/openai-php/client/sessions/18ddc838-e520-4048-879d-4a1218823f7a Co-authored-by: iBotPeaches <611784+iBotPeaches@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix undefined array key 'action' in OutputComputerToolCall
Handle Apr 15, 2026
computer_call outputs that return actions[] instead of action
|
I don't think this will work as it can return multiple actions and this code only accounts for a single action $actionAttributes = $attributes['actions'][0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OutputComputerToolCall::from()assumed a singleactionobject, but realcomputer_callpayloads may returnactions(array), causing undefined key errors. This PR updates parsing to support both shapes and hardens behavior for missing/invalid action payloads.Parser compatibility update
action(existing behavior), oractions[0](new fallback for observed API payloads)toArray()still emitsaction).Defensive handling for optional fields
pending_safety_checksas an empty list.InvalidArgumentExceptionwhen no valid action payload is present.Focused test coverage additions
actionsonly.actionsare present.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/y3H2pq /usr/bin/composer install(http block)https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/y3H2pq /usr/bin/composer install(http block)https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/y3H2pq /usr/bin/composer install(http block)https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/y3H2pq /usr/bin/composer install(http block)https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/y3H2pq /usr/bin/composer install(http block)https://api.github.com/repos/phpstan/phpstan/zipball/37982d6fc7cbb746dda7773530cda557cdf119e1/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/EwI9L5 /usr/bin/composer install --prefer-source --no-interaction(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/y3H2pq /usr/bin/composer install(http block)https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/y3H2pq /usr/bin/composer install(http block)If you need me to access, download, or install something from one of these locations, you can either: