fix: include trace id in stdio kafka events

This commit is contained in:
root
2026-07-09 22:59:33 +02:00
parent ec277d96a6
commit 87f11f34fa
+2 -1
View File
@@ -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,