Skip to content
Queue, tasks & shells

TUI Multitasking

Queue follow-ups, background sub-agents, and detached shells while the main agent is busy. Layout and keybindings stay in the TUI Guide; this page is the interaction reference.

Named sub-agent profiles and the task tool live in Agents → Sub-agents.

Message queue (while the agent is busy)

The composer stays live while the agent is streaming or running tools. Plain messages submitted with Enter are queued (FIFO) and sent automatically when the current turn finishes — they are not dropped.

A compact Queue strip appears above the input (above the task panel when both are visible). Keyboard ownership defaults to the composer; strips only receive arrows when focused (see Chrome focus).

KeyAction
Enter (while busy)Enqueue the prompt; composer clears
↑ (empty composer)Edit the last queued message in the composer (slot stays visible)
↓ (empty composer)Focus the queue strip for navigation
Enter (focused strip)Edit the selected item (load into composer; slot marked editing)
Enter (after edit)Update the text at the same queue index
Esc (while editing)Cancel edit and keep the original text at its slot
d / BackspaceDelete the selected item (or the last item when composer-focused)
Esc (focused strip)Return focus to the composer (does not cancel the agent)

While a queued message is being edited, its strip row stays in place with an editing · marker, and automatic dequeue is paused until you commit (Enter) or cancel (Esc). Busy-safe slash commands still run immediately (/tasks, /ps, /help, /status, /context, /usage, /copy, …). Other slash commands are rejected with a warning until the agent is idle. Ctrl+C interrupts the agent but keeps the queue. Capacity is 8 messages; when full, a toast is shown.

Hints show ↑ edit queue (N queued) and tab: focus panels while items wait.

A single user turn is capped at 20 LLM rounds (the same agent.DefaultMaxLoops as headless Engine.Send). Hitting the cap posts an error in chat instead of looping on tool calls forever. Auto-compact uses the same three-miss circuit breaker as the engine.

Pinned task panel

Press Ctrl+X then B (or Ctrl+↓) to toggle a compact Running tasks strip above the input. It shows only running / pending sub-agents — history lives in /tasks. The strip auto-opens when a background job starts and auto-hides when nothing is active; with no live jobs, the same shortcut opens /tasks instead of an empty pin. Bare b is not a shortcut — it types into the prompt (so /build and similar remain reachable). Visibility does not steal arrow keys; use Tab (or focus the strip) first. When focused, Enter opens the selected job’s session view; Esc returns focus to the composer (the panel stays open while jobs are still active — toggle again to close).

Hints include /tasks all so the full dashboard stays one command away.

Chrome focus (queue · tasks · composer)

When the queue strip and/or task panel are visible, exactly one region owns navigation keys:

FocusKeys
Composer (default)Typing, history ↑/↓, queue quick-actions when empty
Message queue↑/↓ select, Enter edit, d delete
Tasks↑/↓ select, Enter open session
KeyAction
TabCycle focus among visible strips and the composer
EscAlways return focus to the composer

The focused strip uses the theme border_focused color and a ▶ cursor; unfocused strips stay muted.

Tasks dashboard (/tasks)

Opens an overlay listing foreground and background sub-agent jobs spawned via the task tool or /batch for the current chat session. Jobs are shown as a nesting tree (indent + (+N) descendant count). Running rows show depth-aware progress (depth-2 · implementing · round 1/2). Completed jobs are persisted in SQLite and restored when you resume the same session (/sessions, --continue). After a restart, previously running jobs appear as interrupted — transcripts remain available, but the process is not re-executed.

Cross-session board (/agents)

Lists persisted sub-agent jobs across all sessions (merged with live in-process jobs). Same attach/peek/stop keys as /tasks. Parent session is shown as sess:<short-id> in the description column.

Attach and export

Jump straight to attach by short or full job ID. Export writes ulmi-subtask-<agent>-<timestamp>.md in the cwd.

Keys inside the /tasks and /agents overlays:

KeyAction
↑ / ↓Navigate jobs (tree order)
SpacePeek live output (last lines) + breadcrumb
EnterAttach — full transcript + breadcrumb + steer input
iStatic job info (path, depth, prompt, result, error)
xCancel a running background job (list/peek; in attach only when steer input empty)
rRefresh the list
Esc / qClose overlay

In attach view, the title shows the path back to main (main › explore › verifier). Type a message and press Enter to steer a running sub-agent. Use ↑/↓ to scroll the live transcript. Space returns to peek mode.

When a background job completes, a toast appears (and a terminal desktop notification is sent via OSC 9 when supported). A short line is also added to the chat.

Shell sessions (/ps)

Opens an overlay listing agent bash tool runs and user ! shell commands for the current session (aliases: /shells, /bashes). Shell processes are detached from the keyboard by default: while a command runs you can still type in the composer, edit the message queue, and open overlays. Use /ps to inspect output or attach stdin.

The list view is always shown (including when only one session exists). Each row follows the Codex /ps pattern: a primary title (! zsh · sleep 60 or bash zsh · go test) with status/elapsed, plus a secondary line with the latest non-empty output (or (no output yet)).

KeyAction
↑ / ↓Navigate sessions
SpacePeek recent output
EnterAttach — keyboard bytes go to the process PTY
xKill a running session (list / peek)
rRefresh the list
Esc / qFrom attach: detach back to the list; from list: close

In attach / peek, the overlay keeps the same outer frame size as the list. Inside it, the session uses the same bordered terminal card as in chat (❯ shell command, body, ● running). Typed keys go to the PTY and appear as local echo in the card body. Ctrl+C sends SIGINT; Esc detaches without killing. Kill only via x on the list/peek.

User ! commands are documented in TUI Guide → Shell mode.

@mention running agents

Typing @ in the input shows running sub-agents first (as agent:<name>:<short-id>), then matching workspace files. The file index is built in the background and stops if the TUI quits before it finishes. Tune the mention file-size cap with mentions.max_file_size in Configuration.

While tools (especially task) are running, the chat shows a live progress line, slash commands such as /tasks stay available, and follow-up messages go into the message queue. The status bar shows tasks: ⠋ N when sub-agents are active. Live running / done status updates in place on the ⚒ task (or collapsed ▶ N sub-agents) card that spawned the job — not at the end of the transcript. When a job finishes, that card freezes to a ✓/⚠ line with elapsed time and token use. When a background wave finishes, the parent agent is auto-resumed with the job results (no need to open /tasks just to unblock the main loop).

Batch fan-out (/batch)

Spawns multiple sub-agent jobs from one command. Syntax:

/batch <agent> [flags] <prompt>
FlagPurpose
--glob PATTERNExpand files and spawn one job per match
--parallel NMax concurrent jobs (default 4)
--background / --bgReturn immediately; monitor via /tasks
--worktreeRun each job in an isolated git worktree
--gradeRun implementer + verifier grader loop per job

Use {{file}} or {{path}} in the prompt to substitute the glob match. Example:

/batch explore --glob "internal/**/*.go" --parallel 4 --background "Audit {{file}}"