| 1451 | } |
| 1452 | |
| 1453 | function formatTasksReport(tasks: readonly BackgroundTaskInfo[]): string { |
| 1454 | if (tasks.length === 0) return 'No background tasks for this session.'; |
| 1455 | return [ |
| 1456 | `Background tasks (${tasks.length}):`, |
| 1457 | ...tasks.map((task) => { |
| 1458 | const parts = [`- ${task.taskId}: ${task.status}`, task.description]; |
| 1459 | if (task.kind === 'process') parts.push(`command=${task.command}`); |
| 1460 | if (task.kind === 'agent' && task.subagentType !== undefined) parts.push(`subagent=${task.subagentType}`); |
| 1461 | if (task.stopReason !== undefined) parts.push(`reason=${task.stopReason}`); |
| 1462 | return parts.join(' · '); |
| 1463 | }), |
| 1464 | ].join('\n'); |
| 1465 | } |
| 1466 | |
| 1467 | function formatCompactionCompleted(result: CompactionCompletedResult): string { |
| 1468 | return [ |