OpenAIAdapter converts OpenAI computer actions to native desktop actions. It does not call the OpenAI API. Your application owns the model client, conversation state, policy, and limits.
Install the provider extra
OPENAI_API_KEY in the application environment. Do not add the key to the Sandbox image.
Create the desktop
Use the Responses API computer tool
Use the GAcomputer tool for new code:
computer_call. Stop when the response has no computer calls.
Preflight before you act
Normalize and validate every computer call in the response before you change the desktop. Count actions after adapter expansion. This count includes multi-key keypresses and two-axis scrolls. Set limits for these values:
If the last allowed turn requests another action, stop before you execute it.
Execute one batch for each call
Create the adapter once. Keep it for the full loop.click, double_click, scroll, type, keypress, drag, move, wait, and screenshot.
Use the final native screenshot when the last action is screenshot. Otherwise, use batch.screenshot. Do not capture a second screenshot for the same call.
Build one result for each computer call. Preserve the call ID and response order.
input. Pass response.id as previous_response_id.
Apply coordinates and policy
PassCoordinateSpace to the adapter when the model image size differs from the desktop size. The adapter maps model coordinates to desktop coordinates before it executes an action.
Use before_action to inspect each normalized action. A decision of deny, ask_user, or handoff stops the action before it reaches the daemon.

