Class CapiSessionOptions

java.lang.Object
com.github.copilot.rpc.CapiSessionOptions

public class CapiSessionOptions extends Object
Provider-scoped session options for the Copilot API (CAPI) provider.

WebSocket transport is the default for the CAPI Responses API whenever the model advertises the ws:/responses endpoint. Setting setEnableWebSocketResponses(Boolean) to false forces the HTTP Responses transport instead, which is useful for users behind proxies where WebSockets fail. This is equivalent to setting the COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES environment variable.

These options are scoped under the capi namespace because a single session can host multiple providers (for example, CAPI and BYOK), so transport choice is provider-level rather than top-level session state. All setter methods return this for method chaining.

Since:
1.5.0
See Also:
  • Constructor Details

    • CapiSessionOptions

      public CapiSessionOptions()
  • Method Details

    • getEnableWebSocketResponses

      public Boolean getEnableWebSocketResponses()
      Gets whether CAPI Responses API WebSocket transport is enabled.
      Returns:
      false to force the HTTP Responses transport, true to explicitly use WebSocket transport, or null to use the default behavior
    • setEnableWebSocketResponses

      public CapiSessionOptions setEnableWebSocketResponses(Boolean enableWebSocketResponses)
      Sets whether to use CAPI Responses API WebSocket transport.

      WebSocket transport is the default for the CAPI Responses API whenever the model advertises the ws:/responses endpoint. Set this to false to force the HTTP Responses transport instead, which is useful for users behind proxies where WebSockets fail. This is equivalent to setting the COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES environment variable.

      Parameters:
      enableWebSocketResponses - false to force the HTTP Responses transport
      Returns:
      this config for method chaining