diff --git a/src/main.tsx b/src/main.tsx index dd06bc1a7..3317f99c9 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -4238,19 +4238,24 @@ async function run(): Promise { } if (process.env.USER_TYPE === 'ant') { if (options.resume && typeof options.resume === 'string' && !maybeSessionId) { - // Check for ccshare URL (e.g. https://go/ccshare/boris-20260311-211036) - const { parseCcshareId, loadCcshare } = await import('./utils/ccshareResume.js'); - const ccshareId = parseCcshareId(options.resume); - if (ccshareId) { + const resolvedPath = resolve(options.resume); + try { + const resumeStart = performance.now(); + let logOption; try { - const resumeStart = performance.now(); - const logOption = await loadCcshare(ccshareId); - const result = await loadConversationForResume(logOption, undefined); + // Attempt to load as a transcript file; ENOENT falls through to session-ID handling + logOption = await loadTranscriptFromFile(resolvedPath); + } catch (error) { + if (!isENOENT(error)) throw error; + // ENOENT: not a file path — fall through to session-ID handling + } + if (logOption) { + const result = await loadConversationForResume(logOption, undefined /* sourceFile */); if (result) { processedResume = await processResumedConversation( result, { - forkSession: true, + forkSession: !!options.forkSession, transcriptPath: result.fullPath, }, resumeContext, @@ -4259,74 +4264,26 @@ async function run(): Promise { mainThreadAgentDefinition = processedResume.restoredAgentDef; } logEvent('tengu_session_resumed', { - entrypoint: 'ccshare' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, + entrypoint: 'file' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, success: true, resume_duration_ms: Math.round(performance.now() - resumeStart), }); } else { logEvent('tengu_session_resumed', { - entrypoint: 'ccshare' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, + entrypoint: 'file' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, success: false, }); } - } catch (error) { - logEvent('tengu_session_resumed', { - entrypoint: 'ccshare' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, - success: false, - }); - logError(error); - await exitWithError(root, `Unable to resume from ccshare: ${errorMessage(error)}`, () => - gracefulShutdown(1), - ); - } - } else { - const resolvedPath = resolve(options.resume); - try { - const resumeStart = performance.now(); - let logOption; - try { - // Attempt to load as a transcript file; ENOENT falls through to session-ID handling - logOption = await loadTranscriptFromFile(resolvedPath); - } catch (error) { - if (!isENOENT(error)) throw error; - // ENOENT: not a file path — fall through to session-ID handling - } - if (logOption) { - const result = await loadConversationForResume(logOption, undefined /* sourceFile */); - if (result) { - processedResume = await processResumedConversation( - result, - { - forkSession: !!options.forkSession, - transcriptPath: result.fullPath, - }, - resumeContext, - ); - if (processedResume.restoredAgentDef) { - mainThreadAgentDefinition = processedResume.restoredAgentDef; - } - logEvent('tengu_session_resumed', { - entrypoint: 'file' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, - success: true, - resume_duration_ms: Math.round(performance.now() - resumeStart), - }); - } else { - logEvent('tengu_session_resumed', { - entrypoint: 'file' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, - success: false, - }); - } - } - } catch (error) { - logEvent('tengu_session_resumed', { - entrypoint: 'file' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, - success: false, - }); - logError(error); - await exitWithError(root, `Unable to load transcript from file: ${options.resume}`, () => - gracefulShutdown(1), - ); } + } catch (error) { + logEvent('tengu_session_resumed', { + entrypoint: 'file' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, + success: false, + }); + logError(error); + await exitWithError(root, `Unable to load transcript from file: ${options.resume}`, () => + gracefulShutdown(1), + ); } } } diff --git a/src/utils/ccshareResume.ts b/src/utils/ccshareResume.ts deleted file mode 100644 index c4c708bb2..000000000 --- a/src/utils/ccshareResume.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type { LogOption } from 'src/types/logs.js' -export const parseCcshareId: (resume: string) => string | null = () => null -export const loadCcshare: (ccshareId: string) => Promise = - async () => { - throw new Error('ccshare not implemented') - }