chore: 移除 ccshareResume stub 及 main.tsx 的 ccshare fast-path

- 删除 src/utils/ccshareResume.ts(parseCcshareId 恒返回 null、loadCcshare 恒抛错的 stub)
- 同步移除 src/main.tsx 中 USER_TYPE === 'ant' 守卫下的 if (ccshareId) {...} else {...} 双分支
- 提升 else 块(文件路径 resume 处理)为直接进入 if (options.resume) 块内

ccshare 是 Anthropic 内部特性(go/ccshare URL),stub 未实现导致 ccshareId 恒为 null,整个 ccshare 分支永不进入;保留的文件路径 resume 路径不变。

Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
claude-code-best
2026-06-20 10:31:02 +08:00
parent cd839671d0
commit 63ac7e641b
2 changed files with 24 additions and 74 deletions

View File

@@ -4238,48 +4238,6 @@ async function run(): Promise<CommanderCommand> {
} }
if (process.env.USER_TYPE === 'ant') { if (process.env.USER_TYPE === 'ant') {
if (options.resume && typeof options.resume === 'string' && !maybeSessionId) { 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) {
try {
const resumeStart = performance.now();
const logOption = await loadCcshare(ccshareId);
const result = await loadConversationForResume(logOption, undefined);
if (result) {
processedResume = await processResumedConversation(
result,
{
forkSession: true,
transcriptPath: result.fullPath,
},
resumeContext,
);
if (processedResume.restoredAgentDef) {
mainThreadAgentDefinition = processedResume.restoredAgentDef;
}
logEvent('tengu_session_resumed', {
entrypoint: 'ccshare' 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,
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); const resolvedPath = resolve(options.resume);
try { try {
const resumeStart = performance.now(); const resumeStart = performance.now();
@@ -4329,7 +4287,6 @@ async function run(): Promise<CommanderCommand> {
} }
} }
} }
}
// If not loaded as a file, try as session ID // If not loaded as a file, try as session ID
if (maybeSessionId) { if (maybeSessionId) {

View File

@@ -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<LogOption> =
async () => {
throw new Error('ccshare not implemented')
}