microsoft / microsoft/vscode

emit tool call starting event for better observability of long-running terminal commands

Open
#326,024 1 comment 1 reaction 3 assignees Claimed by @zhichli View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

**Problem**
Tool spans in `toolsService.invokeTool` are exported to `agent-traces.db` only after the tool completes. That's because:

`SqliteSpanExporter` is registered as a `BatchSpanProcessor` exporter (see `sqliteSpanExporter.ts`— "writes completed spans into the SQLite store").
`emitToolCallEvent `in genAiEvents.ts takes durationMs, so it can only fire post-completion.

**Proposed change**
Add a `emitToolCallStartedEvent(otel, toolName, toolCallId)` helper next to `emitToolCallEvent` in `genAiEvents.ts`, and call it right after startSpan in `toolsService.invokeTool`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.