MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / extractThreadIdFromNotification

Function extractThreadIdFromNotification

src/providers/codex/app_client.ts:2989–3010  ·  view source on GitHub ↗
(message: any)

Source from the content-addressed store, hash-verified

2987}
2988
2989function extractThreadIdFromNotification(message: any): string | null {
2990 const params = message?.params ?? null;
2991 if (typeof params?.threadId === 'string') {
2992 return params.threadId;
2993 }
2994 if (typeof params?.thread_id === 'string') {
2995 return params.thread_id;
2996 }
2997 if (typeof params?.conversationId === 'string') {
2998 return params.conversationId;
2999 }
3000 if (typeof params?.item?.threadId === 'string') {
3001 return params.item.threadId;
3002 }
3003 if (typeof params?.thread?.id === 'string') {
3004 return params.thread.id;
3005 }
3006 if (typeof params?.event?.threadId === 'string') {
3007 return params.event.threadId;
3008 }
3009 return null;
3010}
3011
3012function extractCompactedThreadIds(message: any): {
3013 sourceThreadId: string | null;

Calls

no outgoing calls

Tested by

no test coverage detected