Skip to content

fix: exclude null acknowledged_safety_checks from GA ComputerCallOutput#2742

Draft
guoyangzhen wants to merge 1 commit intoopenai:mainfrom
guoyangzhen:fix/computer-tool-null-safety-checks
Draft

fix: exclude null acknowledged_safety_checks from GA ComputerCallOutput#2742
guoyangzhen wants to merge 1 commit intoopenai:mainfrom
guoyangzhen:fix/computer-tool-null-safety-checks

Conversation

@guoyangzhen
Copy link

Problem

When using the GA computer tool with gpt-5.4, the SDK serializes acknowledged_safety_checks: null in ComputerCallOutput when there are no pending safety checks. The GA computer endpoint rejects this:

Error code: 400 - acknowledged_safety_checks is not supported for the "computer" tool.

Root Cause

In ComputerAction.execute(), acknowledged_safety_checks defaults to None. For GA requests without pending safety checks, it stays None and is passed directly to ComputerCallOutput. Pydantic serializes None as "acknowledged_safety_checks": null, which the GA endpoint rejects.

Fix

Only include acknowledged_safety_checks in the ComputerCallOutput when it is not None, using a conditional spread:

**(
    {"acknowledged_safety_checks": acknowledged_safety_checks}
    if acknowledged_safety_checks is not None
    else {}
),

This omits the field entirely when there are no safety checks to acknowledge, avoiding the 400 error.

Testing

  • Verified that when acknowledged_safety_checks is None, the field is excluded from the dict
  • Verified that when acknowledged_safety_checks has values, it is included as before

Fixes #2741

@github-actions github-actions bot added bug Something isn't working feature:core labels Mar 20, 2026
@seratch seratch added this to the 0.12.x milestone Mar 20, 2026
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guoyangzhen I've verified your fix works for the runtime behavior correction. The type checker is claiming some errors, so can you quickly fix it? You can run make typecheck to verify if it's fixed. With that, this is good to go.

Run make typecheck
Running make mypy and make pyright in parallel...
make[1]: Entering directory '/home/runner/work/openai-agents-python/openai-agents-python'
uv run pyright --project pyrightconfig.json
make[1]: Entering directory '/home/runner/work/openai-agents-python/openai-agents-python'
uv run mypy . --exclude site
0 errors, 0 warnings, 0 informations
make[1]: Leaving directory '/home/runner/work/openai-agents-python/openai-agents-python'
src/agents/run_internal/tool_actions.py:173: error: Missing keys ("call_id", "output", "type") for TypedDict "ComputerCallOutput"  [typeddict-item]
src/agents/run_internal/tool_actions.py:175: error: Missing keys ("call_id", "output", "type") for TypedDict "ComputerCallOutput"  [typeddict-item]
Found 2 errors in 1 file (checked 500 source files)
make[1]: *** [Makefile:20: mypy] Error 1
make[1]: Leaving directory '/home/runner/work/openai-agents-python/openai-agents-python'
make: *** [Makefile:28: typecheck] Error 2
Error: Process completed with exit code 2.

@seratch seratch modified the milestones: 0.12.x, 0.13.x Mar 21, 2026
@seratch
Copy link
Member

seratch commented Mar 21, 2026

Thanks for sending this patch. This is definitely a breaking change on the server-side, so I've escalated the issue to the relevant team. The server-side fix should come soon. So, let's hold off bypassing the type issue just for the workaround for now.

@seratch seratch removed this from the 0.13.x milestone Mar 21, 2026
@seratch seratch marked this pull request as draft March 21, 2026 10:52
@guoyangzhen
Copy link
Author

@seratch Thanks for the review. I understand — if the server-side fix is coming, it makes sense to wait rather than work around the type checker. Let me know when it's appropriate to revisit; happy to update the PR once the server-side changes land.

@guoyangzhen
Copy link
Author

Thanks for the update! I'll keep this PR as a draft until the server-side fix lands. If the server-side fix resolves the issue completely, I'll close this PR. Let me know if you'd like me to adjust the approach in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GA computer tool rejects acknowledged_safety_checks: null from ComputerCallOutput

2 participants