refactor: use undefined instead of null for optional return type

This commit is contained in:
weishu
2025-12-30 17:39:24 +08:00
parent 754d9dc0e8
commit b7dce6bf3f
+4 -4
View File
@@ -162,10 +162,10 @@ export async function codexRemoteLauncher(session: CodexSession): Promise<'switc
return `${normalized.slice(0, maxChars)}...`;
}
function buildResumeInstructionsFromFile(resumeFile: string): string | null {
function buildResumeInstructionsFromFile(resumeFile: string): string | undefined {
const result = readResumeFileContent(resumeFile);
if (!result) {
return null;
return undefined;
}
const items: { role: 'user' | 'assistant' | 'tool'; text: string }[] = [];
@@ -211,7 +211,7 @@ export async function codexRemoteLauncher(session: CodexSession): Promise<'switc
}
if (items.length === 0) {
return null;
return undefined;
}
if (items.length > RESUME_CONTEXT_MAX_ITEMS) {
@@ -236,7 +236,7 @@ export async function codexRemoteLauncher(session: CodexSession): Promise<'switc
}
if (rendered.length === 0) {
return null;
return undefined;
}
const header = truncated