MCPcopy Create free account
hub / github.com/tiann/hapi / extractCallId

Function extractCallId

cli/src/codex/utils/codexEventConverter.ts:99–116  ·  view source on GitHub ↗
(payload: Record<string, unknown>)

Source from the content-addressed store, hash-verified

97}
98
99function extractCallId(payload: Record<string, unknown>): string | null {
100 const candidates = [
101 'call_id',
102 'callId',
103 'tool_call_id',
104 'toolCallId',
105 'id'
106 ];
107
108 for (const key of candidates) {
109 const value = payload[key];
110 if (typeof value === 'string' && value.length > 0) {
111 return value;
112 }
113 }
114
115 return null;
116}
117
118export function convertCodexEvent(rawEvent: unknown): CodexConversionResult | null {
119 const parsed = CodexSessionEventSchema.safeParse(rawEvent);

Callers 1

convertCodexEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected