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 abortedWhat the agent was doing when the user interrupted it.Where the interruption landed relative to the first streamed token.Session event "agent.interrupted".Data payload forAgentInterruptedEvent.Whether configured models are advisory preferences or required constraintsWhether the accumulated numeric AI-credit subtotal covers the observed calls.Session event "assistant.fusion_phase_activity".Data payload forAssistantFusionPhaseActivityEvent.Session event "assistant.fusion_phase_completed".Data payload forAssistantFusionPhaseCompletedEvent.Session event "assistant.fusion_phase_failed".Data payload forAssistantFusionPhaseFailedEvent.Session event "assistant.fusion_phase_started".Data payload forAssistantFusionPhaseStartedEvent.Session 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 reasoning content blocks preserved verbatim for round-trippingNeutral 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 assistantHosted program that requested this client tool callHosted program caller typeTool 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.server_tool_progress".Data payload forAssistantServerToolProgressEvent.Session event "assistant.streaming_delta".Data payload forAssistantStreamingDeltaEvent.Session event "assistant.tool_call_delta".Data payload forAssistantToolCallDeltaEvent.Session event "assistant.turn_end".Data payload forAssistantTurnEndEvent.Session event "assistant.turn_retry".Data payload forAssistantTurnRetryEvent.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.Internal per-quota snapshot for assistant usage, including entitlement, consumed requests, overage, reset date, and remaining quota.Transport used for a successful model callCoarse request-difficulty bucket for UX explainabilitySession 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 existsExtensible routing preference for the virtual `auto` model.Terminal reason an Auto preference activation failed.Binary asset type discriminator.A single canvas declaration in `session.canvas.registry_changed`, including provider IDs, display metadata, input schema, and actions.A single action within a canvas declaration, with its name, optional description, and optional input schema.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.A single slash command available in the session, as listed by the `commands.changed` event.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 categoryWhat initiated a conversation compactionInclusive durable event range summarized by a completion receipt.Final structured tool completion in the covered event range.Runtime reason the completion decision was accepted.Structured terminal status from a tool completion event.Allowed values for the `ContextTier` enumeration.A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration.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.A single extension discovered by `session.extensions_loaded`, including qualified ID, source, and current status.Discovery sourceCurrent status: running, disabled, failed, or startingSession event "external_tool.completed".Data payload forExternalToolCompletedEvent.Session event "external_tool.requested".Data payload forExternalToolRequestedEvent.Experimental attribution linking an ordinary event to the HydraFusion turn, phase, and concrete source that produced it.Conversation scope in which a HydraFusion phase executes.Data typeFusionCritic.Server-recommended routing behavior for a later HydraFusion turn.Durable server recommendation for subsequent HydraFusion turns.Validated HydraFusion execution pattern.Content-safe activity observed while a HydraFusion phase is running.HydraFusion phase kind.Presentation-neutral phase planned for a HydraFusion turn.Durable outcome status of a HydraFusion phase.Aggregate concrete-model usage for one HydraFusion phase.How a durable phase checkpoint contributes its exact message to canonical root history.Validated HydraFusion routing capability scores.Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it.Kind of turn for which HydraFusion routing is running.Per-session configuration for the built-in GitHub MCP serverRepository context for the handed-off sessionOrigin type of the session being handed offSingle HTTP header entry as a name/value pair.Error 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.Controlled provenance for a typed runtime response.Session event "human_response.recorded".Data payload forHumanResponseRecordedEvent.Exact runtime-owned question or reviewed plan paired with the typed response that settled it.Variantask_userofHumanResponseRecordedResponse.Variantexit_plan_modeofHumanResponseRecordedResponse.Variantuser_inputofHumanResponseRecordedResponse.The category of runtime action that enterprise managed settings governed (blocked or capped)For a `bypass_permissions_blocked` action, which permission-mode or escalation primitive was refusedSummary of which managed-settings channels contributed to the effective session policy.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.MCP App tool `_meta.ui` resource URI and SEP-1865 visibility captured with an `mcp_app.tool_call_complete` result.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 completedRaw HTTP response details from the OAuth auth challenge, as observed by the runtime.Reason 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 challengeSession event "mcp.prompts.list_changed".Data payload forMcpPromptsListChangedEvent.Session event "mcp.resources.list_changed".Data payload forMcpResourcesListChangedEvent.Server-advertised metadata learned through modern discovery or legacy initialization.A single MCP server status summary in `session.mcp_servers_loaded`, including name, status, source, transport, and plugin metadata.Configuration source: user, workspace, plugin, builtin, managed, or accountConnection status: connected, failed, needs-auth, pending, disabled, stopped, or not_configuredTransport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)Session event "mcp.tools.list_changed".Data payload forMcpToolsListChangedEvent.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.Boundary that produced a model call failureContent-free structural summary of the failing request for diagnosing malformed 4xx callsWhere the failed model call originatedTransport used for a failed model callFinal bounded result of one logical model operation after its internal retry loop settlesSession event "model.call_final_result".Data payload forModelCallFinalResultEvent.Session event "model.call_finished".Data payload forModelCallFinishedEvent.Final outcome of one logical model dispatch after response acceptance processingSession event "model.call_start".Data payload forModelCallStartEvent.Why a WebSocket-capable model call was carried by the HTTP fallbackOrigin of an effective session model change.Why the session no longer has an explicitly selected model.The neutral kind of a model provider — the model analog of `AccountKind`.A neutral reference to the model provider that produced a model: an opaque id, a human-readable label, and the provider kind.Session event "pending_messages.modified".Data payload forPendingMessagesModifiedEvent.Session event "permission.assentDetected".Data payload forPermissionAssentDetectedEvent.Session event "permission.carriedForward".Data payload forPermissionCarriedForwardEvent.Session event "permission.completed".Data payload forPermissionCompletedEvent.Session event "permission.contextualAuthorization".Data payload forPermissionContextualAuthorizationEvent.Controlled reason or actor responsible for a permission response.Session event "permission.messageAuthorizationDegraded".Data payload forPermissionMessageAuthorizationDegradedEvent.Session event "permission.messageAuthorization".Data payload forPermissionMessageAuthorizationEvent.Direction stored in a historical extractor claim.Session event "permission.messageAuthorizationRead".Data payload forPermissionMessageAuthorizationReadEvent.Permission mode for the session.Runtime handling applied to a recovery attemptControlled reason for an individual attempt dispositionRelationship of an attempt to earlier permission requestsAuthoritative snapshot of an Autopilot permission-recovery episodeAction selected when autonomous recovery cannot continueControlled reason for a permission-recovery episode transitionLifecycle state of a permission-recovery episodeSession event "permission.requested".Data payload forPermissionRequestedEvent.The type of operation performed on the plan fileSession event "prompt_cache_break".Data payload forPromptCacheBreakEvent.Access policy reported by the quota service.Acquisition state, independent of the service's business access/capacity verdict.Authoritative budget measurements and policy metadata, independent of provider.Capacity is independent of whether a numeric balance was supplied.Timing and purpose of a provider quota observation.Interpretation permitted for independently reported quantities.An account quota reading.Units explicitly reported by a quota provider.Reasoning summary mode used for model calls, if applicable (e.g.Enabled Auto preferences that Copilot API can recommend.What the user must do to recover from a failure, named as an action rather than as one client's affordance.Original request-level and effective conversation reasoning effort for a provider history boundary; the historical type name is retained for compatibilitySession event "sampling.completed".Data payload forSamplingCompletedEvent.Session event "sampling.requested".Data payload forSamplingRequestedEvent.Session event "sandbox.decision".Raw union payload forSandboxDecisionEvent, preserving every variant's fields.Who created the schedule: `user` (an explicit user action such as `/every` or `/after`) or `model` (the agent via the `manage_schedule` tool).Session event "session.auto_mode_resolved".Data payload forSessionAutoModeResolvedEvent.Session event "session.autopilot_objective_changed".Data payload forSessionAutopilotObjectiveChangedEvent.Session event "session.auto_tier_recommendation".Data payload forSessionAutoTierRecommendationEvent.Session event "session.auto_tier_switch_failed".Data payload forSessionAutoTierSwitchFailedEvent.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.completion_receipt".Data payload forSessionCompletionReceiptEvent.Session event "session.context_changed".Data payload forSessionContextChangedEvent.Session event "session.context_cleared".Data payload forSessionContextClearedEvent.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.fusion_completed".Data payload forSessionFusionCompletedEvent.Session event "session.fusion_resolved".Data payload forSessionFusionResolvedEvent.Session event "session.fusion_route_failed".Data payload forSessionFusionRouteFailedEvent.Session event "session.fusion_route_started".Data payload forSessionFusionRouteStartedEvent.Session event "session.handoff".Data payload forSessionHandoffEvent.Session event "session.idle".Data payload forSessionIdleEvent.Session event "session.indexed_search".Raw union payload forSessionIndexedSearchEvent, preserving every variant's fields.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.managed_settings_enforced".Data payload forSessionManagedSettingsEnforcedEvent.Session event "session.managed_settings_resolved".Data payload forSessionManagedSettingsResolvedEvent.Session event "session.mcp_server_needs_reconnect".Data payload forSessionMcpServerNeedsReconnectEvent.Session event "session.mcp_server_removed".Data payload forSessionMcpServerRemovedEvent.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.model_deselected".Data payload forSessionModelDeselectedEvent.Session event "session.mode_notice_delivered".Data payload forSessionModeNoticeDeliveredEvent.Session event "session.permission_recovery".Data payload forSessionPermissionRecoveryEvent.Session event "session.permissions_changed".Data payload forSessionPermissionsChangedEvent.Session event "session.plan_changed".Data payload forSessionPlanChangedEvent.Session event "session.quota_observation".Data payload forSessionQuotaObservationEvent.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.Usage attributed to one agent instance at session shutdown.Aggregate code change metrics for the sessionPer-model shutdown metrics with request counts, token usage, nano-AI units, and token details.Request count and cost metricsA token-type entry in a shutdown model metric, storing the accumulated token count.Token usage breakdownA session-wide shutdown token-type entry storing the accumulated token count.Whether the session ended normally ("routine") or due to a crash/fatal error ("error")Session event "skill.context_delivered".Data payload forSkillContextDeliveredEvent.Session event "skill.context_delivered_ref".Data payload forSkillContextDeliveredRefEvent.Session event "skill.invoked".Data payload forSkillInvokedEvent.Session event "skill.invoked_ref".Data payload forSkillInvokedRefEvent.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)A single resolved skill in `session.skills_loaded`, including source, invocability, enabled state, path, and argument hint.Source location type (e.g., project, personal-copilot, plugin, builtin, sdk)Session event "subagent.completed".Data payload forSubagentCompletedEvent.Session event "subagent.configured".Data payload forSubagentConfiguredEvent.Session event "subagent.deselected".Data payload forSubagentDeselectedEvent.Session event "subagent.failed".Data payload forSubagentFailedEvent.Authority or runtime mechanism responsible for sub-agent model selection.Session event "subagent.selected".Data payload forSubagentSelectedEvent.Session event "subagent.started".Data payload forSubagentStartedEvent.Where the model input for a task-tool sub-agent came from.One persisted structured system-message block and its cache intentSession 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.Structured reason that the task cannot continue without interventionCategory of structured task blockerSemantic result of evaluating a task completion requestError details when the tool execution failedSession event "tool.execution_complete".Data payload forToolExecutionCompleteEvent.A file mutation that was actually committed by a built-in file editing tool.Kind of file mutation committed by a built-in editing tool.Tool execution result on successExperimental shell completion facts retained independently of the full tool result.Tool definition metadata, present for MCP tools with MCP Apps supportMCP Apps metadata for UI resource associationMCP Apps tool `_meta.ui` resource URI and visibility captured on `tool.execution_complete`.Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration.MCP Apps UI resource content for rendering in a sandboxed iframeResource-level UI metadata (CSP, permissions, visual preferences)MCP Apps UI resource metadata for a completed tool result, including CSP, permissions, domain, and border preference.CSP domain allowlists for an MCP Apps UI resource, including connect, resource, frame, and base URI domains.Browser permission metadata for an MCP Apps UI resource, including camera, microphone, geolocation, and clipboard-write.Marker object for camera permission on an MCP Apps UI resource.Marker object for clipboard-write permission on an MCP Apps UI resource.Marker object for geolocation permission on an MCP Apps UI resource.Marker object for microphone permission on an MCP Apps UI resource.Deprecated.Deprecated.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 associationMCP Apps tool `_meta.ui` resource URI and visibility captured on `tool.execution_start`.Allowed values for the `ToolExecutionStartToolDescriptionMetaUIVisibility` enumeration.Session event "tool_search.activated".Data payload forToolSearchActivatedEvent.Session event "tool.shell_output".Data payload forToolShellOutputEvent.Shell output source.Session event "tool.user_requested".Data payload forToolUserRequestedEvent.Session event "ui.ephemeral_query".Data payload forUiEphemeralQueryEvent.Lifecycle phase for a Rust-owned ephemeral query stream.Fallback for event types not yet known to this SDK version.Ordered accounting identity assigned under the source session's emission lock.Internal prompt-cache expiration state for one modelAccumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals.Usage attributed to one agent instance, including its identity, API duration, AI units, and per-model breakdown.Aggregated code change metricsPer-model usage metrics, including request counts/costs, token usage, nano-AI units, and per-token-type details.Request count and cost metrics for this modelPer-model token-detail entry containing the accumulated token count for one token type.Token usage metrics for this modelUsage for one recorded provider and model, without merging identical model IDs across providers.Session-wide token-detail entry containing the accumulated token count for one token type.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.Output verbosity level used for supported model calls (e.g.Session event "workflow.run_settled".Data payload forWorkflowRunSettledEvent.Terminal status a workflow run committed.Session event "workflow.run_started".Data payload forWorkflowRunStartedEvent.Session event "workflow.run_updated".Data payload forWorkflowRunUpdatedEvent.Working directory and git context at session startHosting platform type of the repository (github or ado)Whether the file was newly created or updated