4349
4350
this._register(wrapper.onUserMessage(e => {
4351
>
this._logService.trace(`[Copilot:${sessionId}] User message: ${e.data.content.length} chars, ${e.data.attachments?.length ?? 0} attachments`);
copilotAgentSession.ts
4352
>
// Restricted `conversation.messageText` (source=user): the raw user prompt text. Emit only
4353
>
// for genuine human prompts on the main agent — skip subagent turns (driven by the parent)
4354
>
// and SDK-injected synthetic messages (skill/harness injections carry a non-`user` source,
4355
>
// matching `isSyntheticUserMessage`) so injected content is not reported as the user's prompt.
4356
>
if (!e.agentId && (!e.data.source || e.data.source.toLowerCase() === 'user')) {
4357
this._telemetryReporter.userMessageText(this.sessionUri.toString(), e.data.content, this._turnOrdinal);
4358
}