diff --git a/codex-cli/src/utils/singlepass/context.ts b/codex-cli/src/utils/singlepass/context.ts index e185ba9d..20f32cca 100644 --- a/codex-cli/src/utils/singlepass/context.ts +++ b/codex-cli/src/utils/singlepass/context.ts @@ -51,14 +51,15 @@ export function renderTaskContext(taskContext: TaskContext): string { * For each file, we embed the content in a CDATA section. */ function renderFilesToXml(files: Array): string { - let xmlContent = ""; - for (const fc of files) { - xmlContent += ` + const fileContents = files + .map( + (fc) => ` ${fc.path} - `; - } - xmlContent += "\n"; - return xmlContent; + `, + ) + .join(""); + + return `\n${fileContents}\n`; }