Class ResumeSessionConfig

java.lang.Object
com.github.copilot.sdk.json.ResumeSessionConfig

public class ResumeSessionConfig extends Object
Configuration for resuming an existing Copilot session.

This class provides options for configuring a resumed session, including tool registration, provider configuration, and streaming. All setter methods return this for method chaining.

Example Usage


 var config = new ResumeSessionConfig().setStreaming(true).setTools(List.of(myTool));

 var session = client.resumeSession(sessionId, config).get();
 
Since:
1.0.0
See Also:
  • Constructor Details

    • ResumeSessionConfig

      public ResumeSessionConfig()
  • Method Details

    • getModel

      public String getModel()
      Gets the AI model to use.
      Returns:
      the model name
    • setModel

      public ResumeSessionConfig setModel(String model)
      Sets the AI model to use for the resumed session.

      Can change the model when resuming an existing session.

      Parameters:
      model - the model name
      Returns:
      this config for method chaining
    • getTools

      public List<ToolDefinition> getTools()
      Gets the custom tools for this session.
      Returns:
      the list of tool definitions
    • setTools

      public ResumeSessionConfig setTools(List<ToolDefinition> tools)
      Sets custom tools that the assistant can invoke during the session.
      Parameters:
      tools - the list of tool definitions
      Returns:
      this config for method chaining
      See Also:
    • getSystemMessage

      public SystemMessageConfig getSystemMessage()
      Gets the system message configuration.
      Returns:
      the system message config
    • setSystemMessage

      public ResumeSessionConfig setSystemMessage(SystemMessageConfig systemMessage)
      Sets the system message configuration.

      The system message controls the behavior and personality of the assistant.

      Parameters:
      systemMessage - the system message configuration
      Returns:
      this config for method chaining
      See Also:
    • getAvailableTools

      public List<String> getAvailableTools()
      Gets the list of allowed tool names.
      Returns:
      the list of available tool names
    • setAvailableTools

      public ResumeSessionConfig setAvailableTools(List<String> availableTools)
      Sets the list of tool names that are allowed in this session.

      When specified, only tools in this list will be available to the assistant. Takes precedence over excluded tools.

      Parameters:
      availableTools - the list of allowed tool names
      Returns:
      this config for method chaining
    • getExcludedTools

      public List<String> getExcludedTools()
      Gets the list of excluded tool names.
      Returns:
      the list of excluded tool names
    • setExcludedTools

      public ResumeSessionConfig setExcludedTools(List<String> excludedTools)
      Sets the list of tool names to exclude from this session.

      Tools in this list will not be available to the assistant. Ignored if available tools is specified.

      Parameters:
      excludedTools - the list of tool names to exclude
      Returns:
      this config for method chaining
    • getProvider

      public ProviderConfig getProvider()
      Gets the custom API provider configuration.
      Returns:
      the provider configuration
    • setProvider

      public ResumeSessionConfig setProvider(ProviderConfig provider)
      Sets a custom API provider for BYOK scenarios.
      Parameters:
      provider - the provider configuration
      Returns:
      this config for method chaining
      See Also:
    • getReasoningEffort

      public String getReasoningEffort()
      Gets the reasoning effort level.
      Returns:
      the reasoning effort level ("low", "medium", "high", or "xhigh")
    • setReasoningEffort

      public ResumeSessionConfig setReasoningEffort(String reasoningEffort)
      Sets the reasoning effort level for models that support it.

      Valid values: "low", "medium", "high", "xhigh".

      Parameters:
      reasoningEffort - the reasoning effort level
      Returns:
      this config for method chaining
    • getOnPermissionRequest

      public PermissionHandler getOnPermissionRequest()
      Gets the permission request handler.
      Returns:
      the permission handler
    • setOnPermissionRequest

      public ResumeSessionConfig setOnPermissionRequest(PermissionHandler onPermissionRequest)
      Sets a handler for permission requests from the assistant.
      Parameters:
      onPermissionRequest - the permission handler
      Returns:
      this config for method chaining
      See Also:
    • getOnUserInputRequest

      public UserInputHandler getOnUserInputRequest()
      Gets the user input request handler.
      Returns:
      the user input handler
    • setOnUserInputRequest

      public ResumeSessionConfig setOnUserInputRequest(UserInputHandler onUserInputRequest)
      Sets a handler for user input requests from the agent.
      Parameters:
      onUserInputRequest - the user input handler
      Returns:
      this config for method chaining
      See Also:
    • getHooks

      public SessionHooks getHooks()
      Gets the hook handlers configuration.
      Returns:
      the session hooks
    • setHooks

      public ResumeSessionConfig setHooks(SessionHooks hooks)
      Sets hook handlers for session lifecycle events.
      Parameters:
      hooks - the hooks configuration
      Returns:
      this config for method chaining
      See Also:
    • getWorkingDirectory

      public String getWorkingDirectory()
      Gets the working directory for the session.
      Returns:
      the working directory path
    • setWorkingDirectory

      public ResumeSessionConfig setWorkingDirectory(String workingDirectory)
      Sets the working directory for the session.
      Parameters:
      workingDirectory - the working directory path
      Returns:
      this config for method chaining
    • getConfigDir

      public String getConfigDir()
      Gets the configuration directory path.
      Returns:
      the configuration directory path
    • setConfigDir

      public ResumeSessionConfig setConfigDir(String configDir)
      Sets the configuration directory path.

      Override the default configuration directory location.

      Parameters:
      configDir - the configuration directory path
      Returns:
      this config for method chaining
    • isDisableResume

      public boolean isDisableResume()
      Returns whether the resume event is disabled.
      Returns:
      true if the session.resume event is suppressed
    • setDisableResume

      public ResumeSessionConfig setDisableResume(boolean disableResume)
      Sets whether to disable the session.resume event.

      When true, the session.resume event is not emitted.

      Parameters:
      disableResume - true to suppress the resume event
      Returns:
      this config for method chaining
    • isStreaming

      public boolean isStreaming()
      Returns whether streaming is enabled.
      Returns:
      true if streaming is enabled
    • setStreaming

      public ResumeSessionConfig setStreaming(boolean streaming)
      Sets whether to enable streaming of response chunks.
      Parameters:
      streaming - true to enable streaming
      Returns:
      this config for method chaining
    • getMcpServers

      public Map<String,Object> getMcpServers()
      Gets the MCP server configurations.
      Returns:
      the MCP servers map
    • setMcpServers

      public ResumeSessionConfig setMcpServers(Map<String,Object> mcpServers)
      Sets MCP (Model Context Protocol) server configurations.
      Parameters:
      mcpServers - the MCP servers configuration map
      Returns:
      this config for method chaining
    • getCustomAgents

      public List<CustomAgentConfig> getCustomAgents()
      Gets the custom agent configurations.
      Returns:
      the list of custom agent configurations
    • setCustomAgents

      public ResumeSessionConfig setCustomAgents(List<CustomAgentConfig> customAgents)
      Sets custom agent configurations.
      Parameters:
      customAgents - the list of custom agent configurations
      Returns:
      this config for method chaining
      See Also:
    • getSkillDirectories

      public List<String> getSkillDirectories()
      Gets the skill directories.
      Returns:
      the list of skill directory paths
    • setSkillDirectories

      public ResumeSessionConfig setSkillDirectories(List<String> skillDirectories)
      Sets directories containing skill definitions.
      Parameters:
      skillDirectories - the list of skill directory paths
      Returns:
      this config for method chaining
    • getDisabledSkills

      public List<String> getDisabledSkills()
      Gets the disabled skills.
      Returns:
      the list of disabled skill names
    • setDisabledSkills

      public ResumeSessionConfig setDisabledSkills(List<String> disabledSkills)
      Sets skills that should be disabled for this session.
      Parameters:
      disabledSkills - the list of skill names to disable
      Returns:
      this config for method chaining
    • getInfiniteSessions

      public InfiniteSessionConfig getInfiniteSessions()
      Gets the infinite session configuration.
      Returns:
      the infinite session config
    • setInfiniteSessions

      public ResumeSessionConfig setInfiniteSessions(InfiniteSessionConfig infiniteSessions)
      Sets the infinite session configuration for persistent workspaces and automatic compaction.
      Parameters:
      infiniteSessions - the infinite session configuration
      Returns:
      this config for method chaining
      See Also: