Package com.github.copilot.sdk.json
Class ResumeSessionConfig
java.lang.Object
com.github.copilot.sdk.json.ResumeSessionConfig
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the custom agent configurations.Gets the disabled skills.getHooks()Gets the hook handlers configuration.Gets the MCP server configurations.Gets the permission request handler.Gets the user input request handler.Gets the custom API provider configuration.Gets the reasoning effort level.Gets the skill directories.getTools()Gets the custom tools for this session.Gets the working directory for the session.booleanReturns whether the resume event is disabled.booleanReturns whether streaming is enabled.setCustomAgents(List<CustomAgentConfig> customAgents) Sets custom agent configurations.setDisabledSkills(List<String> disabledSkills) Sets skills that should be disabled for this session.setDisableResume(boolean disableResume) Sets whether to disable the session.resume event.setHooks(SessionHooks hooks) Sets hook handlers for session lifecycle events.setMcpServers(Map<String, Object> mcpServers) Sets MCP (Model Context Protocol) server configurations.setOnPermissionRequest(PermissionHandler onPermissionRequest) Sets a handler for permission requests from the assistant.setOnUserInputRequest(UserInputHandler onUserInputRequest) Sets a handler for user input requests from the agent.setProvider(ProviderConfig provider) Sets a custom API provider for BYOK scenarios.setReasoningEffort(String reasoningEffort) Sets the reasoning effort level for models that support it.setSkillDirectories(List<String> skillDirectories) Sets directories containing skill definitions.setStreaming(boolean streaming) Sets whether to enable streaming of response chunks.setTools(List<ToolDefinition> tools) Sets custom tools that the assistant can invoke during the session.setWorkingDirectory(String workingDirectory) Sets the working directory for the session.
-
Constructor Details
-
ResumeSessionConfig
public ResumeSessionConfig()
-
-
Method Details
-
getTools
Gets the custom tools for this session.- Returns:
- the list of tool definitions
-
setTools
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:
-
getProvider
Gets the custom API provider configuration.- Returns:
- the provider configuration
-
setProvider
Sets a custom API provider for BYOK scenarios.- Parameters:
provider- the provider configuration- Returns:
- this config for method chaining
- See Also:
-
getReasoningEffort
Gets the reasoning effort level.- Returns:
- the reasoning effort level ("low", "medium", "high", or "xhigh")
-
setReasoningEffort
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
Gets the permission request handler.- Returns:
- the permission handler
-
setOnPermissionRequest
Sets a handler for permission requests from the assistant.- Parameters:
onPermissionRequest- the permission handler- Returns:
- this config for method chaining
- See Also:
-
getOnUserInputRequest
Gets the user input request handler.- Returns:
- the user input handler
-
setOnUserInputRequest
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
Gets the hook handlers configuration.- Returns:
- the session hooks
-
setHooks
Sets hook handlers for session lifecycle events.- Parameters:
hooks- the hooks configuration- Returns:
- this config for method chaining
- See Also:
-
getWorkingDirectory
Gets the working directory for the session.- Returns:
- the working directory path
-
setWorkingDirectory
Sets the working directory for the session.- Parameters:
workingDirectory- the working directory path- Returns:
- this config for method chaining
-
isDisableResume
public boolean isDisableResume()Returns whether the resume event is disabled.- Returns:
trueif the session.resume event is suppressed
-
setDisableResume
Sets whether to disable the session.resume event.When true, the session.resume event is not emitted.
- Parameters:
disableResume-trueto suppress the resume event- Returns:
- this config for method chaining
-
isStreaming
public boolean isStreaming()Returns whether streaming is enabled.- Returns:
trueif streaming is enabled
-
setStreaming
Sets whether to enable streaming of response chunks.- Parameters:
streaming-trueto enable streaming- Returns:
- this config for method chaining
-
getMcpServers
Gets the MCP server configurations.- Returns:
- the MCP servers map
-
setMcpServers
Sets MCP (Model Context Protocol) server configurations.- Parameters:
mcpServers- the MCP servers configuration map- Returns:
- this config for method chaining
-
getCustomAgents
Gets the custom agent configurations.- Returns:
- the list of custom agent configurations
-
setCustomAgents
Sets custom agent configurations.- Parameters:
customAgents- the list of custom agent configurations- Returns:
- this config for method chaining
- See Also:
-
getSkillDirectories
Gets the skill directories.- Returns:
- the list of skill directory paths
-
setSkillDirectories
Sets directories containing skill definitions.- Parameters:
skillDirectories- the list of skill directory paths- Returns:
- this config for method chaining
-
getDisabledSkills
Gets the disabled skills.- Returns:
- the list of disabled skill names
-
setDisabledSkills
Sets skills that should be disabled for this session.- Parameters:
disabledSkills- the list of skill names to disable- Returns:
- this config for method chaining
-