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

Method compactThread

test/core/bridge_coordinator.test.ts:428–454  ·  view source on GitHub ↗
({ providerProfile, threadId, onTurnStarted = null })

Source from the content-addressed store, hash-verified

426 return true;
427 }
428 async compactThread({ providerProfile, threadId, onTurnStarted = null }) {
429 this.compactThreadCalls.push({ providerProfile, threadId });
430 const existingThread = this.threads.get(threadId);
431 if (!existingThread) {
432 throw new Error(`thread not found: ${threadId}`);
433 }
434 const turnId = `${threadId}-compact-${this.compactThreadCalls.length}`;
435 if (typeof onTurnStarted === 'function') {
436 await onTurnStarted({
437 turnId,
438 threadId,
439 });
440 }
441 this.threads.set(threadId, {
442 ...existingThread,
443 updatedAt: this.nextUpdatedAt(),
444 preview: '[compacted]',
445 });
446 return {
447 requestedThreadId: threadId,
448 threadId,
449 cwd: existingThread.cwd ?? null,
450 title: existingThread.title ?? null,
451 turnId,
452 status: 'completed',
453 };
454 }
455
456
457 async archiveThread({ threadId }) {

Callers

nothing calls this directly

Calls 2

nextUpdatedAtMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected