Class ServerSessionsApi
java.lang.Object
com.github.copilot.generated.rpc.ServerSessionsApi
API methods for the
sessions namespace.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbulkDelete(SessionsBulkDeleteParams params) Closes, deactivates, and deletes a set of sessions, returning the bytes freed per session.checkInUse(SessionsCheckInUseParams params) Returns the subset of the supplied session IDs that are currently held by another running process.close(SessionsCloseParams params) Closes a session: emits shutdown, flushes pending events, releases the in-use lock, and disposes the active session.connect(SessionsConnectParams params) Connects to an existing remote session and exposes it as an SDK session.Backfills missing summary and context fields on the supplied session metadata records.Resolves a UUID prefix to a unique session ID, if exactly one session matches.Finds the local session bound to a GitHub task ID, if any.fork(SessionsForkParams params) Creates a new session by forking persisted history from an existing session.Reads client-owned metadata for multiple persisted local sessions without opening them.Returns the most-relevant prior session for a given working-directory context.Returns the current state of the remote-control singleton, including the attached session id and frontend URL when active.getSizes()Returns the on-disk byte size of each session's workspace directory.list()Lists sessions, optionally filtered by source and working-directory context.list(SessionsListParams params) Lists sessions, optionally filtered by source and working-directory context.Loads previously-deferred repo-level hooks on the active session, returning queued startup prompts.open(SessionsOpenParams params) Creates or resumes a local session and returns the opened session ID.pruneOld(SessionsPruneOldParams params) Deletes sessions older than the given threshold, with optional dry-run and exclusion list.Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session.releaseLock(SessionsReleaseLockParams params) Releases the in-use lock held by this process for a session.Reloads user, plugin, and (optionally) repo hooks on the active session.save(SessionsSaveParams params) Flushes a session's pending events to disk.Replaces the manager-wide additional plugins registered with the session manager.Patches the steering state of the active remote-control singleton.Attaches the runtime-managed remote-control singleton to a session, awaiting initial setup.Stops the remote-control singleton.Stops the remote-control singleton.Atomically rebinds the remote-control singleton to a different session, preserving the underlying Mission Control connection.
-
Method Details
-
open
Creates or resumes a local session and returns the opened session ID.- Since:
- 1.0.0
-
fork
Creates a new session by forking persisted history from an existing session.- Since:
- 1.0.0
-
connect
@CopilotExperimental public CompletableFuture<SessionsConnectResult> connect(SessionsConnectParams params) Connects to an existing remote session and exposes it as an SDK session.- Since:
- 1.0.0
-
list
Lists sessions, optionally filtered by source and working-directory context. Returned entries are discriminated by `isRemote`: local entries carry only the lightweight `LocalSessionMetadataValue` shape; remote entries carry the full `RemoteSessionMetadataValue` shape (repository, PR number, taskType, etc.).Invokes the method with no params, applying the runtime defaults.
- Since:
- 1.0.0
-
list
Lists sessions, optionally filtered by source and working-directory context. Returned entries are discriminated by `isRemote`: local entries carry only the lightweight `LocalSessionMetadataValue` shape; remote entries carry the full `RemoteSessionMetadataValue` shape (repository, PR number, taskType, etc.).- Since:
- 1.0.0
-
getClientMetadata
@CopilotExperimental public CompletableFuture<List<Object>> getClientMetadata(SessionsGetClientMetadataParams params) Reads client-owned metadata for multiple persisted local sessions without opening them. Results preserve request order and report missing, corrupt, unsupported, or temporarily unavailable sessions independently.- Since:
- 1.0.0
-
readPersistedEvents
@CopilotExperimental public CompletableFuture<SessionsReadPersistedEventsResult> readPersistedEvents(SessionsReadPersistedEventsParams params) Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The first read pins the currently opened journal generation and its byte-length boundary; opaque cursor continuations remain on that generation across runtime-owned compaction, truncation, and rewrite operations, which replace the live path atomically, and events appended after the boundary are excluded. For cold hydration, await the first successful page before activation and establish lossless live-event buffering before resume; merge subsequent live events by ID, preserving persisted order and letting live payloads win. Continuations are process-local, single-use capabilities bound to the originating session and storage context and must be paged sequentially; concurrent or repeated use of the same cursor expires that duplicate read rather than reading the generation twice. A complete snapshot has cursorStatus 'ok' and hasMore false. Snapshots expire after five idle minutes, with at most eight retained per process and idle-only eviction under pressure; completion and cancelled-worker exit release their handles. No transcript copy is created, but retained handles may keep replaced files' disk blocks alive until release. Pages have a soft 1 MiB serialized event-array budget including resolved binary assets; one oversized event is returned alone to guarantee progress. Working memory also includes a record/lookahead and asset resolution; resolving the first binary reference may scan the full pinned generation to build a bounded offset index. If the snapshot expires, is evicted, is cancelled before a continuation is established, or becomes unreadable after an observable unsupported in-place shortening, the continuation returns cursorStatus 'expired' with an empty terminal page and never falls back to a different generation. A missing or initially unreadable journal is an RPC error. Persisted history excludes ephemeral events and may omit payloads that are reconstructed only for an active session; use the active session event stream for post-resume live events.- Since:
- 1.0.0
-
findByTaskId
@CopilotExperimental public CompletableFuture<SessionsFindByTaskIdResult> findByTaskId(SessionsFindByTaskIdParams params) Finds the local session bound to a GitHub task ID, if any.- Since:
- 1.0.0
-
findByPrefix
@CopilotExperimental public CompletableFuture<SessionsFindByPrefixResult> findByPrefix(SessionsFindByPrefixParams params) Resolves a UUID prefix to a unique session ID, if exactly one session matches.- Since:
- 1.0.0
-
getLastForContext
@CopilotExperimental public CompletableFuture<SessionsGetLastForContextResult> getLastForContext(SessionsGetLastForContextParams params) Returns the most-relevant prior session for a given working-directory context.- Since:
- 1.0.0
-
getSizes
Returns the on-disk byte size of each session's workspace directory.- Since:
- 1.0.0
-
checkInUse
@CopilotExperimental public CompletableFuture<SessionsCheckInUseResult> checkInUse(SessionsCheckInUseParams params) Returns the subset of the supplied session IDs that are currently held by another running process.- Since:
- 1.0.0
-
close
Closes a session: emits shutdown, flushes pending events, releases the in-use lock, and disposes the active session.- Since:
- 1.0.0
-
bulkDelete
@CopilotExperimental public CompletableFuture<SessionsBulkDeleteResult> bulkDelete(SessionsBulkDeleteParams params) Closes, deactivates, and deletes a set of sessions, returning the bytes freed per session.- Since:
- 1.0.0
-
pruneOld
@CopilotExperimental public CompletableFuture<SessionsPruneOldResult> pruneOld(SessionsPruneOldParams params) Deletes sessions older than the given threshold, with optional dry-run and exclusion list.- Since:
- 1.0.0
-
save
Flushes a session's pending events to disk.- Since:
- 1.0.0
-
releaseLock
Releases the in-use lock held by this process for a session.- Since:
- 1.0.0
-
enrichMetadata
@CopilotExperimental public CompletableFuture<SessionsEnrichMetadataResult> enrichMetadata(SessionsEnrichMetadataParams params) Backfills missing summary and context fields on the supplied session metadata records.- Since:
- 1.0.0
-
reloadPluginHooks
@CopilotExperimental public CompletableFuture<Void> reloadPluginHooks(SessionsReloadPluginHooksParams params) Reloads user, plugin, and (optionally) repo hooks on the active session.- Since:
- 1.0.0
-
loadDeferredRepoHooks
@CopilotExperimental public CompletableFuture<SessionsLoadDeferredRepoHooksResult> loadDeferredRepoHooks(SessionsLoadDeferredRepoHooksParams params) Loads previously-deferred repo-level hooks on the active session, returning queued startup prompts.- Since:
- 1.0.0
-
setAdditionalPlugins
@CopilotExperimental public CompletableFuture<Void> setAdditionalPlugins(SessionsSetAdditionalPluginsParams params) Replaces the manager-wide additional plugins registered with the session manager.- Since:
- 1.0.0
-
startRemoteControl
@CopilotExperimental public CompletableFuture<SessionsStartRemoteControlResult> startRemoteControl(SessionsStartRemoteControlParams params) Attaches the runtime-managed remote-control singleton to a session, awaiting initial setup. If remote control is already attached to a different session, the singleton is transferred (preserving the underlying Mission Control connection). Returns the final status.- Since:
- 1.0.0
-
transferRemoteControl
@CopilotExperimental public CompletableFuture<SessionsTransferRemoteControlResult> transferRemoteControl(SessionsTransferRemoteControlParams params) Atomically rebinds the remote-control singleton to a different session, preserving the underlying Mission Control connection. When `expectedFromSessionId` is provided and does not match the singleton's current `attachedSessionId`, the transfer is rejected with `transferred: false` and the current status is returned unchanged.- Since:
- 1.0.0
-
setRemoteControlSteering
@CopilotExperimental public CompletableFuture<SessionsSetRemoteControlSteeringResult> setRemoteControlSteering(SessionsSetRemoteControlSteeringParams params) Patches the steering state of the active remote-control singleton. When remote control is off, this is a no-op and the off status is returned. Today only `enabled: true` is actionable on the underlying exporter; passing `false` is reserved for future use.- Since:
- 1.0.0
-
stopRemoteControl
Stops the remote-control singleton. When `expectedSessionId` is provided and does not match the singleton's current `attachedSessionId`, the stop is rejected with `stopped: false` and the current status is returned unchanged (unless `force` is set, in which case the singleton is unconditionally torn down).Invokes the method with no params, applying the runtime defaults.
- Since:
- 1.0.0
-
stopRemoteControl
@CopilotExperimental public CompletableFuture<SessionsStopRemoteControlResult> stopRemoteControl(SessionsStopRemoteControlParams params) Stops the remote-control singleton. When `expectedSessionId` is provided and does not match the singleton's current `attachedSessionId`, the stop is rejected with `stopped: false` and the current status is returned unchanged (unless `force` is set, in which case the singleton is unconditionally torn down).- Since:
- 1.0.0
-
getRemoteControlStatus
@CopilotExperimental public CompletableFuture<SessionsGetRemoteControlStatusResult> getRemoteControlStatus()Returns the current state of the remote-control singleton, including the attached session id and frontend URL when active.- Since:
- 1.0.0
-