MCPcopy
hub / github.com/steipete/oracle / buildReattachLine

Function buildReattachLine

src/cli/sessionDisplay.ts:330–346  ·  view source on GitHub ↗
(metadata: SessionMetadata)

Source from the content-addressed store, hash-verified

328}
329
330export function buildReattachLine(metadata: SessionMetadata): string | null {
331 if (!metadata.id) {
332 return null;
333 }
334 const referenceTime = metadata.startedAt ?? metadata.createdAt;
335 if (!referenceTime) {
336 return null;
337 }
338 const elapsedLabel = formatRelativeDuration(referenceTime);
339 if (!elapsedLabel) {
340 return null;
341 }
342 if (metadata.status === 'running') {
343 return `Session ${metadata.id} reattached, request started ${elapsedLabel} ago.`;
344 }
345 return null;
346}
347
348export function trimBeforeFirstAnswer(logText: string): string {
349 const marker = 'Answer:';

Callers 2

attachSessionFunction · 0.85

Calls 1

formatRelativeDurationFunction · 0.85

Tested by

no test coverage detected