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

Function getWebCodexThreadDetail

apps/web/lib/server/queries.ts:774–809  ·  view source on GitHub ↗
(threadId: string)

Source from the content-addressed store, hash-verified

772}
773
774export async function getWebCodexThreadDetail(threadId: string): Promise<WebCodexThreadDetail | null> {
775 const threadList = await listWebCodexThreads();
776 const thread = threadList.find((entry) => entry.threadId === threadId);
777 if (!thread) {
778 return null;
779 }
780
781 const allSessions = await listWebSessions();
782 const linkedSessions = allSessions
783 .filter((session) => session.providerKind === 'openai-native' && session.codexThreadId === threadId)
784 .sort((left, right) => right.updatedAt - left.updatedAt);
785
786 const bindings = getStoredPlatformBindings().filter((binding) =>
787 linkedSessions.some((session) => session.id === binding.bridgeSessionId),
788 );
789 const automations = listWebAutomationsSync().filter((job) =>
790 linkedSessions.some((session) => session.id === job.bridgeSessionId),
791 );
792 const bindingScopes = new Set(bindings.map((binding) => `${binding.platform}:${binding.externalScopeId}`));
793 const relatedRecords = getStoredAssistantRecords()
794 .filter((record) => {
795 const scopeKey = record.platform && record.scopeId ? `${record.platform}:${record.scopeId}` : null;
796 return record.contextThreadId === threadId || (scopeKey ? bindingScopes.has(scopeKey) : false);
797 })
798 .sort((left, right) => right.updatedAt - left.updatedAt)
799 .slice(0, 8)
800 .map((record) => summarizeAssistantRecord(record));
801
802 return {
803 thread,
804 linkedSessions,
805 bindings,
806 automations,
807 relatedRecords,
808 };
809}
810
811export async function getWebCodexThreadSettings(
812 threadId: string,

Callers 2

CodexThreadDetailPageFunction · 0.90

Calls 7

listWebCodexThreadsFunction · 0.85
listWebSessionsFunction · 0.85
listWebAutomationsSyncFunction · 0.85
summarizeAssistantRecordFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected