| 237 | } |
| 238 | |
| 239 | function buildForegroundContinuationNote( |
| 240 | taskCount: number, |
| 241 | reason: "backgrounded" | "timed_out" |
| 242 | ): string { |
| 243 | if (reason === "backgrounded") { |
| 244 | return taskCount === 1 |
| 245 | ? "Task sent to background because a new message was queued. Use task_await to monitor progress." |
| 246 | : "Tasks were sent to background because a new message was queued. Use task_await to monitor progress."; |
| 247 | } |
| 248 | |
| 249 | return taskCount === 1 |
| 250 | ? "Task exceeded foreground wait limit and continues running in background. Use task_await to monitor progress." |
| 251 | : "Tasks exceeded the foreground wait limit and continue running in background. Use task_await to monitor progress."; |
| 252 | } |
| 253 | |
| 254 | function buildInterruptedTaskNote(taskCount: number): string { |
| 255 | return taskCount === 1 |