Skip to main content
The orq:apply_patch tool lets a model propose file changes. Orq.ai validates the operation, path, and diff. The application receives each valid patch as a pending function call and decides whether to apply it. This is a human-in-the-loop tool. Orq.ai never writes to the application filesystem.

Quick start

The examples use the client configuration from the Server tools overview. The Responses API is used here because it exposes the pending call and follow-up output directly.

Patch operations

The model supplies three arguments in the pending call: Validation depends on the operation:
  • create_file: every non-empty diff line must start with +.
  • update_file: lines may start with a space, +, -, or @@, and the diff must contain an addition or deletion.
  • delete_file: the diff must be empty.
Malformed patches are returned to the model for correction inside the tool loop. Only a valid patch reaches the application.

Apply the patch

Read the pending apply_patch function call, review and apply it in the application, then submit a standard function-call output. See Tool calling and function execution for the response loop. Apply patch has no additional charge beyond model tokens. Calls are not included in usage.server_tool_use.