MCPcopy Index your code
hub / github.com/openai/codex-plugin-cc / createTurnCaptureState

Function createTurnCaptureState

plugins/codex/scripts/lib/codex.mjs:303–337  ·  view source on GitHub ↗

@returns {TurnCaptureState}

(threadId, options = {})

Source from the content-addressed store, hash-verified

301
302/** @returns {TurnCaptureState} */
303function createTurnCaptureState(threadId, options = {}) {
304 let resolveCompletion;
305 let rejectCompletion;
306 const completion = new Promise((resolve, reject) => {
307 resolveCompletion = resolve;
308 rejectCompletion = reject;
309 });
310
311 return {
312 threadId,
313 rootThreadId: threadId,
314 threadIds: new Set([threadId]),
315 threadTurnIds: new Map(),
316 threadLabels: new Map(),
317 turnId: null,
318 bufferedNotifications: [],
319 completion,
320 resolveCompletion,
321 rejectCompletion,
322 finalTurn: null,
323 completed: false,
324 finalAnswerSeen: false,
325 pendingCollaborations: new Set(),
326 activeSubagentTurns: new Set(),
327 completionTimer: null,
328 lastAgentMessage: "",
329 reviewText: "",
330 reasoningSummary: [],
331 error: null,
332 messages: [],
333 fileChanges: [],
334 commandExecutions: [],
335 onProgress: options.onProgress ?? null
336 };
337}
338
339function clearCompletionTimer(state) {
340 if (state.completionTimer) {

Callers 1

captureTurnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected