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

    • getAutoTier

      public AutoTier getAutoTier()
      Gets the routing tier for the auto model (Auto mode V2).
      Returns:
      the explicit tier, or null to leave tier selection to the runtime
    • setAutoTier

      public CapiSessionOptions setAutoTier(AutoTier autoTier)
      Sets the routing tier, meaningful only with model auto (Auto mode V2). Requires a runtime version that supports capi.autoTier.

      When omitted, the runtime chooses its default on create and preserves the persisted or current tier on resume. An explicit tier overrides the persisted tier on cold resume. On resident resume, a different tier requests a safe switch that the runtime applies after the resume succeeds; it cannot change a turn that is already in flight.

      Parameters:
      autoTier - the routing tier, or null to omit it from the request
      Returns:
      this config for method chaining
    • 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