Documentation Index
Fetch the complete documentation index at: https://avocadostudioai.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Chat Telemetry Events
This document is the source-of-truth reference for telemetry events emitted by the orchestrator chat pipeline.Scope
This covers events pushed viactx.chatTelemetry.push(...) in:
apps/orchestrator/src/chat/chat-pipeline.ts
apps/orchestrator/src/telemetry/chat-telemetry.ts
chat_pipeline_start or image rewrite logs.
Event Transport
Each telemetry entry is:- Buffered in memory.
- Optionally persisted as NDJSON.
- Emitted to server logs as a structured log with
event: "chat_telemetry".
CHAT_TELEMETRY_FILEor../../.data/chat-telemetry.ndjson
Event Schema
Fields fromChatTelemetryEntry:
- Required:
id,at,phase,session,requestedSlug,effectiveSlug,plannerSource,modelKey,modelUsed,promptHash,promptExcerpt,promptLength - Optional classification:
outcome,reason,reasonCategory - Optional plan shape:
intent,opCount,opTypes - Optional usage/cost:
inputTokens,outputTokens,totalTokens,cacheReadInputTokens,cacheCreationInputTokens,estimatedUsd - Optional timing:
totalDurationMs,planningDurationMs,firstPlanningTokenMs,applyDurationMs,imageResolutionDurationMs,planningAttempts
reasonCategory values are from guardrail classification:
schema_violationambiguitynot_foundno_effective_changeinternal_error
Phases
phase is one of:
receivedmilestoneforced_plandeterministic_plan_generatedplan_attempt_failedplan_generatedplan_apply_failedrepair_attemptrepair_generatedtool_callresult
Outcomes
Emitted telemetry outcomes (chatTelemetry.push)
guardrail_failureneeds_clarificationplan_ready_for_approvalno_effective_changeappliedapply_failedapply_pending_plan_errorforced_duplicate_pageforced_create_pageplanner_exceptiondeterministic_plan_readycompound_deterministic_plan_readyattempt_${attempt}_failed(dynamic, e.g.attempt_1_failed)planning_exhaustedplanning_missingplanning_refusalplanning_incompleterepair_startedrepair_plan_generatedrepair_failedcontent_answervariation_request_redirectblocked_structural_capabilityllm_router_plan_readyllm_router_needs_clarificationtool_oktool_errorapi_error
Debug-only outcomes (response payload, not telemetry rows)
validation_errorpending_plan_missingpending_plan_mismatchinfoadvice
Phase to Outcome Mapping
Common mappings in current implementation:received: nooutcomeforced_plan:forced_duplicate_page,forced_create_pagedeterministic_plan_generated:deterministic_plan_readyplan_attempt_failed:attempt_${attempt}_failedplan_generated: usually nooutcome(plan metadata + optional usage)plan_apply_failed:apply_failedrepair_attempt:repair_startedrepair_generated:repair_plan_generatedresult: terminal or branch outcomes such asapplied,needs_clarification,planning_exhausted,repair_failed, etc.
Telemetry APIs
List entries:GET /telemetry/chat?limit=<n>&outcome=<outcome>&phase=<phase>&session=<session>
GET /telemetry/chat/review?limit=<n>&session=<session>
/telemetry/chat/review currently treats these as failure outcomes:
guardrail_failureapply_failedrepair_failedplanner_exceptionplanning_exhaustedplanning_missingplanning_refusalplanning_incomplete
Cache Metrics
Cache-related fields:cacheReadInputTokenscacheCreationInputTokens
- OpenAI:
cacheReadInputTokensmaps tocached_tokens(from usage details) - Anthropic:
cacheReadInputTokensmaps tocache_read_input_tokens;cacheCreationInputTokensmaps tocache_creation_input_tokens
Source References
apps/orchestrator/src/telemetry/chat-telemetry.tsapps/orchestrator/src/chat/chat-pipeline.tsapps/orchestrator/src/index.ts(telemetry endpoints)