Open History to see the last commit
1/** Formats Codex task paths for display while leaving provider identity untouched. */
2export function formatSubagentDisplayTitle(title: string): string {
3 const displayTitle = title.replace(/^Subagent:\s*/i, "");
4 const path = /^\/root\/(?:[^/]+\/)*([^/]+)\/?$/u.exec(displayTitle);
5 if (path === null) return displayTitle;
6
7 const name = path[1]!.replace(/[_\s]+/gu, " ").trim();
8 return name.replace(/(^|\s)\S/gu, (letter) => letter.toUpperCase()) || displayTitle;
9}