diff --git a/src/backend/codex-stdio.ts b/src/backend/codex-stdio.ts index d7bc8e5..dc1e57c 100644 --- a/src/backend/codex-stdio.ts +++ b/src/backend/codex-stdio.ts @@ -8,7 +8,7 @@ import type { BackendEvent, BackendProfile, BackendTurnResult, CommandRecord, Fa import { redactJson, redactText } from "../common/redaction.js"; import { backendProfileSpec } from "../common/backend-profiles.js"; import { boundedTextSummary, commandOutputPayload } from "../common/output.js"; -import { emitAgentRunOtelSpan } from "../common/otel-trace.js"; +import { agentRunBusinessTraceId, emitAgentRunOtelSpan } from "../common/otel-trace.js"; import { agentRunKafkaConfig, publishAgentRunKafkaMessageBestEffort, rawFrameValue, safeText, sha256Hex, type AgentRunKafkaConfig } from "../common/kafka-events.js"; const codexProtocol = "codex-app-server-jsonrpc-stdio"; @@ -457,6 +457,7 @@ function codexStdioKafkaContext(options: CodexStdioTurnOptions): CodexStdioKafka const run = options.otelContext?.run; const command = options.otelContext?.command; return { + traceId: agentRunBusinessTraceId(run, command), runId: run?.id ?? null, commandId: command?.id ?? null, attemptId: safeText(options.otelContext?.attemptId) ?? null,