feat(background-agent): handle "interrupt" in notifications, output, and formatting

Update notification systems to display INTERRUPTED status.

Add interrupt handling to background_output tool (terminal status).

Add interrupt-specific status note to formatTaskStatus.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-02-09 18:26:16 +09:00
parent a709cb5b1b
commit ea9cd17b45
6 changed files with 37 additions and 29 deletions
@@ -1,6 +1,6 @@
import type { BackgroundTask } from "./types"
export type BackgroundTaskNotificationStatus = "COMPLETED" | "CANCELLED"
export type BackgroundTaskNotificationStatus = "COMPLETED" | "CANCELLED" | "INTERRUPTED"
export function buildBackgroundTaskNotificationText(input: {
task: BackgroundTask
@@ -9,7 +9,7 @@ export function buildBackgroundTaskNotificationText(args: {
}): string {
const { task, duration, allComplete, remainingCount, completedTasks } = args
const statusText =
task.status === "completed" ? "COMPLETED" : task.status === "error" ? "ERROR" : "CANCELLED"
task.status === "completed" ? "COMPLETED" : task.status === "interrupt" ? "INTERRUPTED" : task.status === "error" ? "ERROR" : "CANCELLED"
const errorInfo = task.error ? `\n**Error:** ${task.error}` : ""
if (allComplete) {