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

Function updateSessionTitle

src/utils/teleport/api.ts:425–466  ·  view source on GitHub ↗
(
  sessionId: string,
  title: string,
)

Source from the content-addressed store, hash-verified

423 * @returns Promise<boolean> True if successful, false otherwise
424 */
425export async function updateSessionTitle(
426 sessionId: string,
427 title: string,
428): Promise<boolean> {
429 try {
430 const { accessToken, orgUUID } = await prepareApiRequest()
431
432 const url = `${getOauthConfig().BASE_API_URL}/v1/sessions/${sessionId}`
433 const headers = {
434 ...getOAuthHeaders(accessToken),
435 'anthropic-beta': 'ccr-byoc-2025-07-29',
436 'x-organization-uuid': orgUUID,
437 }
438
439 logForDebugging(
440 `[updateSessionTitle] Updating title for session ${sessionId}: "${title}"`,
441 )
442 const response = await axios.patch(
443 url,
444 { title },
445 {
446 headers,
447 validateStatus: status => status < 500,
448 },
449 )
450
451 if (response.status === 200) {
452 logForDebugging(
453 `[updateSessionTitle] Successfully updated title for session ${sessionId}`,
454 )
455 return true
456 }
457
458 logForDebugging(
459 `[updateSessionTitle] Failed with status ${response.status}: ${jsonStringify(response.data)}`,
460 )
461 return false
462 } catch (error) {
463 logForDebugging(`[updateSessionTitle] Error: ${errorMessage(error)}`)
464 return false
465 }
466}
467

Callers 1

useRemoteSessionFunction · 0.85

Calls 7

prepareApiRequestFunction · 0.85
getOauthConfigFunction · 0.85
getOAuthHeadersFunction · 0.85
logForDebuggingFunction · 0.85
jsonStringifyFunction · 0.85
patchMethod · 0.80
errorMessageFunction · 0.50

Tested by

no test coverage detected