Package com.github.copilot.sdk.json
Class InfiniteSessionConfig
java.lang.Object
com.github.copilot.sdk.json.InfiniteSessionConfig
Configuration for infinite sessions with automatic context compaction and
workspace persistence.
When enabled, sessions automatically manage context window limits through background compaction and persist state to a workspace directory.
Example Usage
var infiniteConfig = new InfiniteSessionConfig().setEnabled(true).setBackgroundCompactionThreshold(0.80)
.setBufferExhaustionThreshold(0.95);
var config = new SessionConfig().setInfiniteSessions(infiniteConfig);
var session = client.createSession(config).get();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the background compaction threshold.Gets the buffer exhaustion threshold.Gets whether infinite sessions are enabled.setBackgroundCompactionThreshold(Double backgroundCompactionThreshold) Sets the context utilization threshold at which background compaction starts.setBufferExhaustionThreshold(Double bufferExhaustionThreshold) Sets the context utilization threshold at which the session blocks until compaction completes.setEnabled(Boolean enabled) Sets whether infinite sessions are enabled.
-
Constructor Details
-
InfiniteSessionConfig
public InfiniteSessionConfig()
-
-
Method Details
-
getEnabled
Gets whether infinite sessions are enabled.- Returns:
trueif enabled,nullto use default (true)
-
setEnabled
Sets whether infinite sessions are enabled.Default: true
- Parameters:
enabled-trueto enable infinite sessions- Returns:
- this config instance for method chaining
-
getBackgroundCompactionThreshold
Gets the background compaction threshold.- Returns:
- the threshold (0.0-1.0), or
nullto use default
-
setBackgroundCompactionThreshold
Sets the context utilization threshold at which background compaction starts.Compaction runs asynchronously, allowing the session to continue processing. Default: 0.80
- Parameters:
backgroundCompactionThreshold- the threshold (0.0-1.0)- Returns:
- this config instance for method chaining
-
getBufferExhaustionThreshold
Gets the buffer exhaustion threshold.- Returns:
- the threshold (0.0-1.0), or
nullto use default
-
setBufferExhaustionThreshold
Sets the context utilization threshold at which the session blocks until compaction completes.This prevents context overflow when compaction hasn't finished in time. Default: 0.95
- Parameters:
bufferExhaustionThreshold- the threshold (0.0-1.0)- Returns:
- this config instance for method chaining
-