emit tool call starting event for better observability of long-running terminal commands
Open
- 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
Assessment
This issue has not been assessed yet.