agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

Report the command and output of background tasks

Open Annieeeee11 opened this issue 2 weeks ago • 0 comments

PR #7550 shows background tasks in a tab above the chat composer, but the API reports only each task's description, kind, state and times. Two things the approved design needs are missing:

  • The command (for example npm run dev), shown in muted mono text next to the task's name.
  • The output. The planned follow-up opens a task in a Background tab beside Subagents and shows the shell's live output, with the newest lines at the bottom. Without output there is nothing to show there.

What the API needs

Add to BackgroundTaskResponse (backend/internal/httpd/controllers/dto.go) and to ports.ChatBackgroundTask:

  • command: the shell command line, when the task is a shell and the harness reports it separately from the description. Leave it empty rather than repeat the description.
  • A way to read output: either a recent output tail on each reading, or a separate endpoint such as GET /api/v1/sessions/{sessionId}/background-tasks/{taskId}/output that returns the last N lines, so the list poll stays small. Like the other background-task reads, it must not start a controller or wake a hibernated session.

Where the data could come from (to confirm per harness)

  • Claude Code: the background_tasks_changed snapshot carries only an id, type and description. The command is in the input of the Bash tool call that launched the task. The SDK reports an output_file on task_notification when a task ends. A live output path while it runs still needs finding, possibly through AO's runtime extension.
  • Codex: thread/backgroundTerminals/list already returns command, which AO currently uses as the description. Output may come from item/commandExecution/outputDelta notifications for the exec item, buffered per process.
  • ACP harnesses and Unreal Agent: a command may be in the launching tool call's raw input, and output in its tool content where the harness reports it. Some harnesses will have neither, so both fields stay optional.

Done when

  • A Claude Code or Codex shell task reports its command, and the composer tab shows it next to the name.
  • The latest output of a running shell task can be read without waking the session, bounded in size, with control characters removed like the description.
  • Harnesses that can't provide either leave the fields empty, and the UI hides what's missing instead of showing a placeholder.

Annieeeee11 avatar Nov 13 '26 13:11 Annieeeee11