Skip to main content

RPC (Remote Procedure Call)

In the official SDK, recent new features are supported through auto-generated code from api.schema.json. In the Laravel version, the same features are implemented by following generated SDKs for other languages.

ServerRpc

An RPC class bound to the Client.
Functions that were already included in the SDK are also added again in the auto-generated version.

Method list

SessionRpc

An RPC class bound to a Session. This also enables features that were not available in older SDK versions, such as plan mode.

Method list

SessionFS callback types

Callback types (Request/Result) are defined for session-scoped filesystem operations. These are request/response types used when Copilot CLI calls back to the client. These type classes are in src/Types/Rpc/.

Using arrays for arguments

Dedicated classes are used for both arguments and return values, but you can also pass arguments as arrays.

Testing

Copilot::fake() mocks are not available, so mock with Copilot::expects('client') or Copilot::expects('start').
For the latest updates, see the GitHub repository.
Last modified on May 31, 2026