Class SessionMetadataApi
java.lang.Object
com.github.copilot.generated.rpc.SessionMetadataApi
API methods for the
metadata namespace.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionactivity()Returns a snapshot of activity flags for the session.Returns the token breakdown for the session's current context window for a given model.Returns the client-owned string metadata persisted with this local session.Returns the experimental per-source attribution breakdown of the session's current context window as a flat list of entries (skills, subagents, MCP servers, built-in tools, plugin rollups, system/tool-definition costs, with nesting via parentId), plus the successful compaction count.Returns the largest individual messages currently in the session's context window, most-expensive first.Reports whether the local session is currently processing user/agent messages.Re-tokenizes the session's existing messages against a model and returns aggregate token totals.Records a working-directory/git context change and emits a `session.context_changed` event.Updates the session's working directory.snapshot()Returns a snapshot of the session's identifying metadata, mode, agent, and remote info.Atomically patches the client-owned string metadata persisted with this local session and returns the committed bag.
-
Method Details
-
snapshot
Returns a snapshot of the session's identifying metadata, mode, agent, and remote info.- Since:
- 1.0.0
-
getClientMetadata
Returns the client-owned string metadata persisted with this local session. The metadata is not included in model context, events, telemetry, snapshots, or remote exports.- Since:
- 1.0.0
-
updateClientMetadata
@CopilotExperimental public CompletableFuture<ClientMetadata> updateClientMetadata(SessionMetadataUpdateClientMetadataParams params) Atomically patches the client-owned string metadata persisted with this local session and returns the committed bag.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
isProcessing
Reports whether the local session is currently processing user/agent messages.- Since:
- 1.0.0
-
activity
Returns a snapshot of activity flags for the session.- Since:
- 1.0.0
-
contextInfo
@CopilotExperimental public CompletableFuture<SessionMetadataContextInfoResult> contextInfo(SessionMetadataContextInfoParams params) Returns the token breakdown for the session's current context window for a given model.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
getContextAttribution
@CopilotExperimental public CompletableFuture<SessionMetadataGetContextAttributionResult> getContextAttribution()Returns the experimental per-source attribution breakdown of the session's current context window as a flat list of entries (skills, subagents, MCP servers, built-in tools, plugin rollups, system/tool-definition costs, with nesting via parentId), plus the successful compaction count. The heaviest individual messages are available separately via `metadata.getContextHeaviestMessages`. Returns null until the session has initialized its system prompt and tool metadata.- Since:
- 1.0.0
-
getContextHeaviestMessages
@CopilotExperimental public CompletableFuture<SessionMetadataGetContextHeaviestMessagesResult> getContextHeaviestMessages(SessionMetadataGetContextHeaviestMessagesParams params) Returns the largest individual messages currently in the session's context window, most-expensive first. Companion to `metadata.getContextAttribution`. Returns an empty list until the session has initialized.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
recordContextChange
@CopilotExperimental public CompletableFuture<Void> recordContextChange(SessionMetadataRecordContextChangeParams params) Records a working-directory/git context change and emits a `session.context_changed` event. For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event): a local session's working directory is authoritative and is moved via `metadata.setWorkingDirectory` (or an SDK `session.resume` that supplies a `workingDirectory`), not by this method.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
setWorkingDirectory
@CopilotExperimental public CompletableFuture<SessionMetadataSetWorkingDirectoryResult> setWorkingDirectory(SessionMetadataSetWorkingDirectoryParams params) Updates the session's working directory. For local sessions the target is validated first (an absolute path that exists on disk) and the permission primary directory is re-based; a rejected validation fails the call before any session state changes.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
recomputeContextTokens
@CopilotExperimental public CompletableFuture<SessionMetadataRecomputeContextTokensResult> recomputeContextTokens(SessionMetadataRecomputeContextTokensParams params) Re-tokenizes the session's existing messages against a model and returns aggregate token totals.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-