Package com.github.copilot.generated
package com.github.copilot.generated
Auto-generated session event types for the GitHub Copilot SDK.
This package contains Java classes generated from the Copilot CLI's
session-events.schema.json. Each event type corresponds to a
notification emitted during a CopilotSession
interaction.
Key Classes
SessionEvent- Abstract sealed base class for all session events. Deserialized polymorphically via thetypediscriminator.UnknownSessionEvent- Fallback for event types not yet known to this SDK version, preserving forward compatibility.
Example Usage
session.on(AssistantMessageEvent.class, msg -> {
System.out.println(msg.getData().content());
});
Related Packages
com.github.copilot- Core SDK classescom.github.copilot.generated.rpc- Auto-generated RPC parameter and result types
- See Also:
-
ClassDescriptionSession event "abort".Data payload for
AbortEvent.Finite reason code describing why the current turn was abortedSession event "assistant.idle".Data payload forAssistantIdleEvent.Session event "assistant.intent".Data payload forAssistantIntentEvent.Session event "assistant.message_delta".Data payload forAssistantMessageDeltaEvent.Session event "assistant.message".Data payload forAssistantMessageEvent.Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-trippingSession event "assistant.message_start".Data payload forAssistantMessageStartEvent.A tool invocation request from the assistantTool call type: "function" for standard tool calls, "custom" for grammar-based tool calls.Session event "assistant.reasoning_delta".Data payload forAssistantReasoningDeltaEvent.Session event "assistant.reasoning".Data payload forAssistantReasoningEvent.Session event "assistant.streaming_delta".Data payload forAssistantStreamingDeltaEvent.Session event "assistant.turn_end".Data payload forAssistantTurnEndEvent.Session event "assistant.turn_start".Data payload forAssistantTurnStartEvent.API endpoint used for this model call, matching CAPI supported_endpoints vocabularyPer-request cost and usage data from the CAPI copilot_usage response fieldToken usage detail for a single billing categorySession event "assistant.usage".Data payload forAssistantUsageEvent.Schema for the `AssistantUsageQuotaSnapshot` type.Session event "auto_mode_switch.completed".Data payload forAutoModeSwitchCompletedEvent.Session event "auto_mode_switch.requested".Data payload forAutoModeSwitchRequestedEvent.The user's auto-mode-switch choiceThe type of operation performed on the autopilot objective state fileCurrent autopilot objective status, if one existsBinary asset type discriminator.Schema for the `CanvasRegistryChangedCanvas` type.Schema for the `CanvasRegistryChangedCanvasAction` type.Session event "capabilities.changed".Data payload forCapabilitiesChangedEvent.UI capability changesA source supplied by a tool that should be made available to the model as citable content.The system that produced a citation.A single citation occurrence linking a span of generated text to a supporting source.Provider-agnostic citations linking spans of the assistant's response to their supporting sources.A source that backs one or more cited spans in the assistant's response.A contiguous span of generated assistant text and the source references that support it.Session event "command.completed".Data payload forCommandCompletedEvent.Session event "command.execute".Data payload forCommandExecuteEvent.Session event "command.queued".Data payload forCommandQueuedEvent.Schema for the `CommandsChangedCommand` type.Session event "commands.changed".Data payload forCommandsChangedEvent.Token usage breakdown for the compaction LLM call (aligned with assistant.usage format)Per-request cost and usage data from the CAPI copilot_usage response fieldToken usage detail for a single billing categoryAllowed values for the `ContextTier` enumeration.Schema for the `CustomAgentsUpdatedAgent` type.The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed)Session event "elicitation.completed".Data payload forElicitationCompletedEvent.Session event "elicitation.requested".Data payload forElicitationRequestedEvent.Elicitation mode; "form" for structured input, "url" for browser-based.JSON Schema describing the form fields to present to the user (form mode only)Exit plan mode actionSession event "exit_plan_mode.completed".Data payload forExitPlanModeCompletedEvent.Session event "exit_plan_mode.requested".Data payload forExitPlanModeRequestedEvent.Schema for the `ExtensionsLoadedExtension` type.Discovery sourceCurrent status: running, disabled, failed, or startingSession event "external_tool.completed".Data payload forExternalToolCompletedEvent.Session event "external_tool.requested".Data payload forExternalToolRequestedEvent.Repository context for the handed-off sessionOrigin type of the session being handed offError details when the hook failedSession event "hook.end".Data payload forHookEndEvent.Session event "hook.progress".Data payload forHookProgressEvent.Session event "hook.start".Data payload forHookStartEvent.Set when the underlying tools/call threw an error before returning a CallToolResultSession event "mcp_app.tool_call_complete".Data payload forMcpAppToolCallCompleteEvent.The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools.Schema for the `McpAppToolCallCompleteToolMetaUI` type.Session event "mcp.headers_refresh_completed".Data payload forMcpHeadersRefreshCompletedEvent.How the pending MCP headers refresh request resolved.Session event "mcp.headers_refresh_required".Data payload forMcpHeadersRefreshRequiredEvent.Why dynamic headers are being requested.Session event "mcp.oauth_completed".Data payload forMcpOauthCompletedEvent.How the pending MCP OAuth request was completedReason the runtime is requesting host-provided MCP OAuth credentialsSession event "mcp.oauth_required".Data payload forMcpOauthRequiredEvent.Static OAuth client configuration, if the server specifies oneOAuth WWW-Authenticate parameters parsed from an MCP auth challengeSchema for the `McpServersLoadedServer` type.Configuration source: user, workspace, plugin, or builtinConnection status: connected, failed, needs-auth, pending, disabled, or not_configuredTransport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)For HTTP 400 failures only: whether the response carried a structured CAPI error envelope (structured_error, a deterministic validation failure) or no error body (bodyless, the transient gateway/proxy signature).Session event "model.call_failure".Data payload forModelCallFailureEvent.Content-free structural summary of the failing request for diagnosing malformed 4xx callsWhere the failed model call originatedSession event "pending_messages.modified".Data payload forPendingMessagesModifiedEvent.Session event "permission.completed".Data payload forPermissionCompletedEvent.Session event "permission.requested".Data payload forPermissionRequestedEvent.The type of operation performed on the plan fileReasoning summary mode used for model calls, if applicable (e.g.Session event "sampling.completed".Data payload forSamplingCompletedEvent.Session event "sampling.requested".Data payload forSamplingRequestedEvent.Session event "session.autopilot_objective_changed".Data payload forSessionAutopilotObjectiveChangedEvent.Session event "session.background_tasks_changed".Data payload forSessionBackgroundTasksChangedEvent.Session event "session.binary_asset".Data payload forSessionBinaryAssetEvent.Session event "session.canvas.closed".Data payload forSessionCanvasClosedEvent.Session event "session.canvas.opened".Data payload forSessionCanvasOpenedEvent.Session event "session.canvas.recorded".Data payload forSessionCanvasRecordedEvent.Session event "session.canvas.registry_changed".Data payload forSessionCanvasRegistryChangedEvent.Session event "session.canvas.removed".Data payload forSessionCanvasRemovedEvent.Session event "session.canvas.unavailable".Data payload forSessionCanvasUnavailableEvent.Session event "session.compaction_complete".Data payload forSessionCompactionCompleteEvent.Session event "session.compaction_start".Data payload forSessionCompactionStartEvent.Session event "session.context_changed".Data payload forSessionContextChangedEvent.Session event "session.custom_agents_updated".Data payload forSessionCustomAgentsUpdatedEvent.Session event "session.custom_notification".Data payload forSessionCustomNotificationEvent.Session event "session.error".Data payload forSessionErrorEvent.Base class for all generated session events.Session event "session.extensions.attachments_pushed".Data payload forSessionExtensionsAttachmentsPushedEvent.Session event "session.extensions_loaded".Data payload forSessionExtensionsLoadedEvent.Session event "session.handoff".Data payload forSessionHandoffEvent.Session event "session.idle".Data payload forSessionIdleEvent.Session event "session.info".Data payload forSessionInfoEvent.Optional session limits.Session event "session_limits_exhausted.completed".Data payload forSessionLimitsExhaustedCompletedEvent.Session event "session_limits_exhausted.requested".Data payload forSessionLimitsExhaustedRequestedEvent.The user's selected action for an exhausted session limit.User action selected for an exhausted session limit.Session event "session.mcp_servers_loaded".Data payload forSessionMcpServersLoadedEvent.Session event "session.mcp_server_status_changed".Data payload forSessionMcpServerStatusChangedEvent.The session mode the agent is operating inSession event "session.mode_changed".Data payload forSessionModeChangedEvent.Session event "session.model_change".Data payload forSessionModelChangeEvent.Session event "session.permissions_changed".Data payload forSessionPermissionsChangedEvent.Session event "session.plan_changed".Data payload forSessionPlanChangedEvent.Session event "session.remote_steerable_changed".Data payload forSessionRemoteSteerableChangedEvent.Session event "session.resume".Data payload forSessionResumeEvent.Session event "session.schedule_cancelled".Data payload forSessionScheduleCancelledEvent.Session event "session.schedule_created".Data payload forSessionScheduleCreatedEvent.Session event "session.schedule_rearmed".Data payload forSessionScheduleRearmedEvent.Session event "session.session_limits_changed".Data payload forSessionSessionLimitsChangedEvent.Session event "session.shutdown".Data payload forSessionShutdownEvent.Session event "session.skills_loaded".Data payload forSessionSkillsLoadedEvent.Session event "session.snapshot_rewind".Data payload forSessionSnapshotRewindEvent.Session event "session.start".Data payload forSessionStartEvent.Session event "session.task_complete".Data payload forSessionTaskCompleteEvent.Session event "session.title_changed".Data payload forSessionTitleChangedEvent.Session event "session.todos_changed".Data payload forSessionTodosChangedEvent.Session event "session.tools_updated".Data payload forSessionToolsUpdatedEvent.Session event "session.truncation".Data payload forSessionTruncationEvent.Session event "session.usage_checkpoint".Data payload forSessionUsageCheckpointEvent.Session event "session.usage_info".Data payload forSessionUsageInfoEvent.Session event "session.warning".Data payload forSessionWarningEvent.Session event "session.workspace_file_changed".Data payload forSessionWorkspaceFileChangedEvent.Aggregate code change metrics for the sessionSchema for the `ShutdownModelMetric` type.Request count and cost metricsSchema for the `ShutdownModelMetricTokenDetail` type.Token usage breakdownSchema for the `ShutdownTokenDetail` type.Whether the session ended normally ("routine") or due to a crash/fatal error ("error")Session event "skill.invoked".Data payload forSkillInvokedEvent.What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent)Schema for the `SkillsLoadedSkill` type.Source location type (e.g., project, personal-copilot, plugin, builtin)Session event "subagent.completed".Data payload forSubagentCompletedEvent.Session event "subagent.deselected".Data payload forSubagentDeselectedEvent.Session event "subagent.failed".Data payload forSubagentFailedEvent.Session event "subagent.selected".Data payload forSubagentSelectedEvent.Session event "subagent.started".Data payload forSubagentStartedEvent.Session event "system.message".Data payload forSystemMessageEvent.Metadata about the prompt template and its constructionMessage role: "system" for system prompts, "developer" for developer-injected instructionsSession event "system.notification".Data payload forSystemNotificationEvent.Error details when the tool execution failedSession event "tool.execution_complete".Data payload forToolExecutionCompleteEvent.Tool execution result on successTool definition metadata, present for MCP tools with MCP Apps supportMCP Apps metadata for UI resource associationSchema for the `ToolExecutionCompleteToolDescriptionMetaUI` type.Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration.MCP Apps UI resource content for rendering in a sandboxed iframeResource-level UI metadata (CSP, permissions, visual preferences)Schema for the `ToolExecutionCompleteUIResourceMetaUI` type.Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type.Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type.Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type.Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type.Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type.Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type.Session event "tool.execution_partial_result".Data payload forToolExecutionPartialResultEvent.Session event "tool.execution_progress".Data payload forToolExecutionProgressEvent.Session event "tool.execution_start".Data payload forToolExecutionStartEvent.Shell-aware path hints for a shell tool's command, captured at start time so consumers can snapshot a file's pre-image before the tool runs.Tool definition metadata, present for MCP tools with MCP Apps supportMCP Apps metadata for UI resource associationSchema for the `ToolExecutionStartToolDescriptionMetaUI` type.Allowed values for the `ToolExecutionStartToolDescriptionMetaUIVisibility` enumeration.Session event "tool.user_requested".Data payload forToolUserRequestedEvent.Fallback for event types not yet known to this SDK version.Session event "user_input.completed".Data payload forUserInputCompletedEvent.Session event "user_input.requested".Data payload forUserInputRequestedEvent.The agent mode that was active when this message was sentHow this user message was delivered to the agentic loop, relative to whether the loop was already running.Session event "user.message".Data payload forUserMessageEvent.Working directory and git context at session startHosting platform type of the repository (github or ado)Whether the file was newly created or updated