MCPcopy Index your code
hub / github.com/codeaashu/claude-code / archiveSession

Function archiveSession

src/bridge/bridgeApi.ts:325–356  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

323 },
324
325 async archiveSession(sessionId: string): Promise<void> {
326 validateBridgeId(sessionId, 'sessionId')
327
328 debug(`[bridge:api] POST /v1/sessions/${sessionId}/archive`)
329
330 const response = await withOAuthRetry(
331 (token: string) =>
332 axios.post(
333 `${deps.baseUrl}/v1/sessions/${sessionId}/archive`,
334 {},
335 {
336 headers: getHeaders(token),
337 timeout: 10_000,
338 validateStatus: s => s < 500,
339 },
340 ),
341 'ArchiveSession',
342 )
343
344 // 409 = already archived (idempotent, not an error)
345 if (response.status === 409) {
346 debug(
347 `[bridge:api] POST /v1/sessions/${sessionId}/archive -> 409 (already archived)`,
348 )
349 return
350 }
351
352 handleErrorStatus(response.status, response.data, 'ArchiveSession')
353 debug(
354 `[bridge:api] POST /v1/sessions/${sessionId}/archive -> ${response.status}`,
355 )
356 },
357
358 async reconnectSession(
359 environmentId: string,

Callers 2

doReconnectFunction · 0.70
initBridgeCoreFunction · 0.70

Calls 6

validateBridgeIdFunction · 0.85
withOAuthRetryFunction · 0.85
getHeadersFunction · 0.85
handleErrorStatusFunction · 0.85
postMethod · 0.80
debugFunction · 0.70

Tested by

no test coverage detected