Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* Who produced the message that started a turn. Extends the protocol's
* {@link MessageKind} with `agentMerge`: Agent Merge drives its repair turns
* with a host-generated message that carries the `systemNotification` origin,
* and reporting those under their own value keeps automated merge work
* separable from turns a person or an agent asked for.
*/
export
type
AgentHostMessageOriginTelemetryKind
=
|
'agentMerge'
;
/** Classifies the actor that produced a turn's message for telemetry. */
export
function
getMessageOriginTelemetryKind
(
:
)
:
{
// The marker only counts on the origin the host stamps it with, so a client
// cannot dress a user message up as automated merge work.
if
(
.
.
===
.
&&
isAgentMergeMessage
(
)
)
{
return
'agentMerge'
;
}
return
.
.
;
}
export
interface
IAgentHostInitiatorTelemetry
{
?
:
;
?
:
;
?
:
;
?
:
;
?
:
string
;
?
:
string
;
}
export
type
IAgentHostInitiatorClassification
=
{
?
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The type of VS Code client that initiated the event.'
}
;
?
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The route the initiating client used to reach the agent host.'
}
;
?
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The physical transport on which the agent host received the initiating client action.'
}
;
?
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Whether the agent host process was launched by the VS Code main process or VS Code CLI.'
}
;
?
:
{
:
'EndUserPseudonymizedInformation'
;
:
'FeatureInsight'
;
:
'MacAddressHash'
;
:
'The machine identifier of the VS Code client that initiated the event.'
}
;
?
:
{
:
'EndUserPseudonymizedInformation'
;
:
'BusinessInsight'
;
:
'SqmMachineId'
;
:
'The development device identifier of the VS Code client that initiated the event.'
}
;
}
;
export
interface
IAgentHostExecutionModeChangedEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
string
;
:
boolean
;
:
;
:
;
:
number
;
}
export
type
IAgentHostExecutionModeChangedClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The provider handling the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the mode change belongs to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The previous agent host execution mode.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The new agent host execution mode.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Number of completed turns in the agent host chat.'
}
;
:
'amunger'
;
:
'Reports agent host execution mode changes.'
;
}
;
export
interface
IAgentHostUserMessageSentEvent
{
:
string
;
:
;
:
string
|
undefined
;
:
;
:
;
:
;
?
:
string
;
?
:
string
;
:
string
;
:
;
:
;
:
boolean
;
:
number
;
?
:
string
;
?
:
number
;
?
:
number
;
:
number
;
}
export
type
IAgentHostUserMessageSentClassification
=
{
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The provider handling the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Whether the agent host process was launched by the VS Code main process or VS Code CLI.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The opaque AHP client identifier that initiated the message.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The type of AHP client that initiated the message.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The route the initiating client declared it used to reach the agent host.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The physical transport on which the agent host received the initiating client action.'
}
;
?
:
{
:
'EndUserPseudonymizedInformation'
;
:
'FeatureInsight'
;
:
'MacAddressHash'
;
:
'The initiating VS Code client machine identifier.'
}
;
?
:
{
:
'EndUserPseudonymizedInformation'
;
:
'BusinessInsight'
;
:
'SqmMachineId'
;
:
'The initiating VS Code client development device identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Whether the message was sent directly or from the queued-message flow.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The kind of actor that produced the message: a user, an agent (session orchestration tools such as create_session/send_message), Agent Merge, a tool, an automation, or a system notification.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the message was sent to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of completed turns in the session when the message was sent.'
}
;
?
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The identifier of the first active client for the session, if any.'
}
;
?
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The total number of tools provided by the active clients, if any.'
}
;
?
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The total number of customizations provided by the active clients, if any.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of attachments included with the message.'
}
;
:
'roblourens'
;
:
'Tracks messages sent from the agent host process to an agent provider, including which kind of actor produced them.'
;
}
;
export
type
AgentHostClientConnectionAction
=
'connected'
|
'disconnected'
;
export
interface
IAgentHostClientConnectionEvent
{
:
;
:
;
:
string
;
:
;
:
string
|
undefined
;
:
string
|
undefined
;
:
;
:
;
?
:
string
;
?
:
string
;
:
string
;
:
boolean
;
:
number
;
:
number
;
:
number
;
:
number
|
undefined
;
:
number
|
undefined
;
}
export
type
IAgentHostClientConnectionClassification
=
{
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Whether an initialized AHP client transport connected or disconnected.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Whether the agent host process was launched by the VS Code main process or VS Code CLI.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The opaque AHP client identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The bounded type of the connected AHP client.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The implementation name declared by the AHP client.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The implementation version declared by the AHP client.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The route the client declared it used to reach the agent host.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The physical transport accepted by the agent host.'
}
;
?
:
{
:
'EndUserPseudonymizedInformation'
;
:
'FeatureInsight'
;
:
'MacAddressHash'
;
:
'The connected VS Code client machine identifier.'
}
;
?
:
{
:
'EndUserPseudonymizedInformation'
;
:
'BusinessInsight'
;
:
'SqmMachineId'
;
:
'The connected VS Code client development device identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The negotiated AHP protocol version.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether this client identifier was previously known to the agent host.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of logical AHP clients with at least one live transport after this lifecycle change.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The total number of live initialized AHP transports after this lifecycle change.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of live initialized transports for this client after this lifecycle change.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'The duration of the disconnected transport in milliseconds.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of protocol subscriptions held by the client transport when it disconnected.'
}
;
:
'roblourens'
;
:
'Tracks initialized Agent Host client connection topology and lifecycle.'
;
}
;
export
interface
IAgentHostClientConnectionReport
{
:
;
:
;
:
string
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
;
:
boolean
;
:
number
;
:
number
;
:
number
;
?
:
number
;
?
:
number
;
}
export
type
AgentHostTurnResult
=
'success'
|
'error'
|
'cancelled'
;
export
type
AgentHostModelTelemetryKind
=
'trusted'
|
'byok'
|
'unknown'
;
type
AgentHostModelSelectionKind
=
'default'
|
'auto'
|
'explicit'
;
export
type
{
}
;
export
type
AgentHostInitiatorClientConnectionState
=
'connected'
|
'disconnected'
|
'unknown'
;
export
type
AgentHostProviderDiagnosticState
=
'available'
|
'error'
|
'missingChat'
|
'missingTurn'
|
'unavailable'
|
'unsupported'
;
interface
IAgentHostTurnAttributedReport
{
?
:
;
}
export
interface
IAgentHostTurnCompletedEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
string
;
:
string
;
:
boolean
;
:
string
;
:
string
|
undefined
;
:
string
|
undefined
;
:
number
|
undefined
;
:
number
;
:
;
:
string
|
<
string
>
|
undefined
;
:
;
:
boolean
|
undefined
;
:
string
|
undefined
;
:
|
undefined
;
:
|
undefined
;
:
string
|
undefined
;
:
|
undefined
;
:
boolean
;
:
number
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
;
}
export
type
IAgentHostTurnCompletedClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The provider handling the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The chat identifier within the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the turn belongs to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The identifier of the turn within the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The immediate parent turn identifier for a subagent turn.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The identifier of the tool call that spawned the subagent owning this turn; stable across resumed turns of the same subagent.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Time in milliseconds from turn start to the first visible progress (text delta, response part, tool call start, or reasoning).'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Total time in milliseconds from turn start to turn completion.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Whether the turn completed successfully, with an error, or was cancelled.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The trusted provider model identifier selected at turn start, or a generic value for BYOK and unknown models.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Whether the client used the provider default, Auto, or an explicit model.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the selected model is a bring-your-own-key model, when model context is available.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The tool auto-approval level configured for the session at turn start (e.g. default, autoApprove, autopilot).'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The agent host interaction mode configured at turn start.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The kind of actor that started the turn: a user, an agent (session orchestration tools such as create_session/create_chat/send_message), Agent Merge, a tool, an automation, or a system notification.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The structured agent host or provider error type when the turn fails.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The bounded stage at which the agent host turn failed.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the session spans more than one working directory.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of effective working directories for the session at turn completion.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The AI credit usage billed for the turn in nano-AIU, when reported by the provider.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Input tokens used directly by this turn, excluding descendant sub-agent calls.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Input tokens read from cache directly by this turn, excluding descendant sub-agent calls.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Output tokens generated directly by this turn, excluding descendant sub-agent calls.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'AI credit usage billed directly to this turn in nano-AIU, excluding descendant sub-agent calls.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of completed upstream model responses attributed directly to this turn, excluding descendant sub-agent calls.'
}
;
:
'roblourens'
;
:
'Tracks agent host turn completion, including performance, configuration context, completed model responses, and billed AI credit usage when reported by the provider.'
;
}
;
export
interface
IAgentHostTurnFailedEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
string
;
:
string
;
:
boolean
;
:
string
;
:
;
:
string
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
;
:
string
|
undefined
;
}
export
type
IAgentHostTurnFailedClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The provider handling the failed agent host turn.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The chat identifier within the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Whether the failed turn belongs to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The identifier of the failed turn within the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The bounded stage at which the agent host turn failed.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The structured agent host or provider error type.'
}
;
:
{
:
'CallstackOrException'
;
:
'PerformanceAndHealth'
;
:
'The name of the exception, when available.'
}
;
:
{
:
'CallstackOrException'
;
:
'PerformanceAndHealth'
;
:
'The exception or protocol error code, when available.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The GitHub provider request identifier, when available.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The Copilot service request identifier, when available.'
}
;
:
{
:
'CallstackOrException'
;
:
'PerformanceAndHealth'
;
:
'The error message. VS Code telemetry scrubs file paths and likely secrets before transmission.'
}
;
:
{
:
'CallstackOrException'
;
:
'PerformanceAndHealth'
;
:
'The error stack. VS Code telemetry scrubs file paths and likely secrets before transmission.'
}
;
:
'roblourens'
;
:
'Captures diagnostic details for failed agent host turns.'
;
}
;
export
interface
IAgentHostTurnFailure
{
:
;
:
;
?
:
string
;
?
:
string
;
?
:
string
;
}
export
interface
IAgentHostTurnCompletedReport
extends
IAgentHostTurnAttributedReport
{
:
string
;
:
string
;
:
string
;
:
string
|
undefined
;
:
string
|
undefined
;
:
number
|
undefined
;
:
number
;
:
;
:
string
|
undefined
;
:
|
undefined
;
:
;
:
string
|
undefined
;
:
|
undefined
;
:
|
undefined
;
:
|
undefined
;
:
boolean
;
:
number
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
;
}
/**
* Why a turn was quiet when the hang watchdog fired.
*
* Unexpected (these are real bugs and are what dashboards should alert on):
* - `noProgress`: the turn started but literally nothing was ever observed for
* it — no text, no reasoning, no tool call, no error, no completion. This is
* the signature of a lost turn (e.g. a dropped provider callback
* registration) where the UI sits on "Working…" forever.
* - `stalledAfterProgress`: the turn made progress and then went quiet without
* anything outstanding to explain the silence.
*
* Expected (the turn is legitimately waiting; reported so the two populations
* can be told apart in queries rather than silently dropped):
* - `waitingOnUser`: a request that blocks on a *human* is outstanding — a
* tool confirmation, a tool authentication, or an elicitation. Client tool
* execution is deliberately excluded: it is delegated running work rather
* than a prompt, and is reported as `runningTool` instead.
* - `runningTool`: a tool call is still in flight. Covers genuinely long tool
* invocations (builds, test runs), client-executed tools, and subagents,
* whose work is reported on the subagent's own chat channel rather than the
* parent turn's.
*/
export
type
AgentHostTurnHangReason
=
'noProgress'
|
'stalledAfterProgress'
|
'waitingOnUser'
|
'runningTool'
;
const
=
{
[
.
]
:
'chat.turnStarted'
,
[
.
]
:
'chat.delta'
,
[
.
]
:
'chat.responsePart'
,
[
.
]
:
'chat.toolCallStart'
,
[
.
]
:
'chat.toolCallDelta'
,
[
.
]
:
'chat.toolCallReady'
,
[
.
]
:
'chat.toolCallConfirmed'
,
[
.
]
:
'chat.toolCallComplete'
,
[
.
]
:
'chat.toolCallResultConfirmed'
,
[
.
]
:
'chat.toolCallContentChanged'
,
[
.
]
:
'chat.toolCallAuthRequired'
,
[
.
]
:
'chat.toolCallAuthResolved'
,
[
.
]
:
'chat.turnComplete'
,
[
.
]
:
'chat.turnCancelled'
,
[
.
]
:
'chat.error'
,
[
.
]
:
'chat.activityChanged'
,
[
.
]
:
'chat.workingDirectorySet'
,
[
.
]
:
'chat.workingDirectoryRemoved'
,
[
.
]
:
'chat.usage'
,
[
.
]
:
'chat.reasoning'
,
[
.
]
:
'chat.pendingMessageSet'
,
[
.
]
:
'chat.pendingMessageRemoved'
,
[
.
]
:
'chat.queuedMessagesReordered'
,
[
.
]
:
'chat.draftChanged'
,
[
.
]
:
'chat.inputRequested'
,
[
.
]
:
'chat.inputAnswerChanged'
,
[
.
]
:
'chat.inputCompleted'
,
[
.
]
:
'chat.truncated'
,
[
.
]
:
'chat.turnsLoaded'
,
[
.
]
:
'session.inputNeededSet'
,
[
.
]
:
'session.inputNeededRemoved'
,
}
as
const
;
export
type
AgentHostTurnActivityTelemetryKind
=
'none'
|
'other'
|
typeof
[
keyof
typeof
]
;
function
normalizeTurnActivityKind
(
:
string
)
:
{
if
(
===
'none'
)
{
return
'none'
;
}
return
[
as
keyof
typeof
]
??
'other'
;
}
export
interface
IAgentHostTurnHungEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
string
;
:
string
;
:
boolean
;
:
string
;
:
;
:
boolean
;
:
boolean
;
:
;
:
;
:
;
?
:
;
?
:
boolean
;
?
:
;
:
;
:
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
number
;
:
number
;
:
number
;
:
string
|
<
string
>
|
undefined
;
:
;
:
string
|
undefined
;
}
export
type
IAgentHostTurnHungClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The provider handling the hung agent host turn.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The chat identifier within the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Whether the hung turn belongs to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The identifier of the hung turn within the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The bounded state the turn was quiet in: noProgress, stalledAfterProgress, waitingOnUser, or runningTool.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Whether the quiet period is explained by a legitimate wait (blocked on the user or running a tool) rather than an unexplained hang.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Whether any turn activity at all was observed before the watchdog fired.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'A bounded category for the last observed turn activity, preserving the AHP action namespace and action name without slash-like syntax. Values are none, other, or categories such as chat.delta and chat.toolCallReady.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The bounded turn stage active when the hang watchdog fired.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether bounded provider diagnostics were available, unsupported, unavailable, failed, or missing the expected chat or turn.'
}
;
?
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the provider call had not started, was pending, resolved, or rejected when the hang watchdog fired.'
}
;
?
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Whether the provider reported that its turn started before the hang watchdog fired.'
}
;
?
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The bounded provider session state when the hang watchdog fired.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the client that initiated the turn was still connected when the hang watchdog fired, or unknown when the client could not be identified.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The kind of outstanding user-blocking session input request, when there is one. Client tool execution is not counted, since it is delegated work rather than a prompt.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The identifier of the tool the turn appears to be stuck on. When hangReason is waitingOnUser this is the tool gated by the blocking request, which is exact; when it is runningTool this is the longest-running in-flight tool call, which is a best guess when several are running. Undefined when no tool explains the hang.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the stuck tool is provided by the agent host, an MCP server, or a client.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Number of tool calls that had started but not completed when the watchdog fired. When hangReason is runningTool, a value above one means toolId is a best guess among several running tools; when it is waitingOnUser, toolId comes from the blocking request and is exact regardless of this count.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Time in milliseconds since the last observed turn activity.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Time in milliseconds from turn start to the hang report.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The trusted provider model identifier for the turn, or a generic value for BYOK and unknown models.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the client used the provider default, Auto, or an explicit model.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The tool auto-approval level configured for the session at turn start (e.g. default, autoApprove, autopilot).'
}
;
:
'roblourens'
;
:
'Tracks agent host turns that stop making progress for longer than the hang threshold, so permanently stuck sessions are visible as a positive signal instead of missing turnCompleted events.'
;
}
;
export
interface
IAgentHostTurnHungReport
extends
IAgentHostTurnAttributedReport
{
:
string
;
:
string
;
:
string
;
:
;
:
boolean
;
:
string
;
:
;
:
;
:
|
undefined
;
:
;
:
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
number
;
:
number
;
:
number
;
:
string
|
undefined
;
:
|
undefined
;
:
;
:
string
|
undefined
;
}
export
interface
IAgentHostHungTurnCompletedEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
string
;
:
string
;
:
boolean
;
:
string
;
:
;
:
;
:
number
;
:
number
;
:
number
;
}
export
type
IAgentHostHungTurnCompletedClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The provider handling the recovered agent host turn.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The chat identifier within the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Whether the recovered turn belongs to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The identifier of the recovered turn within the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The most recently reported hang reason for the turn before it completed.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the previously hung turn eventually completed successfully, with an error, or was cancelled.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Number of hang reports emitted for the turn before it completed.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Total time in milliseconds from turn start to turn completion.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Time in milliseconds from the most recent hang report to turn completion.'
}
;
:
'roblourens'
;
:
'Tracks agent host turns that complete after previously being reported as hung, so permanent hangs can be separated from merely slow ones.'
;
}
;
export
interface
IAgentHostHungTurnCompletedReport
extends
IAgentHostTurnAttributedReport
{
:
string
;
:
string
;
:
string
;
:
;
:
;
:
number
;
:
number
;
:
number
;
}
export
interface
IAgentHostToolInvokedReport
extends
IAgentHostTurnAttributedReport
{
:
string
;
:
string
;
:
string
;
:
string
;
:
string
;
:
string
;
:
;
?
:
number
;
:
number
;
:
string
|
undefined
;
:
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
}
export
type
IAgentHostToolInvokedEvent
=
&
&
{
:
string
;
:
string
;
:
string
;
:
boolean
;
:
string
|
undefined
;
:
string
|
undefined
;
}
;
export
type
IAgentHostToolInvokedClassification
=
<
,
'provider'
|
'chatSessionId'
|
'owner'
|
'comment'
>
&
&
{
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The Agent Host provider that invoked the tool.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The Agent Host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The chat identifier within the Agent Host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the tool call belongs to a subagent session.'
}
;
:
{
:
'CallstackOrException'
;
:
'PerformanceAndHealth'
;
:
'The tool failure code, when available.'
}
;
:
{
:
'CallstackOrException'
;
:
'PerformanceAndHealth'
;
:
'The tool failure message, when available. VS Code telemetry scrubs file paths and likely secrets before transmission.'
}
;
:
'roblourens'
;
:
'Tracks Agent Host tool invocations with Agent Host correlation and optional failure diagnostics.'
;
}
;
export
interface
IAgentHostAskQuestionsToolInvokedEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
number
;
:
number
;
:
number
;
:
number
;
:
number
;
:
number
;
:
number
;
:
string
;
:
string
;
:
boolean
;
}
export
type
IAgentHostAskQuestionsToolInvokedClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The id of the current request turn.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The total number of questions asked'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of questions that were answered'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of questions that were skipped'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of questions answered with free text input'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of questions that had a recommended option'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of questions where the user selected the recommended option'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'The total time in milliseconds to complete all questions'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The provider handling the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the questions belong to a subagent session.'
}
;
:
'digitarald'
;
:
'Tracks usage of the AskQuestions tool for agent clarifications'
;
}
;
export
interface
IAgentHostAskQuestionsToolInvokedReport
extends
IAgentHostTurnAttributedReport
{
:
string
;
:
string
;
:
string
;
:
number
;
:
number
;
:
number
;
:
number
;
:
number
;
:
number
;
:
number
;
}
type
AgentHostToolCallResponseType
=
'success'
|
'cancelled'
|
'failed'
;
export
interface
IAgentHostToolCallDetailsEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
string
;
:
boolean
;
:
string
;
:
string
;
:
;
:
string
;
:
string
|
undefined
;
:
number
;
:
number
;
:
number
;
:
number
|
undefined
;
:
number
;
:
number
;
:
number
;
:
number
;
}
export
type
IAgentHostToolCallDetailsClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The provider handling the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the tool-call aggregate belongs to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The identifier of the current chat conversation.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The identifier of the current turn request.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Whether the turn completed successfully, was cancelled, or failed.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The number of times each tool was requested during the turn.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The model used for the final model call in the turn, when known.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of model-call rounds in the turn.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The zero-based turn ordinal within the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'The elapsed time in milliseconds for the turn.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of characters in the user message, when known.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of tools offered to the model.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The total number of tool calls requested during the turn.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of model-call rounds containing multiple tool calls.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'The number of tool calls belonging to parallel tool-call rounds.'
}
;
:
'roblourens'
;
:
'Records aggregate information about tool calls during an agent host turn.'
;
}
;
export
interface
IAgentHostToolCallDetailsReport
extends
IAgentHostTurnAttributedReport
{
:
string
;
:
string
;
:
string
;
:
;
:
string
|
undefined
;
:
;
/** Count of invocations keyed by tool name, across all rounds in the turn. */
:
<
string
,
number
>
;
/** Names of the tools offered to the model for this turn. */
:
readonly
string
[
]
;
/** Number of model-call rounds in the turn, including the final tool-free response round (matches the extension's `toolCallRounds.length`). */
:
number
;
:
number
;
:
number
;
:
number
|
undefined
;
:
number
;
:
number
;
:
number
;
}
export
interface
IAgentHostToolApprovalReport
extends
IAgentHostTurnAttributedReport
{
:
string
;
:
string
;
:
string
;
:
string
;
:
string
;
:
;
:
string
|
undefined
;
:
boolean
|
undefined
;
}
type
AgentHostToolApprovalConfirmKind
=
'userAction'
|
'setting'
|
'confirmationNotNeeded'
|
'denied'
;
export
interface
IAgentHostToolApprovalEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
string
;
:
boolean
;
:
string
;
:
string
;
:
string
;
:
string
|
undefined
;
:
string
;
:
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
boolean
|
undefined
;
:
boolean
|
undefined
;
}
export
type
IAgentHostToolApprovalClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The provider handling the agent host session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the tool approval belongs to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The ID of the chat session that the tool was used within, if applicable.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The ID of the chat request turn that this tool approval is associated with, if available.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The ID of the tool used.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The extension that contributed the tool.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'The source kind of the tool.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'How the confirmation was resolved (userAction, setting, confirmationNotNeeded, denied).'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'When confirmKind is setting, the configuration id that auto-approved the tool.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'When confirmKind is lmServicePerTool, the scope (session/workspace/profile).'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'When the user clicked a custom button on the confirmation widget, whether the button represents approve or deny semantics.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'When confirmKind is confirmationNotNeeded, a stable identifier for why the tool did not require confirmation.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'For terminal tool calls, whether this specific invocation runs inside the agent terminal sandbox.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'For terminal tool calls, whether the model requested to bypass the sandbox for this invocation.'
}
;
:
'roblourens'
;
:
'Provides insight into how tool confirmations are resolved (user action vs. auto-approval) in agent host sessions.'
;
}
;
export
interface
IAgentHostAutoModeRouterDecisionReport
{
:
string
;
:
string
;
:
;
:
string
;
:
string
|
undefined
;
:
number
|
undefined
;
:
readonly
string
[
]
|
undefined
;
:
<
<
string
,
number
|
undefined
>>
|
undefined
;
:
string
|
undefined
;
:
readonly
string
[
]
|
undefined
;
:
boolean
|
undefined
;
:
string
|
undefined
;
:
boolean
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
:
boolean
|
undefined
;
}
export
interface
IAgentHostSkillContentReadReport
{
:
;
/** The skill name. */
:
string
;
/** Path to the SKILL.md file. */
:
string
;
/** Full skill content; hashed (never sent raw), matching the extension. */
:
string
;
/** Where the skill was discovered (project, personal-copilot, plugin, builtin, …). */
:
string
|
undefined
;
/** Name of the plugin the skill came from, when applicable (AH-native analog of the extension's skill extension id). */
:
string
|
undefined
;
/** Version of the plugin the skill came from, when applicable. */
:
string
|
undefined
;
}
export
type
AgentHostRepoInfoResult
=
'success'
|
'filesChanged'
|
'diffTooLarge'
|
'noChanges'
|
'tooManyChanges'
|
'mergeBaseTooOld'
|
'virtualFileSystem'
|
'tooManyCommits'
;
export
interface
IAgentHostRepoInfoReport
{
:
string
;
:
;
:
'begin'
|
'end'
;
:
string
;
:
string
;
:
'github'
|
'ado'
;
:
string
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
;
:
'true'
;
:
number
;
:
number
;
:
number
;
}
export
interface
IAgentHostToolCallStalledEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
string
;
:
boolean
;
:
.
|
.
|
.
;
:
string
;
:
string
;
:
number
;
}
export
type
IAgentHostToolCallStalledClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The provider handling the stalled agent host tool call.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Whether the stalled tool call belongs to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the tool call is waiting for confirmation or client execution.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The identifier of the stalled tool.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the stalled tool is provided by the agent host, an MCP server, or a client.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Time in milliseconds that the tool call has remained blocked.'
}
;
:
'roblourens'
;
:
'Tracks agent host tool calls that remain blocked beyond the stall threshold.'
;
}
;
export
interface
IAgentHostToolCallStalledReport
extends
IAgentHostTurnAttributedReport
{
:
string
;
:
string
;
:
.
|
.
|
.
;
:
string
;
:
string
;
:
number
;
}
export
interface
IAgentHostStalledToolCallCompletedEvent
extends
IAgentHostInitiatorTelemetry
{
:
string
;
:
string
;
:
boolean
;
:
.
|
.
|
.
;
:
string
;
:
string
;
:
;
:
number
;
:
number
;
}
export
type
IAgentHostStalledToolCallCompletedClassification
=
&
{
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The provider handling the completed agent host tool call.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The agent host session identifier.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Whether the completed tool call belongs to a subagent session.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the tool call had stalled waiting for confirmation or client execution.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'The identifier of the completed tool.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the completed tool is provided by the agent host, an MCP server, or a client.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
'Whether the stalled tool call eventually completed successfully, with an error, or through user cancellation.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Total time in milliseconds from tool call start to completion.'
}
;
:
{
:
'SystemMetaData'
;
:
'PerformanceAndHealth'
;
:
true
;
:
'Time in milliseconds from the stall report to tool call completion.'
}
;
:
'roblourens'
;
:
'Tracks agent host tool calls that complete after previously exceeding the stall threshold.'
;
}
;
export
interface
IAgentHostStalledToolCallCompletedReport
extends
IAgentHostTurnAttributedReport
{
:
string
;
:
string
;
:
.
|
.
|
.
;
:
string
;
:
string
;
:
;
:
number
;
:
number
;
}
function
toTelemetryModel
(
:
string
|
undefined
,
:
|
undefined
)
:
string
|
<
string
>
|
undefined
{
if
(
===
undefined
)
{
return
undefined
;
}
if
(
===
'trusted'
)
{
return
new
TelemetryTrustedValue
(
)
;
}
return
===
'byok'
?
'byokModel'
:
'unknown'
;
}
export
function
toInitiatorTelemetry
(
:
|
undefined
)
:
{
return
{
...
(
?.
!==
undefined
&&
.
!==
.
?
{
:
.
}
:
{
}
)
,
...
(
?.
!==
undefined
&&
.
!==
.
?
{
:
.
}
:
{
}
)
,
...
(
?.
!==
undefined
&&
.
!==
.
?
{
:
.
}
:
{
}
)
,
...
(
?.
!==
undefined
&&
.
!==
.
?
{
:
.
}
:
{
}
)
,
...
(
?.
?
{
:
.
}
:
{
}
)
,
...
(
?.
?
{
:
.
}
:
{
}
)
,
}
;
}
export
const
=
createDecorator<AgentHostTelemetryReporter>
(
'agentHostTelemetryReporter'
)
;
export
class
AgentHostTelemetryReporter
{
declare
readonly
:
undefined
;
constructor
(
@ITelemetryService
private
readonly
:
)
{
}
/** The restricted GH/MSFT telemetry surface, present when the agent-host telemetry service is wired. */
/**
* Mirrors the Copilot extension's enhanced GH `request.options.tools` event for the agent-host
* flow. The extension emits it per LLM request from its model fetcher; the agent host observes
* the equivalent boundary when an `assistant.message` arrives (one per model call). The
* `headerRequestId` is the client-minted `x-request-id`, matching the extension. `messagesJson`
* is the raw tool definitions offered for the call, multiplexed across ~8192-char chunks like
* the extension, so it lands identically downstream.
*
* @paramsession Session URI string; its id becomes `conversationId`.
* @paramclientRequestId The model call's client-minted `x-request-id`, mapped to the extension's `headerRequestId`. No-ops when absent (e.g. providers that don't surface it).
* @paramtools The tool definitions offered to the model for this call.
*/
async
assistantMessageReceived
(
:
string
,
:
,
:
string
|
undefined
,
:
readonly
[
]
)
:
Promise
<
void
>
{
const
=
this
.
;
if
(
!
||
!
||
.
===
0
)
{
return
;
}
.
sendEnhancedGHTelemetryEvent
(
'request.options.tools'
,
await
multiplexProperties
(
{
:
,
:
.
id
(
)
,
:
,
:
JSON
.
stringify
(
)
,
}
)
)
;
}
/**
* Mirrors the Copilot extension's restricted `conversation.messageText` event (the panel-chat
* prefix of `sendConversationalMessageTelemetry`) for the user's prompt. The extension emits it
* for every user and model message, carrying the raw message text to the enhanced GH
* (`copilot_v0_restricted_copilot_event`) and internal MSFT pipelines; the agent host observes
* the same boundary at the SDK `user.message` event. The text is multiplexed across ~8192-char
* chunks (`messageText`, `messageText_02`, …) so long prompts land untruncated, matching the
* extension's `multiplexProperties`.
*
* @paramsession Session URI string; its id becomes `conversationId`.
* @paramcontent The user's prompt text. No-ops when empty.
* @paramturnIndex The 0-based ordinal of the turn this message belongs to, matching the extension's numeric `turnIndex` (`conversation.turns.length`). CTS parses `turn_index` as an integer, so a numeric ordinal is required here (a non-numeric id lands empty).
*/
async
userMessageText
(
:
string
,
:
,
:
string
,
:
number
)
:
Promise
<
void
>
{
const
=
this
.
;
if
(
!
||
!
)
{
return
;
}
const
=
await
multiplexProperties
(
{
:
'user'
,
:
.
id
(
)
,
:
,
:
String
(
)
,
:
,
}
)
;
const
=
{
:
.
}
;
.
sendEnhancedGHTelemetryEvent
(
'conversation.messageText'
,
,
)
;
.
sendInternalMSFTTelemetryEvent
(
'conversation.messageText'
,
,
)
;
}
/**
* The model-message counterpart to {@link userMessageText}. Emitted when an `assistant.message`
* arrives (the agent host's per-model-call boundary), carrying the assistant's response text.
* `headerRequestId` is filled with the model call's client-minted `x-request-id`, matching the
* extension. VS Code-only enrichment dims (code-block languages/counts) are not reconstructed here.
*
* @paramsession Session URI string; its id becomes `conversationId`.
* @paramcontent The assistant's response text. No-ops when empty.
* @paramturnIndex The 0-based ordinal of the turn this message belongs to, matching the extension's numeric `turnIndex` (`conversation.turns.length`). CTS parses `turn_index` as an integer, so a numeric ordinal is required here.
* @paramclientRequestId The model call's client-minted `x-request-id`, mapped to `headerRequestId`.
*/
async
modelMessageText
(
:
string
,
:
,
:
string
,
:
number
,
:
string
|
undefined
)
:
Promise
<
void
>
{
const
=
this
.
;
if
(
!
||
!
)
{
return
;
}
const
=
await
multiplexProperties
(
{
:
'model'
,
:
.
id
(
)
,
:
,
:
String
(
)
,
...
(
?
{
:
}
:
{
}
)
,
:
,
}
)
;
const
=
{
:
.
}
;
.
sendEnhancedGHTelemetryEvent
(
'conversation.messageText'
,
,
)
;
.
sendInternalMSFTTelemetryEvent
(
'conversation.messageText'
,
,
)
;
}
/**
* Emits the local-compatible tool-call aggregate on standard and restricted telemetry channels.
*/
/** Emits the extension's restricted `automode.routerDecisionRestricted` event from authoritative SDK fields. */
autoModeRouterDecision
(
:
)
:
void
{
const
=
this
.
;
if
(
!
)
{
return
;
}
const
=
.
??
{
}
;
const
=
.
!==
undefined
||
.
!==
undefined
;
const
=
.
keys
(
)
.
filter
(
=>
[
]
!==
undefined
)
;
const
=
.
??
[
]
;
const
=
{
:
.
id
(
.
)
,
:
.
,
:
.
,
...
(
.
!==
undefined
?
{
:
.
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
.
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
String
(
.
)
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
.
}
:
{
}
)
,
:
[
0
]
??
''
,
:
.
,
:
JSON
.
stringify
(
)
,
...
(
.
!==
undefined
?
{
:
JSON
.
stringify
(
.
)
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
String
(
.
)
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
String
(
.
)
}
:
{
}
)
,
...
(
.
>
0
?
{
[
?
'binaryScores'
:
'hydraScores'
]
:
JSON
.
stringify
(
)
,
}
:
{
}
)
,
}
;
const
=
{
...
(
.
!==
undefined
?
{
:
.
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
.
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
.
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
.
?
1
:
0
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
.
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
.
}
:
{
}
)
,
...
(
.
!==
undefined
?
{
:
.
}
:
{
}
)
,
}
;
.
sendEnhancedGHTelemetryEvent
(
'automode.routerDecisionRestricted'
,
,
)
;
}
/**
* Mirrors the Copilot extension's restricted `skillContentRead` event (`skillTelemetry.ts` ->
* `sendSkillContentReadTelemetry`) — records which skill file was loaded into the conversation.
* The extension emits it from the skill/readFile tools; the agent host observes the equivalent
* boundary at the SDK `skill.invoked` event, whose payload already carries the content (hashed
* here, never sent raw), the discovery `source`, and the plugin identity. The extension's
* `skillExtensionId` / `skillExtensionVersion` encode the contributing *VS Code extension*, which
* does not exist in the agent host; the AH-native provenance is the plugin, so `pluginName` /
* `pluginVersion` fill those columns. No-ops when the skill name is empty.
*
* @paramreport The invoked skill's metadata (from the SDK `skill.invoked` payload).
*/
skillContentRead
(
:
)
:
void
{
const
=
this
.
;
if
(
!
||
!
.
)
{
return
;
}
const
=
.
?
String
(
hash
(
.
)
)
:
''
;
const
=
.
??
''
;
// Match the extension: the version is only reported when the (plugin) id is known, so we
// never emit a `skillExtensionVersion` without a corresponding `skillExtensionId`.
/**
* Reports a turn that has stopped producing activity for longer than the
* hang threshold. See {@link AgentHostTurnHangReason} for which reasons are
* expected waits and which indicate a real hang.
*/