Documentation

cockpit task

Generated reference for cockpit task, including its syntax, options, results, and constraints from the canonical cockpit CLI source.

Applies to
CLI
WindowsmacOSLinux
FreeAGI Lab member

Verified 2026-09-05 · v4.71.0

Markdown

Some screens and steps may differ in the latest version.

This reference is generated from the same canonical source distributed as cockpit CLI help. See Cockpit CLI for concepts and safe operating guidance.

Local task commands authenticate the task API over loopback first and automatically use file IPC when a sandbox blocks loopback or process visibility. The same transport-aware preflight is shared by task, talk, HTML, side-panel, and current-task context resolution. Do not request broader sandbox permissions; use cockpit doctor to inspect pidVisibility, both transport results, and effectiveTransport if the command exits 7.

Task commands print Cockpit's JSON answer. When Cockpit refuses the request ({"ok":false,...}, for example task_not_found or task_owned_by_crew), the command exits 1; turn actions use the exit codes in Turn Lifecycle, except that task_owned_by_crew always exits 1, and a command that cannot reach Cockpit exits 7. task run exits 0 with data.waitError when the task was created and only waiting for it failed. create, run, and send check the request size first and answer payload_too_large (exit 1, nothing sent) when the request is larger than the 1,048,576 bytes Cockpit accepts. When the CLI cannot encode a request because node failed, it answers encoding_failed (exit 1) and sends nothing.

current, list, get, send, rename, account, project, browser-identity, create, run, wait, complete, remove, resume, goto, pin, unpin, queue, and memory-guard reject an option they do not know, and any extra argument, with code invalid_arguments (exit 1) before sending anything, so no task is created, changed, or removed. When a known option is close, the error names it and returns it in suggestion, for example --title → --name. Commands that act on one task take the task ID as their first argument. An option that takes a value but has none, because it is the last word or the next word starts with -- (task list --directory, task list --directory --all), stops at once with an error that names the option (code invalid_arguments) and sends nothing. A required option that is not given at all answers option_required. An empty value such as --name "" is still a value. A value cannot start with --, so send <id> --text "--- x" is rejected as an unknown option. Pass text that starts with -- with --stdin or a file option: --instruction-file for create and run, --text-file for send. rename --name has neither, so a task name cannot start with --.

When the task listener is recovering without an advertised port, the first command waits for recovery and authenticates within one 20-second deadline, using the same PID, token, and IPC directory. Loopback unavailability switches to file IPC quickly; JSON mutations keep the same content type through either transport. Older runtime files without listener diagnostics may publish their final token with the first port; the CLI authenticates that pair from the same PID and IPC directory. Token changes during later recovery fail closed.

Usage: cockpit task <command> [options] [--host <host|alias>] [--port <sync-port>] [--https true|false]

Create, monitor, respond to, and finish Cockpit tasks.

Inspect

list (including --summary) and get expose ownerRequest: { ref } when a Crew child carries an inherited owner request. Cockpit creates this mark from authenticated task identity and current turn records; request fields cannot set it. A non-owner-request send removes an existing mark, and later owner input cannot grant it again (cockpit help crew).

cockpit task list                               # Newest active tasks as lightweight summaries, 100 per page (excludes completed)
cockpit task list --cursor <nextCursor>         # Next page: the same options plus page.nextCursor
cockpit task list --status waiting_confirmation # Only tasks waiting for a response
cockpit task list --pinned                      # Pinned incomplete tasks, including Master Agent tasks
cockpit task list --all                         # Tasks in every status, still one page at a time
cockpit task list --directory /path/to/repo     # Filter by directory (partial match)
cockpit task list --name "keyword"              # Filter by task name (partial match, case-insensitive)
cockpit task list --parent <id>                 # Parent and direct children
cockpit task list --parent <id> --recursive --all # Include every descendant and completed tasks
cockpit task list --full                        # Full entries, 20 per page
cockpit task list --limit 200                   # Up to 200 entries per page
cockpit task current                            # Resolve the current task from this session
cockpit task get <id>                           # Latest 1 conversation turn
cockpit task get <id> --turns 3 --max-lines 500 # More history / larger terminal output
cockpit task goto <id>                          # Open Cockpit and select the task
cockpit task pin <id>                           # Pin a task to the top Pinned section of the task list
cockpit task pin <id> --where project           # Pin a task to the top of its project's group instead
cockpit task unpin <id>                         # Unpin a task
cockpit task project <id>                       # The project the task belongs to

--parent <id> selects the parent itself and its direct children on the server, across all directories. Add --recursive for all descendants; it requires --parent. An unknown parent returns HTTP 404 with code task_not_found and the ID in details.parent.

Parent lists use the same filters as ordinary lists: completed tasks are excluded by default; --status completed selects completed tasks; --all includes every status and takes precedence over --status. --pinned takes precedence over both and selects pinned incomplete tasks. --directory (case-sensitive substring) and --name (case-insensitive substring) further narrow the result. Filters apply to the parent as well as its descendants, so a filtered-out parent does not appear. Recursive traversal still passes through ancestors excluded by these filters. No directory filter is implied by the caller's working directory.

task list returns lightweight summaries unless --full is given; --summary asks for the same summaries explicitly, and --summary with --full answers option_conflict and sends nothing. Each summary contains only id, name, status, stopReason, hasPendingAsk, parentMasterId (null for a root), directory, projectId (null for a task outside every project), agentType, createdAt, and updatedAt. hasPendingAsk reflects an unanswered Ask, independently of task status. A task resumed after completion reports its current running or waiting_confirmation status; there is no separate resumed status. updatedAt is the latest recorded creation, activity, or completion timestamp, not a timestamp for every metadata edit. Summaries exclude instructions, conversation, reports, model settings, and device details. --full returns the full entries described below; to check one task in detail, cockpit task get <id> is lighter than a full list.

Pages

Every list comes one page at a time, newest first (by createdAt, then by task ID for the same time). A page holds at most --limit entries (1 to 200; 100 by default, 20 with --full; any other value answers option_value_invalid and sends nothing) and at most 256 KiB of JSON (1 MiB with --full), whichever comes first. The response keeps the data array and adds page: {"ok":true,"data":[...],"page":{"limit":100,"returned":100,"hasMore":true,"nextCursor":"eyJ2..."}}. When hasMore is true, run the same command with the same options plus --cursor <nextCursor> for the next page; when it is false, nextCursor is null. The CLI never fetches further pages on its own. Following nextCursor to the end returns every matching task exactly once, even when tasks are added or removed in between; a task created after the first page is not included, so list again from the start to see it. A cursor only works with the options it came from (the filters, --full, and --limit): a malformed cursor, or one used with other options, answers task_list_cursor_invalid (HTTP 400). --all still means every status; it does not lift the page limit. To check one state, narrow the list with --status, --name, --directory, or --parent rather than paging through everything.

An entry is never cut short. When a single task's entry is larger than the page's byte limit, the list answers task_list_entry_too_large (HTTP 413) with that task's ID in details.id and, when more tasks follow, a details.nextCursor that continues after it; read that task with cockpit task get <id>.

Summary pages add a response-level ISO 8601 generatedAt: {"ok":true,"data":[...],"page":{...},"generatedAt":"2026-09-15T12:00:00.000Z"}. Use it to compare snapshot age; the task store has no live snapshot revision (its persistence journal sequence does not track every in-memory change).

A Cockpit that predates pages answers task_list_pages_unsupported (exit 1); update AGI Cockpit there (with --host, on that computer). The CLI does not fall back to fetching the whole list from it.

task list --full entries, task get, and the Hooks task payload carry projectId when the task belongs to a project (see cockpit help project).

task list --full entries, task get, task create, task run, task wait, and the Hooks task payload never contain provider API keys, also with --host. A queued Cockpit Agent message shows its other settings in queuedTurns without openRouterApiKey, openCodeApiKey, and openCodeZenApiKey. The keys are left out of this output only; how Cockpit saves and sends the message does not change.

cockpit task get <id> includes:

  • model, effort, and serviceTier: the effective model, reasoning effort, and Codex speed tier selected for the task, or null when the task runtime does not expose them. The same stable fields are returned by task list --full entries, task create, and under task in task run / task wait. Read or change this selection with task model <id> [<model>]
  • runtimeModel: the model the task's running agent session last reported it uses, separate from model (which can be a setting such as default), or null when Cockpit does not know it. It is never filled in from the setting, a default, or a model list. It is null while no session runs, after a restart or an agent switch until the new session reports a model, after a model change until the agent reports the new one, and always for agents that do not report it: Cockpit Agent and terminal-mode tasks. Claude Code reports it when its session starts and with each reply; Codex when its thread starts or resumes; Cursor, Qoder, Antigravity, and Grok Build when the session starts and when they report a model change; Muse Code when a new session starts and when it reports a model change, not when a session is resumed. The same field is in task list --full entries, task create, and under task in task run / task wait
  • agentSessions: one entry per agent session (segment) the task has used, oldest first: agentType, sessionId, accountProfileId, model, the number of turns that agent ran itself in that segment, origin (start, restart for a new session of the same agent, or switch), and, for a segment that received carried-over history, transplant with its method and counts
  • pendingAgentSwitch: the agent switch scheduled for the next send (agentType, model, effort, serviceTier), or absent. See Switch Task Agent below
  • conversation: normalized task history limited to the latest N turns. Each item has role, text, kind, and source; kind: "message" is a user/agent message and kind: "terminal_output" is raw terminal fallback. Cockpit agent and visual-mode message turns also carry the id used by cockpit pinned-answers, and pinned answers older than the window stay in the list (capped to a few lines). Cockpit switch dividers carry agentSwitch metadata, including the transplant method and omission counts, even when text is empty.
  • terminalOutput: raw terminal output, useful for understanding live state while the task is waiting
  • readyForNextPrompt: when status is waiting_confirmation, send a new prompt only when this is true; handle permission or question reasons as in-progress user confirmations
  • waitingReason and optional waitingReasonSource (hook, status_file, pty_idle, pty_pattern, permission_queue, question_queue, sessionid_fallback, runtime_event, runtime_fallback)
  • attentionWait: while the task waits for approval or for an answer (including an unanswered Ask), reason (approval or question) and since, the ISO time that wait started, or null when it began before Cockpit recorded it. Repeated updates keep since; it is absent once the task no longer waits for either
  • memoryGuardStop: what Cockpit's memory guard last stopped in the task, when it did: at, scope (task when it stopped the task, process when it stopped only a process the task started and the task kept running), executable (the process name only), footprintBytes, growthBytes over windowSeconds, and agentNoticePending (the agent has not been told yet). memoryGuardExcluded: true when the guard may not stop the task. See Memory Guard below
  • usageLimitAttribution: for a Codex provider limit, the exhausted accountProfileId (null for default), accountName, provider, and window (5h, 7d, credits, another Usage window label, or unknown when unspecified). source is provider_error or usage; explicit provider errors take precedence over cached Usage data. usageLimitResetAt belongs to that restriction. These fields clear when the restriction clears.
  • statusSources: optional status source hints mirroring waitingReasonSource when available
  • latestReportSeq: sequence number of the newest report. Use it as the --since cursor for cockpit task wait
  • errorCode: the stable code of the newest report's error while the task is still in that report's state, such as model_not_found. Absent otherwise. See Delegate And Wait below
  • progress: whether the agent is still working, measured from its runtime events. lastRuntimeEventAt is when Cockpit last received any event from the agent runtime (streamed text, tool calls, status changes, or terminal output), whether or not anyone has the task open. turnStartedAt and turnElapsedMs describe the turn in progress and are null when no turn is running. turnToolCallCount counts the distinct tool calls of the turn in progress, or of the last turn when none is running. All fields are null (0 for the count) until the runtime emits its first event since Cockpit started. Judge a long turn by lastRuntimeEventAt, not by lastActivityAt, which drives unread badges and does not move while the task is on screen, and not by the agent's CPU usage, which stays near zero while it waits for the model
  • turnRequests: the tool approvals and structured questions the task is waiting on, with the command or change being approved. See Turn Lifecycle below
  • completedBy: who moved the task to completed, present only while it is completed: { "kind": "task", "taskId", "taskName" } for another task, { "kind": "master", "taskId", "taskName" } for the master, or { "kind": "app" | "pwa" | "remote" | "cli" | "autorun" | "fleet" } for the desktop app, the mobile app, another device, a CLI command without a calling task, Autorun --complete-on-finish, or Fleet. It clears when the task leaves completed. Unless a person completed it in the desktop or mobile app, the task's conversation ends with one line naming who completed it and how to continue
  • goal and goalCommandAvailable: the current Agent Goal (objective, state, and progress fields), absent or null when there is none, and whether the running agent accepts cockpit task goal start <id> right now. See Agent Goal below

turn_complete means one response turn completed and the task can accept another prompt. It does not mean the whole task is completed.

Full and summary task list, task get, and the task snapshot in task wait include the same derived stopReason: approval (waiting for a person's approval), turn_ended (one turn ended, task remains open), usage_limit, memory_guard (stopped by the memory guard until a person resumes it), question, terminal_prompt, runtime_error, or unknown when no reliable cause was recorded. It is null while running or after completion. A session ID alone is not evidence that a turn ended. Desktop and mobile task lists and child panels use these same meanings. Resuming or answering the last approval clears the approval reason; other pending requests remain visible. hasPendingAsk remains independent of approvals.

Approval waits and their resolution also append child reports with approvalEvent: approval_waiting or approval_resolved. Resolution means the approval wait ended, not that approval was granted: it also covers interruption, errors, usage limits, and completion. These notices are not task-result reports. On an exit into error or completed, the notice retains the previous nonterminal status; the normal result report owns the terminal status and its error or completion payload. When consuming results, keep waiting after an approvalEvent using task wait <id> --since <seq>; Fleet does this automatically, including for older saved notices with terminal statuses. Inspect task get for the current task state. Multiple pending permissions keep the child in approval-waiting until the last permission is resolved, even if a question also opens. A parent task receives the same transition through its existing persistent message queue, even after the child's first report was consumed. Busy parents receive it when ready for their next turn. While a notice is still waiting in the parent's queue, a newer approval notice from the same child replaces it, so a busy parent receives only that child's latest approval state; a notice already being or been delivered, one the owner held or edited, and other messages stay. The reports keep every transition for task wait and Fleet. Completed or missing parents are not resumed. Duplicate state updates do not add another notification. This never approves a request or changes permissions, model selection, or the parent's pending agent switch.

Statuses

Status Meaning Action
running The agent is working Wait, or block with cockpit task wait <id>
waiting_confirmation The agent waits for input Fetch the report with cockpit task wait <id> (or inspect with task get), then respond with task send
completed Work finished or the process ended Review the result. Remove only when cleanup is requested
error The task process failed to start (for example posix_spawnp failed.) or stopped with an error Check errorMessage in task get, fix the cause, then cockpit task retry-start <id> when startFailed: true, otherwise cockpit task resume <id>
  • needsResume: true -> the process stopped but the task is not completed (for example after an app restart). Resume with cockpit task resume <id>. A Terminal task resumes with a fresh shell in the same directory because its previous shell process cannot be restored. A terminal-display agent task with no session ID, outside a temporary folder, has no conversation to continue, so it starts the same agent and account in its folder in a new conversation without resending its first instruction, and the task shows that the earlier conversation could not be continued. When that agent cannot start, resume returns the reason instead of alreadyResumed. Cockpit also stops the agent of an idle visual task, which then shows needsResume: true as after a restart: 5 minutes after its last activity while no conversation view shows it, or 30 minutes while one does. It never stops an agent that is taking a turn, running background work such as a background command or subagent, compacting, or waiting for an approval or a question. Opening its conversation or listing its models does not start it again, except that an Antigravity agent is started to finish background work or a scheduled continuation left unfinished; cockpit task send or resume starts it again in the same session.
  • sessionUnrecoverable: true -> the visual conversation was rejected by its server after consecutive identical turn.completed failures. errorMessage / sessionUnrecoverableError hold the last error. Resume the same conversation will fail the same way; start a new conversation in this task with cockpit task resume <id> --fresh-session. A new conversation from resume --fresh-session or a successful clear resets these fields; a failed clear keeps them.
  • waitingReason: memory_guard -> Cockpit's memory guard stopped the task to keep the Mac responsive. Nothing restarts it on its own; resume it only when the user agrees. See Memory Guard below
  • startFailed: true -> the agent process never started, so there is no session to resume. launch holds the recorded command and prompt. Launch it again with cockpit task retry-start <id>; cockpit task resume <id> refuses this state and names retry-start
  • isPinned: true -> the task is pinned in focus lists. pinPlacement tells where: "top" (the Pinned section at the top of the task list), "project" (the top of its project's group, or of its folder or "No project" group), or null when not pinned

pin takes --where top|project; without it the task goes to the top Pinned section, which is also where every earlier pin stays. Pinning an already pinned task again with the other value moves it. Any other value fails with option_value_invalid (exit 1) and changes nothing. A Crew pins the same way through its internal task ID (task get on that ID shows pinPlacement too); task list itself never lists Crews. pin, unpin, get, and list --full (but not the summaries) return isPinned and pinPlacement. A pinned task nested under another pinned task is shown under that parent, wherever the parent is placed, and keeps its own pinPlacement for when it is shown on its own.

Create

Use --directory /path/to/repo when working in an existing repository. If omitted, the task starts in a temporary folder. Use --project <id|name> to start in a project: without --directory the task starts in the project's primary folder, and a --directory outside the project fails with folder_not_in_project. A task created without --project joins a project by the rules in cockpit help project.

Use task model <id> <model> [--effort <effort>] [--service-tier standard|fast|ultrafast] to update an existing task’s creation-time model selection.

cockpit task create --instruction "Instruction text" --directory /path/to/repo
cockpit task create --instruction "Instruction text" --directory /path/to/repo --agent-type codex
cockpit task create --instruction "Check the work account" --directory /path/to/repo --browser-identity work
cockpit task create --instruction "Investigate the failure" --directory /path/to/repo --agent-type codex --model gpt-5.6-sol --effort high --service-tier fast
cockpit task create --instruction "Investigate deeply" --directory /path/to/repo --agent-type codex --effort high
cockpit task create --instruction "Review this repository" --directory /path/to/repo --agent-type qoder --system-prompt cockpit
cockpit task create --instruction "Instruction text" --directory /path/to/repo --agent-type codex --approval-mode full-access
cockpit task create --instruction "Review this screenshot" --directory /path/to/repo --agent-type claude --ui-mode visual --media shot.png
cockpit task create --instruction "Run in the terminal UI" --directory /path/to/repo --agent-type codex --ui-mode terminal
cockpit task create --instruction "Summarize the repository" --agent-type cockpit --model openrouter/openai/gpt-5.4 --effort medium
cockpit task create --instruction "npm test" --directory /path/to/repo --agent-type terminal --command "npm test"
cockpit task create --instruction "Instruction text" --directory /path/to/repo --worktree feature/my-branch
cockpit task create --instruction "Instruction text" --project Shop                  # Start in the project's primary folder
cockpit task create --instruction "Instruction text" --project Shop --directory ~/repos/shop-api --worktree fix/api
cat instruction.md | cockpit task create --stdin --directory /path/to/repo         # Long instruction, no shell quoting
cockpit task create --instruction-file instruction.md --directory /path/to/repo    # Same, from a file

Pass any instruction that is longer than one line, or that contains backticks, quotes, $, or a code fence, with --stdin or --instruction-file. Inside a double-quoted shell argument the shell runs backticks as command substitution and rewrites $..., so the instruction is already damaged before cockpit sees it — sometimes silently, sometimes as unmatched quote with nothing sent at all. --stdin and the file options (--instruction-file, and --text-file and --objective-file below) deliver the text as it is, including the trailing newline, except that NUL characters are dropped and one byte order mark (U+FEFF) at the start of a file or of standard input is not part of the text (see cockpit help transport).

Option Description Default
--instruction Task instruction (required) -
--instruction-file Read the instruction from a file instead of --instruction -
--stdin Read the instruction from standard input instead of --instruction -
--directory Working directory. master selects the Master Agent directory. Deprecated: the master is going away; use a Crew instead Temporary folder
--project Project ID or name. The task starts in the project's primary folder unless --directory names another folder of the project. An ambiguous name fails with ambiguous_project and the candidate IDs Chosen from the working folder
--agent-type claude, codex, antigravity, cursor, qoder, grok, muse, terminal, cockpit The defaultAgent setting
--claude-profile Claude account for the task (profile name or id from cockpit accounts; claude agent only) Default account
--codex-profile Codex account for the task (profile name or id from cockpit accounts --agent-type codex; codex agent only) Default account
--account auto, default, or an account profile name/id for Claude, Codex, Grok Build, Antigravity, Cursor, or Qoder Auto
--browser-identity Browser Identity name or id to assign as the task's only (and primary) Identity; use default for the legacy browser profile. Add more Identities later with cockpit task browser-identity --add. Available for every agent type Default Identity
--model Model id for cockpit, or for Claude, Codex, Antigravity, Cursor, Qoder, Grok Build, or Muse Code when that agent's current UI mode is visual. Cursor accepts a CLI id such as composer-2.5, claude-sonnet-5-thinking-high, cursor-grok-4.6-high, or auto, an ACP-advertised name, or a full ACP id. Cockpit ids start with openrouter/, opencode-go/ (OpenCode Go), opencode/ (OpenCode Zen), or lmstudio/ and include a non-empty id after the provider. opencode-go/<id> and opencode/<id> are different providers with separate API keys; a bare provider such as opencode or opencode/ is rejected Agent setting
--effort Reasoning effort. When --model is omitted, applies to the agent's current effective default model Model setting or model default
--service-tier Codex visual speed tier: standard, fast, or ultrafast. fast and ultrafast require a model that offers them; Codex offers ultrafast only on some models and plans. When --model is omitted, applies to the current effective default model. Cockpit never takes the default from service_tier in Codex's config.toml; Fast runs only when chosen in Cockpit Model setting or standard
--system-prompt Built-in or custom system prompt for visual Claude, visual Codex, visual Qoder, or Cockpit Agent setting
--approval-mode Approval mode for this task: supervised, accept-edits, auto, or full-access. auto lets the agent's own automatic review approve or block commands and edits; it is available for visual Claude, Codex, and Grok Build tasks, and other agents reject it. Muse Code accepts only accept-edits and full-access. Cockpit Agent tasks and visual-runtime tasks only The defaultApprovalModes setting
--ui-mode visual or terminal for Claude, Codex, Antigravity, Cursor, Qoder, Grok Build, and Muse Code. An unsupported agent or mode is rejected with option_agent_invalid and no task is created The agent's current UI mode setting
--media Local file to attach. Repeatable. Copied through the same upload store and limits as the GUI (attachments:claim): at most 8 files, 512 MB each (25 MB for .json), 1 GB total. Files are stored unchanged without rejecting extensions or checking their content format or declared MIME type. The source file is never moved or deleted. A type the agent cannot use natively in the chosen UI mode is rejected instead of being pasted into the prompt. Not supported with --host -
--command Command to run. For --agent-type terminal, the task reports once when the command ends (see Delegate And Wait) Configured value
--name Task name, up to 50 characters. The option is --name; --title belongs to cockpit ask and is rejected here First line of the instruction
--worktree Branch name for creating a git worktree -
--worktree-base Base path where the worktree is created ~/.agi-tools/worktrees
--studio Launch a Creative Studio task (model or picturebook). Creates a managed workspace; ignores --directory/--worktree/--project -
--parent-task-id Non-empty parent task ID used for nesting in the task UI; cannot be combined with --top-level Caller task
--mission Show the task under this active Mission of the calling Crew (cockpit help crew). Only a Crew's session or its child tasks can use it. Refused with mission_requires_crew, mission_not_found, or mission_not_active, and no task is created Not tagged
--top-level Create without a parent, even when called from a task; available on create and run Off (caller task remains the parent)
--pin Pin the task in focus lists once its start is confirmed; available on create and run. The create response still shows isPinned: false because the start is still running; check task get later. A failed creation or start leaves no pin Off
--smart-routing Let Smart Routing choose the agent, model, and effort, and the workspace when --directory and --project are omitted, with the policy registered for the signed-in account. Available on create and run. See Smart Routing below Off
--create-key Idempotency key for this creation (1-128 characters: letters, digits, ., _, :, -). Replaying a create with the same key returns the already-created task instead of creating another Generated UUID

--directory master on create and run is deprecated. The task is still created in the Master Agent directory as before; Cockpit also prints one warning line to standard error and adds deprecated: true to the JSON answer when the task is created. Standard output stays a single JSON document. Other directories are unchanged.

Smart Routing

cockpit task create --instruction "Fix the flaky login test" --smart-routing
cockpit task run --instruction-file task.md --directory /path/to/repo --smart-routing

--smart-routing lets Smart Routing choose the agent, model, and reasoning effort the same way the new-task screen does when Smart routing is on. It uses the routing policy registered for the AGI account signed in to Cockpit — the one edited on the new-task screen and through cockpit settings get|set smartRouting.policy (see cockpit help settings) — and offers only installed agents that are turned on. Without --directory and --project it also chooses the workspace, from the same candidates as the screen's Auto workspace: recent and project folders, the deprecated Master Agent folder, a new temporary workspace, or a new persistent workspace. With --directory or --project the workspace stays as given and --worktree can be added. The flag does not depend on smartRouting.enabled, which only controls the switch on the new-task screen. A routed task starts in the visual UI mode with automatic account selection, and a model with no effort levels starts without one, even if an effort was saved for it before. A create key is reserved before routing starts, so a retry with the same --create-key waits for and returns the same routed task instead of routing again. Choosing adds time before the task is created: model discovery waits up to 20 seconds and the routing service up to 25 seconds.

Both task create and task run add data.smartRouting with the choice: agentType, model, effort (null when the model has no effort levels), and workspace with kind (project, master (deprecated, the Master Agent folder), temporary, or persistent), name, and directory. workspace is null when --directory or --project fixed it. The task's own agentType, model, effort, and directory fields show the same choice.

Because Smart Routing chooses them, --smart-routing cannot be combined with --agent-type, --model, --effort, --service-tier, --system-prompt, --ui-mode, --command, --account, --claude-profile, --codex-profile, --studio, or --branch-from; these, and --worktree without --directory or --project, fail with option_conflict. With --host it fails with host_not_supported, because the routing policy and sign-in belong to this device.

When Smart Routing cannot choose, the command returns ok: false with one of these codes and creates no task:

Code Meaning
sign_in_required Cockpit is not signed in to an AGI account, or the sign-in expired
verification-unavailable HTTP 503: saved sign-in information cannot be read or verified. No task is created. Retry after the saved information becomes readable; this does not mean you need to sign in again
account_pending Cockpit is signed in but has not loaded the AGI account yet, so the registered policy is unknown. Open Cockpit, wait until it finishes signing in, then retry
subscription_required The signed-in account has no membership plan that includes Smart Routing
rate_limited The per-minute limit was reached. Wait a minute, then retry
invalid_routing_request The service rejected the routing request. Update Cockpit or contact support
routing_unavailable The routing service could not be reached or failed
invalid_routing_result The service chose an agent, model, or workspace that is not available on this device
requested_model_unavailable The instruction or the policy asks for an agent or model that is unavailable
no_agents No installed agent is turned on

Calls without --smart-routing behave exactly as before.

Branch With History

cockpit task create --branch-from <source-id> --agent-type codex --ui-mode visual --instruction "Review the design from another perspective"
cockpit task create --branch-from <source-id> --agent-type claude --instruction-file follow-up.md --confirm-stop

--branch-from is available on task create and task run in both launchers. It uses the source task as parent by default and defaults to its directory when --directory is omitted. Choose the target with --agent-type. A different agent receives the conversation through the full-history transplant engine in a new session. The source conversation and native session remain unchanged. Same-agent Claude branching uses the native fork; agents without native fork support keep the existing explicitly labeled summary handoff.

If the source is running or waiting for a tool approval, the request fails until you explicitly add --confirm-stop. This stops the source and waits for execution to end before launching the branch. Tasks sharing a branch directory cannot run concurrently; stop the active task before resuming the source or another task there. A separate directory can be supplied for comparisons.

Cross-agent branches require a visual source task and do not support Fleet, Autorun, master, or terminal tasks. No shortened conversation handoff is substituted if full-history transfer fails. The target receives messages, tool calls and results, file changes, and supported images through the existing transplant engine. For embedded-resource targets, long tool outputs are reduced first when necessary, then middle exchanges; the first request and latest exchanges are retained. No extra summarization call is made. The desktop and mobile preview and the chat divider report omissions. The CLI result includes the branch origin; review the divider for delivery details.

The desktop and mobile usage-limit notice also offers Continue with … for signed-in agents with known available quota. Unknown quota, expired credentials, and exhausted accounts are excluded, and a Crew's conversation offers only the agents a Crew can use. Each offer pairs an account with a model that account lists: an account that lists the agent's default model from Settings comes first, and otherwise the first model the chosen account lists is used. An agent whose accounts and models take more than 20 seconds to check is left out of the notice. Availability is checked again on tap, the same task switches agent, and a continuation of the last request is sent after transplant. A tap whose check, including the wait for another switch of the same task, takes more than 20 seconds fails and schedules nothing. The notice explains that the history is sent to the selected provider. In a Crew's conversation, Continue with … and the agent menu of the message box change the Crew's agent and model, as cockpit crew update --agent-type does: the Crew starts a new session on the new agent (after the current turn when it is answering) without carrying the conversation so far into it, and after a usage limit Cockpit puts a message first in the Crew's Queue, once for each usage limit and ahead of the messages already waiting, that asks the new session to check its state and continue. The tap changes nothing and fails when the Crew's account setting no longer matches the offer, or when the check, including the wait for other changes to the Crew's settings, takes more than 20 seconds.

Parent And Creator

task create and task run use the same parent contract. Omit both options to keep the caller task as parent (or no parent when there is no eligible caller). Cockpit identifies the caller by the secret it gives every task session; the CLI sends that secret only to the Cockpit that issued it, so a device reached with --host sees no caller. A task created by a Crew or its child task belongs to that Crew (cockpit help crew). Use --parent-task-id <id> to select an explicit parent, or --top-level to create an independent task with no parentMasterId. A top-level task appears in the normal top-level list; pass --pin to pin it at creation, or pin it later with task pin <id>.

The name --top-level describes the resulting hierarchy directly. The task control API represents it as boolean topLevel: true; omitted or false preserves the existing default. topLevel must be a boolean. Combining topLevel: true with any supplied parentTaskId is rejected. A supplied parentTaskId must be a non-empty string after trimming; empty strings, whitespace-only strings, null, and other types are rejected rather than falling back to the caller. Both CLI launchers reject --top-level together with --parent-task-id (including a blank value), and reject blank parent IDs with invalid_option before creating a task. A parent option without its value is rejected with invalid_arguments.

Creator attribution is retained: createdByTaskId records the resolved calling agent task independently of parentMasterId, including for top-level creation and when an explicit different parent is selected. It remains in persisted task data and task API responses. Hooks use the parent link too: task.isChild and COCKPIT_TASK_IS_CHILD are false for a top-level task, so --no-child matches it and --child does not, even when createdByTaskId is retained. No creator is invented when the caller cannot be resolved. These options only affect creation; they do not change an existing task's parent.

cockpit task create --top-level --agent-type codex --instruction "Maintain the project backlog"
cockpit task run --top-level --agent-type codex --instruction "Review the project independently"

--approval-mode sets the task's own approval mode at creation, overriding the global defaultApprovalModes setting for that task alone. It applies to Cockpit Agent tasks and to Claude, Codex, Antigravity, Cursor, Qoder, Grok Build, and Muse Code tasks running in visual UI mode; terminal UI modes and the terminal agent reject it instead of ignoring it. Change it later with task approval-mode <id> <mode>. Muse Code accepts only accept-edits (the default) and full-access: Muse Code never asks before editing files in the workspace, so Cockpit does not offer supervised for it and rejects that value with approval_mode errors instead of pretending to enforce it. task approval-mode <id> returns supportedApprovalModes for the task's agent.

Model selection is limited to runtimes that consume the existing model settings: cockpit, Claude visual, Codex visual, Antigravity visual, Cursor visual, Qoder visual, Grok Build visual, and Muse Code visual. Antigravity approval Auto is unsupported; saved Auto selections use Supervised. Its official ACP session stays in default: Cockpit asks in Supervised, automatically approves known edit requests in accept-edits, and known command/edit requests in full-access, once per request. Missing allow-once choices require an explicit decision or are denied; automatic replies never select allow-always. Increased access applies only to the next new turn; restrictions apply immediately, and native steering keeps the running turn’s restricted policy. Sending or preparing a message does not save increased access until it is accepted.

Antigravity visual uses official agy acp; model ids and thinking levels come from its ACP configuration. The legacy auto-gemini-3 selection resolves to the advertised default model. Terminal UI modes and unsupported agents reject the option instead of ignoring it. --effort remains limited to Cockpit, Claude visual, Codex visual, Antigravity visual, Cursor visual, Grok Build visual, Qoder visual, and Muse Code visual. --service-tier is limited to Codex visual tasks. --system-prompt accepts built-in presets or names from cockpit system-prompt list; --system-prompt-preset remains a compatibility alias. Pass --ui-mode visual to create a visual-runtime task without changing the agent's Settings default; --ui-mode terminal does the same for the terminal UI. terminal and cockpit reject --ui-mode because they are not switchable. A missing path, a directory, an empty or oversized file, an unsupported type, or a kind the chosen agent cannot attach natively is rejected before the task is created.

cockpit effort values are none, minimal, low, medium, high, and xhigh. Claude visual accepts low, medium, high, xhigh, max, and ultracode. ultracode is Claude Code's ultracode mode: xhigh effort plus multi-agent workflows on every substantial task. It is available on models that support xhigh, and it runs as plain xhigh when Claude Code has dynamic workflows turned off. The ultracode keyword opts a single Claude turn into multi-agent workflows only when the user types it in the Cockpit app; text sent through task create or task send does not trigger it, so use --effort ultracode there. Codex visual accepts low, medium, high, xhigh, max, and ultra; minimal is not accepted because the visual runtime normalizes it to low. Antigravity visual applies only the selected model's advertised thinking levels through ACP session/set_config_option. Supported values can include low, medium, high, xhigh (native extra), and max; unavailable levels fail instead of being guessed. Models without thinking configuration reject a separate effort. Grok Build visual accepts low, medium, high, and xhigh, and only when the selected model advertises reasoning effort. Qoder visual accepts none, low, medium, high, xhigh, and max, and only when the selected model advertises reasoning effort. Cursor visual accepts minimal, low, medium, high, xhigh, and max, per model — the levels mirror the thought level in Cursor's model picker (Cursor's extra-high maps to xhigh), a model with no thought level (composer-2.5, auto) rejects the option, and a model id that encodes a level (claude-sonnet-5-thinking-high) applies it without --effort. Cursor's cursor-grok-4.6-low, cursor-grok-4.6-medium, cursor-grok-4.6-high, and cursor-grok-4.6-xhigh CLI ids resolve to the ACP model grok-4.6 with the encoded effort. Muse Code visual takes its models and their efforts from Muse Code itself (model/list); there is no built-in list, and Muse Code lists no models until you sign in. Muse Code's list comes from a cached catalog that muse serve only reads; the terminal app (muse) refreshes it when it starts. Cockpit keeps it current itself: when Muse Code answers with its built-in list, when the cached catalog is more than 12 hours old, after a sign-in, or when the model list is reloaded, Cockpit starts the terminal app hidden in an empty temporary folder for a few seconds (no prompt is sent, so no model is called) and lists again. If that fails, the list stays Muse Code's built-in one and Cockpit tries again after 10 minutes. task create and task model accept any Muse Code model id, and the effort names of Muse Code's protocol (none, minimal, low, medium, high, xhigh, max, and ultra), without checking them against that list. A model Muse Code does not list is sent to Muse Code as entered, and the conversation gets a one-line note where it takes effect; if Muse Code cannot serve it, the next message fails with Muse Code's own error. For a listed model, an effort the model does not advertise is replaced by that model's default level, and a model advertised without levels runs without an effort. An unlisted model always runs at Muse Code's default level: Cockpit sends no effort for it, and task model rejects --effort with one. Without a chosen model, a new session starts on the default model of Muse Code's list (when that default is a contributor model, its non-contributor variant or the first non-contributor model). Muse Code's own default setting, which can name a contributor model, applies only while the list offers no non-contributor model, for example before sign-in. An explicitly chosen contributor model (an id ending in -contributor) gets a one-line note where a session starts on one or switches to one. agents.museContributorModelsEnabled (default false) shows Contributor models from the active Muse Code catalog in the model menus. Turning it on does not select one. Cockpit enables Contributor mode only for an explicitly selected Contributor model and disables it for standard models. The note scrolls away with the conversation; it is not repeated while the same model stays in use, including when the session is resumed. Known Claude, Codex, Cursor, Grok Build, and Qoder models are validated against their model-specific capabilities. Unknown dynamic models use the agent's effort enum so newly available models are not rejected only because the local catalog has not caught up.

When an LM Studio task has no configured model, Cockpit selects the first loaded usable model at the first prompt. The immediate create response may return model and effort as null; after runtime resolution, task settings and subsequent list/get/run/wait responses contain the selected lmstudio/<id> and its effective effort.

Creative Studio examples (model requires the modeling toolchain set up in the app first):

cockpit task create --instruction "A toy car that rolls when printed" --studio model
cockpit task create --instruction "A picture book for 4-year-olds about a lost fox cub finding its way home" --studio picturebook

Delegate And Wait (Preferred)

Prefer cockpit task run when delegating work. It creates the task and blocks until the first report, then returns report with status (waiting_confirmation, error, completed), waitingReason, seq, and the task's latest message in report.message — no polling needed.

Creation and waiting are separate operations. After creation succeeds, task run always returns ok: true with data.taskId, even if the first report cannot be retrieved. A normal deadline sets data.timeout: true; another wait failure sets data.waitError with code and message. Do not retry the instruction after either result because the task already exists. data.account, when present, identifies the account profile actually selected, including an Auto fallback. task create also adds data.taskId and data.account to its existing task fields. Both task create and task run add data.nameSource: name when --name named the task, or instruction when the name was taken from the first line of the instruction.

Creation failures return ok: false, and no task is created. These are refusals before the agent is launched, such as invalid arguments or no usable signed-in account. This is deliberately different from the app's own UI: the desktop screen and the PWA never discard a prompt, so when a task cannot be started there they keep the task, mark it status: "error" with startFailed: true and the reason in errorMessage, and show that reason inside the task so the person can edit the prompt and run it again. A task in that state has never run; task list and task get report it like any other errored task, with startFailed: true and the recorded command and prompt under launch. Launch it again with cockpit task retry-start <id> instead of creating a new task. The CLI keeps the stricter contract for its own creations because agents branch on it. Stable creation error codes include no_signed_in_account when the target has no usable signed-in account for the requested agent (or the chosen Claude account uses an Anthropic API key and has no saved key, which the message names), authentication_failed when remote credentials are rejected, and host_unreachable when the remote host cannot be reached. The local transport equivalent is task_server_unreachable. Only local reachability errors advise checking whether AGI Cockpit is running; remote reachability errors advise checking the host, port, and network.

Once the agent is launched, task create and task run return ok: true with data.taskId and status: "running", and a later failure stays on that task. When Codex rejects the model while starting the session, the task ends as status: "error" with startFailed: true; it never ran, so continue it with cockpit task switch-to-default-model <id>, or with cockpit task retry-start <id> after choosing another model with cockpit task model <id> <model>. When the first turn fails, the task ends as status: "waiting_confirmation" with waitingReason: runtime_error. Either way the report carries the reason in report.error, and task get in errorMessage. When Cockpit recognizes the cause, the report and task get also carry errorCode; branch on it instead of the provider's sentence, which differs between providers and accounts. model_not_found means the agent rejected the model: switch with task switch-to-default-model or choose another model. errorCode is absent when the cause is not recognized.

Create Keys And Lost Acknowledgements

Every task create and task run sends a create key (createKey in the request body): a UUID generated by the CLI, or the value of --create-key. Cockpit remembers the task created for each key for ten minutes, scoped to the calling task and device, so a replayed create with the same key from the same caller returns the already-created task with data.replayed: true instead of creating a second one; a different caller using the same key gets its own task. GET /tasks/created?createKey=<key> (remote: /api/task-cli/tasks/created) returns the same record, or 404 with code task_create_not_found when nothing was created for that key.

When the connection drops after the create request was sent but before the response arrives (connection reset, empty reply, or a send/receive timeout), the CLI does not report a blind failure. It first queries the key; if the task exists it is returned with data.replayed: true, so a lost acknowledgement still yields exactly one task and its id. Only when the target answers task_create_not_found does the CLI replay the create with the same key — a target that does not answer the key lookup (an older Cockpit) is never replayed against, so a lost acknowledgement never produces more than one task there. A replay that is rejected by the target is reported only after the key lookup has confirmed again that nothing was created. Only when Cockpit confirms that nothing was created does it return ok: false with code task_create_interrupted; the same command can then be run again safely. When the outcome cannot be confirmed at all (the target stopped answering, or it does not support create keys), it returns ok: false with code task_create_outcome_unknown and the key in createKey. In that case check cockpit task list for the task before creating again: the key registry lives in the running app, so after the app quit or restarted a rerun with the same --create-key creates a new task rather than returning the surviving one. Errors whose request never reached Cockpit (connection refused, unknown host) keep task_server_unreachable / host_unreachable.

cockpit task create --instruction "Instruction text" --directory /path/to/repo --create-key deploy-2026-09-05-1
cockpit task create --instruction "Instruction text" --directory /path/to/repo --create-key deploy-2026-09-05-1   # Same task, data.replayed: true
cockpit task run --instruction "Instruction text" --directory /path/to/repo --agent-type codex
cockpit task run --instruction "Review this change" --directory /path/to/repo --agent-type codex --model gpt-5.6-sol --effort high --service-tier fast
cockpit task run --instruction "Instruction text" --directory /path/to/repo --timeout 300
cat instruction.md | cockpit task run --stdin --directory /path/to/repo --agent-type codex
cockpit task run --instruction-file instruction.md --directory /path/to/repo --agent-type codex
cockpit task wait <id>                            # Return the latest report, or block until the next one
cockpit task wait <id> --since <seq> --timeout 110
cockpit task send <id> --text "continue" --wait   # Send a prompt and block until that turn's report
cat message.md | cockpit task send <id> --stdin --wait

Every task keeps a persistent report log. A report is appended when a turn completes, the runtime errors (status: error with the error message — including startup failures), or the task completes. An error report also carries errorCode when Cockpit recognizes the cause. report.seq increases per task. task wait is level-triggered: without --since it returns the latest report immediately when the task is at rest; pass --since <last seq you processed> to block until the next new report. A {"timeout": true} result is normal — re-run task wait to keep waiting, or run it in the background with a larger --timeout for long tasks.

A terminal task created with --command reports once, when that command ends: the report carries waitingReason: terminal_prompt, the command's exitCode, and the end of the terminal output in report.message. Pauses in its output while the command keeps running, such as a dev server's log lines, add no report and send no notice to a Crew parent, so task run, task wait, and task send --wait block until the command exits or the timeout passes. A command that never ends never reports; read its live output with task get, which shows the run's terminalCommandRunId until the command's end is reported. Every report about the command's end carries the same ID in commandRunId. To learn the exit code, Cockpit types the command with a short addition that writes $? to $AGI_COCKPIT_COMMAND_EXIT_FILE, and that addition appears in the terminal: <command>; echo $? > "$AGI_COCKPIT_COMMAND_EXIT_FILE" in sh, bash, dash, ash, ksh, and mksh, { <command> } always { ... } in zsh, <command>; echo $status > ... in fish, and <command>; Set-Content ... in PowerShell. When the command ends the shell itself (exec ..., or exit 7 in PowerShell), the report that the task completed carries the shell's exit code instead. Some shells skip the addition when the command is stopped with Ctrl+C (dash, fish, and PowerShell, for example); such a task then sends no report until its terminal exits or the task is completed. If AGI Cockpit restarts while the command runs, the task reports once after the restart that the command stopped and its exit code is unknown; no such report is added when the log already holds a report with that commandRunId, even after a crash. Cockpit types the command as given, without the addition, when it spans several lines, contains a # (it may start a comment), or does not end in plain text: a trailing ;, &, |, <, >, (, {, an escaped last character such as foo\;, an unclosed quote, or in zsh unbalanced braces. Such a command, and one in a shell not listed above, reports every output pause instead. Once the command has ended, the shell reports like a terminal opened without a command again after the next input typed or sent to it. A terminal task opened without a command reports each time its output pauses.

Ordinary turn-result reports do not inject a prompt into another task or resume a parent task. Approval-waiting and approval-resolved reports are the exception: they also queue a status notification for the existing parent, delivered when it is ready for another turn. Nesting via --parent-task-id identifies that parent and controls the task hierarchy shown in Cockpit. Use task run, task wait <id>, or task send <id> --wait whenever an agent needs a child result.

Option Description Default
--stdin (run) Read the instruction from standard input instead of --instruction -
--instruction-file (run) Read the instruction from a file instead of --instruction -
--timeout Seconds to wait before returning {"timeout": true} 110
--since Return only reports with seq greater than this value (wait only) -

Respond

cockpit task send <id>              # Send Enter for approval or continue
cockpit task send <id> --text "yes" # Send text
cockpit task send <id> --text "2"   # Send a choice number
cockpit task send <id> --text "See this screenshot" --media shot.png
cat message.md | cockpit task send <id> --stdin   # Long or Markdown message, no shell quoting
cockpit task send <id> --text-file message.md     # Same, from a file
Option Description Default
--text Text to send Enter key
--text-file Read the text from a file instead of --text -
--stdin Read the text from standard input instead of --text -
--media Local file to attach to this follow-up. Repeatable. Copied through the same upload store and limits as the GUI (attachments:claim): at most 8 files, 512 MB each (25 MB for .json), 1 GB total. Files are stored unchanged without rejecting extensions or checking their content format or declared MIME type. The source file is never moved or deleted. Delivered as a native visual or Cockpit attachment — not as a path pasted into the text. Not supported with --host -
--wait Block until the task produces a report after this send. For a message that waits in the Queue (see Queue), the report of the turn that message starts -
--timeout (with --wait) Seconds to wait 110
--confirm-memory-guard Send to a task the memory guard stopped, after the user agreed (see Memory Guard) -

A terminal-mode task whose agent is not running, for example after Cockpit restarts, refuses the message with task_not_running (exit 1, details.use is task resume), on this computer and with --host. Nothing is sent; run cockpit task resume <id>, then send again. A completed task cannot be resumed, so it answers task_not_running with Completed tasks cannot be resumed and no details. task_not_found means the task does not exist. A visual or Cockpit Agent task reconnects on its own when you send to it.

Use --stdin or --text-file for anything longer than one line and for anything containing backticks, quotes, $, or a code fence. A message embedded in a double-quoted shell argument is rewritten by the shell before it reaches cockpit: backticked spans run as commands and disappear, and an unbalanced quote aborts the command so nothing is sent.

Queue

When a message reaches a task that is taking a turn, where the message came from decides whether it interrupts the turn or waits. Whether a person or an agent wrote it does not matter.

Where the message came from While the task is working
A Discord, Slack, or Chatwork chat message to a Crew, from a person or from another Crew or bot allowed to talk Interrupts the turn and arrives at once
Anything sent inside Cockpit: a person's message, an agent's cockpit crew send, or a Cockpit notice (a child task's approval wait, a Crew's child-task notices, an Autorun, a periodic check, a secret request's result) Waits in the task's Queue and arrives after the current turn ends

An agent's cockpit task send to an ordinary task is delivered directly, not through the Queue. The exception is an ordinary Antigravity, Cursor, or Qoder task in visual mode that is taking a turn: from the moment it starts preparing a turn until the turn has fully ended, and while it is compacting or its session is starting or stopping, it cannot take another message. A task send to it, from an agent or from a shell outside a task, waits in the task's Queue behind the messages already there and arrives after the current turn ends, once and in order. The command does not wait for that: it answers at once with {"ok":true,"data":{"id","delivery":"queued","queueItemId"}}, which means the message is in the Queue, not that the agent has it. While messages are waiting there, a new task send to that task waits behind them too. With --wait, the command waits for the report of the turn its message starts, not for the report of the turn that was running. A message that leaves the Queue without being delivered (removed, its task completed or deleted, or a delivery that failed or could not be confirmed) makes --wait fail with code: "queued_send_failed" (exit 1); details.state is the item's state (failed, uncertain, cancelled, handled, or missing). When the task is completed or deleted while the message is still on its way into the Queue, for example while its attachments are copied, task send itself fails the same way, with or without --wait (details.state is cancelled or missing), and nothing is queued. Until then the message is in the task's queuedTurns (task get) and in the app's Queue, with state and error. A Crew's own task is not queued this way; a task send to it while it works is refused with an error and nothing is sent.

To deliver a waiting message at once, the owner uses Send now. The owner can edit, remove, and send now a queued message from an agent or Cockpit as well as their own, in the Queue in the app on the desktop or a phone, and with cockpit task queue:

cockpit task queue <id>                                # List the task's Queue
cockpit task queue <id> edit <item-id> --text "..."    # Replace a queued message's text
cat new.md | cockpit task queue <id> edit <item-id> --stdin
cockpit task queue <id> remove <item-id>               # Remove a queued message
cockpit task queue <id> send-now <item-id>             # Stop the current turn and deliver it now
Option Description Default
--text (edit) The new text -
--text-file (edit) Read the new text from a file -
--stdin (edit) Read the new text from standard input -

Every command answers data with the task's Queue after the change: taskId, paused, and items, each with id, kind, state (queued, sending, failed, or uncertain), registeredAt, text, sender, ownerEdited, and error when delivery failed. sender is null for the owner's own message (also cockpit crew send from a shell outside a task), an Ask answer, and a chat message. For a message from an agent or Cockpit it is {"kind","name","taskId"}, where kind is task (an agent's crew send), notice (a Cockpit notice), or autorun (an Autorun's message to a Crew), and name and taskId are present when known. text of an agent's message is its body, without the <task_message> envelope.

  • edit works on a message whose sender is not null. The edited message arrives as the owner's own message, because the owner wrote its last text: Cockpit delivers it without the <task_message> envelope, it counts as the owner for what a Crew's session may do (cockpit help crew), and the app shows the sender's name with Edited by the owner. A Crew's notice that the owner edits arrives as the owner's message, not as a notice. Saving the same text (line endings aside) is not an edit: the message stays the sender's, with the sender's trust. Attachments stay with the message. The owner's own messages are edited in the app, which puts them back in the message box. A task send message (kind: "task-send") from a shell outside a task has sender: null and is not composed in the app: it can be sent now or removed, but not edited.
  • While the app's editor is open on a message, that message waits even when the turn ends, for up to 10 minutes; Cancel lets it go at once.
  • remove takes a message out of the Queue. The sender is not told. An Ask answer that has not started sending is taken back the same way: the task never receives it, and its Ask opens again with nothing filled in. An answer that is sending, sent, or unconfirmed, or a device-connection approval, cannot be taken back (see cockpit help ask).
  • edit does not change an Ask answer. It fails with code: "ask_answer_not_editable" and the remove command to run instead; answer the reopened Ask again. To start again from the previous answer, use Edit on the item in the app's Queue.
  • send-now stops the current turn and delivers the message at once, as Send now does in the app; an Antigravity task in visual mode instead takes the message into its current turn without stopping it (Antigravity's own steering). It works on a message from an agent or Cockpit, a task send message, an Ask answer, and the owner's own message in a Crew's conversation. While the task waits on an approval or a question, it answers queue_action_refused; answer the request first, or use Send now in the app, which asks before cancelling it. A message that the agent cannot take at that moment, for example while an Antigravity, Cursor, or Qoder turn is still starting or already finishing, is refused with the reason and stays in the Queue; nothing is shown as an error in the task's conversation.
  • A chat message from Discord, Slack, or Chatwork cannot be edited or sent now.
  • Only the owner may change or list a Queue. A command that carries a task's identity, which the CLI sends from inside any task, answers owner_only (HTTP 403): this covers a Crew's own session, its child tasks, other Crews, and ordinary tasks. Run task queue from a shell outside a task. --host is not supported (host_not_supported).
  • An item that is no longer in the Queue answers queue_item_not_found (404). A message whose delivery has started, or one the command does not apply to, answers queue_action_refused (409) with the reason in error.

Turn Lifecycle

The turn lifecycle is everything that happens between sending a prompt and the task coming back to rest: a tool-approval prompt, a structured question, the running turn itself, and the thread the turn accumulates. Every one of these is operable from the CLI, through the same main-process implementation the desktop screen uses.

cockpit task get <id>                           # turnRequests: what is waiting, before you decide
cockpit task approve <id>                       # Allow the pending tool approval, this time only
cockpit task approve <id> --scope always        # Allow it and remember the decision
cockpit task deny <id>                          # Reject the pending tool approval
cockpit task answer <id> --text "Option A"      # Answer the pending structured question
cockpit task cancel <id>                        # Stop the running turn; the task survives
cockpit task compact <id>                       # Compact the thread
cockpit task clear <id> --confirm               # Reset the thread (destructive)
cockpit task approval-mode <id>                 # Read the task's approval mode
cockpit task approval-mode <id> full-access     # Change it for this task only

Read turnRequests in cockpit task get <id> before approving. Each entry has requestId, kind (approval or question), requestType (for example command_execution_approval), detail (the command or change being approved, when the runtime supplies it), openedAt, and for questions questions with each question's id, options, multiSelect, allowCustom, and required (when supplied). An empty answer group is accepted only when required is false. It is populated for Cockpit Agent tasks and for visual-runtime tasks, and lists only the requests the runtime still holds, so what you see is what approve and answer can act on.

Option Command Description Default
--request approve, deny, answer Act on this pending request id instead of the oldest one of the right kind Oldest pending request
--scope approve once allows this call only; always remembers the decision when supported; MCP tool confirmations (mcp_elicitation) always use and report once once
--text answer One single answer per question, repeated in question order -
--question answer Start the answer group for this question id -
--choice answer Add a value to the current --question group; repeat for a multi-select question -
--confirm clear Required. Clearing discards the conversation -
--confirm-memory-guard approve, deny, answer, compact, clear Act on a task the memory guard stopped, after the user agreed (see Memory Guard) -
--mode approval-mode supervised, accept-edits, auto, or full-access (Muse Code: accept-edits or full-access); also accepted positionally. A mode the agent does not support fails with task_approval_mode_unsupported Read-only without it

approval-mode returns data.approvalMode, the task’s selected policy, and data.supportedApprovalModes for the task's agent. auto hands approval to the agent's native reviewer: Claude's auto permission mode, Codex's auto_review approvals reviewer, or Grok Build's auto permission mode. The reviewer allows routine actions, blocks risky ones, and still sends an action to the task's approval queue when it needs a person; it never answers questions or Asks. A Claude change applies at once. A Codex change applies from the next turn. A Grok Build change into or out of auto restarts the idle session and keeps the conversation; while Grok Build is still working (a turn, a pending request, or background work), the change fails with an error and the current mode stays. In every other mode Grok Build is started with its prompting default permission mode, so Cockpit's approval mode applies whatever the Grok Build config sets. When Claude or Codex cannot run in auto (for example its model, account, or organization does not allow it), Cockpit switches the task to the mode actually in effect and posts a notice in the chat. Cockpit cannot read back the mode Grok Build runs in, so this check does not cover Grok Build. Cockpit never falls back to full-access. For Antigravity, this selection is the policy for new turns: restrictions also narrow the running turn immediately, while increased access waits for a new turn. Its running turn can therefore remain more restricted than the selected policy; a steering message does not widen it.

On Windows, Codex runs commands in its own sandbox in every mode but full-access. Cockpit leaves project folders on a network drive (a shared drive or a UNC path) out of the folders that sandbox may write to, but still tells the agent their paths as it does for the project's other folders. Codex's elevated sandbox runs commands as a separate user with restricted network access, so a command that only reads such a folder can also fail or wait for approval. When Codex cannot run commands inside its sandbox and reports setup refresh had errors, for example because the working folder itself is on a network drive, Cockpit posts a notice in the chat; move the folder to a local drive, switch the task to full-access, or set sandbox = "unelevated" under [windows] in config.toml in Codex's home folder (CODEX_HOME, ~/.codex by default; a Codex account added in Cockpit has its own). The sandbox can also keep a Crew from running cockpit to reply. A new Codex Crew on Windows therefore starts in full-access, and a Crew in auto that switches to Codex there takes full-access (see cockpit help crew); a task still starts in the mode it is created with or the default from Settings.

Every command answers ok: true with data.runtime (visual-runtime or cockpit-agent) and data.agentType; the request commands add the data.request that was acted on and data.remaining pending requests. deny selects only approval requests. MCP form elicitations are questions: fill them with answer, or decline them in the desktop or PWA question card. deny takes no --scope and no message: neither runtime accepts a scoped rejection or a rejection reason, so explain a refusal with cockpit task send <id> --text "..." after denying.

compact and clear refuse a task whose turn is still in flight — running, or parked on an approval or a question (task_turn_in_flight, exit 3) — exactly as the desktop screen does, because both would interrupt that work. Wait for the turn, answer the prompt, or cancel it first. clear also resets the conversation in every open desktop and mobile view of the task and hides the original instruction from then on, including in task get; a message someone is still typing in another window is kept. A successful clear starts a new conversation, so it also resets sessionUnrecoverable, errorMessage, and the consecutive failure count left by the previous conversation.

When the caller is itself a Cockpit task, the decision is attributed to that agent (lastSentBy: "agent"), not to the human operator.

Which Tasks Have A Turn Lifecycle

  • Claude, Codex, Grok Build, and Muse Code in visual UI mode: all seven commands. For Muse Code, approve --scope always uses the narrowest persistent rule Muse Code offers for that request (a session-scoped rule when no persistent one is offered), and deny rejects the call; Muse Code reports the rejected call to the model and the turn continues. Muse Code asks about each stage of a shell command (a | b, a && b, a; b) separately; one approve covers every stage of the command shown in detail, and deny rejects the whole command.
  • Cursor and Qoder in visual UI mode: every command except answer, which is refused.
  • Antigravity in visual UI mode: cancel, compact, clear, approval-mode, approve, and deny; answer is unsupported here. Native interaction_* questions are cancelled instead of being treated as tool approvals.
  • Cockpit Agent: every command except compact and clear, which are refused.
  • Any agent in terminal UI mode, and the terminal agent: none; all seven are refused.

A refused command answers turn_lifecycle_action_unsupported, or turn_lifecycle_unsupported for a terminal-mode task, and exits 1. This integration does not expose structured questions for Antigravity, Cursor, or Qoder, and a terminal-mode task has no approval prompt, no cancellable turn, and no thread: its agent runs inside a pty and is driven with cockpit task send. No combination answers a silent success.

Exit Codes

  • 0: the operation was applied, for example the approval was released.
  • 1: the command cannot apply as written, for example a missing --confirm, an unknown task, an invalid mode, or a refused combination.
  • 3: the task is not in that state right now, for example nothing is pending, no turn is in flight, a turn is still running, or the runtime could not be queried.
  • 7: AGI Cockpit could not be reached.

A 3 can succeed if you run it again later; a 1 cannot. Exit 3 codes: task_no_pending_approval, task_no_pending_question, task_no_active_turn, task_turn_in_flight, task_request_not_found (including a request the runtime no longer holds), task_request_kind_mismatch, task_requests_unavailable (the runtime could not be queried, so the task's state is unknown), and memory_guard_confirmation_required (see Memory Guard). Exit 1 codes: turn_lifecycle_unsupported, turn_lifecycle_action_unsupported, task_not_found, task_clear_confirmation_required, task_approval_mode_invalid, task_answer_required, task_answer_count_mismatch, task_answer_question_not_found, task_answer_multiple_not_allowed, task_answer_choice_invalid, task_answer_unsupported_request, and task_owned_by_crew (the task is a Crew's internal task; resume, retry-start, reconnect, goal start, and goal resume exit 1 with it too; only the owner's own tasks (including the former master) may approve, deny, or answer what a Crew waits for, see cockpit help crew). Errors about pending requests carry details.pending with each request's id, kind, type, and detail.

Answering Questions

Answer every question the request asks. For single-answer questions, pass one --text per question in the order they were asked. For a multi-select question, or to name questions explicitly, give each question its own --question <questionId> group with one or more --choice values. --text and --question cannot be combined.

cockpit task answer <id> --text "Yes"
cockpit task answer <id> --text "Yes" --text "Use the staging database"
cockpit task answer <id> --question env --choice staging --choice production --question confirm --choice Yes
cockpit task answer <id> --request req_8f21 --text "Yes"

Answers are validated against the question before anything is sent: a single-answer question rejects several values (task_answer_multiple_not_allowed), and a question that does not allow custom input rejects a value that is not one of its option labels (task_answer_choice_invalid, with details.choices). A wrong count fails with task_answer_count_mismatch and details.questions, so one extra call tells you what to send. task answer answers the runtime's own structured question; a question raised with cockpit ask is answered with cockpit ask answer.

Agent Goal

An Agent Goal is a persistent objective the agent keeps working toward across turns. The desktop screen starts one with /goal; the CLI starts the same goal through the same main-process implementation.

cockpit task goal start <id> --objective "Make the test suite pass"   # Short objective
cockpit task goal start <id> --objective-file goal.md                 # Long objective from a file
cat goal.md | cockpit task goal start <id> --stdin                     # Long objective from standard input
cockpit task goal resume <id>                                         # Resume the same blocked goal (Codex chat view)
cockpit task goal resume <id> --confirm-memory-guard                  # From a task, after the user agreed, when the memory guard stopped it
cockpit task get <id>                                                 # Read the current goal: `goal` and `goalCommandAvailable`

Starting a goal sends the agent's goal command with the objective as a user message, so the task moves to running like any other prompt. There is no stop or clear command, on the CLI or in the app: a goal ends when the agent completes it or the thread is cleared. task get and task list --full report the current goal as goal (absent or null when none) and goalCommandAvailable.

Error code Meaning
task_goal_objective_required The objective is missing or blank (exit 1)
task_goal_unsupported The agent does not support goals, or the running session has not announced its goal command yet (goalCommandAvailable: false) (exit 1)

On a task the memory guard stopped, a task or Hook adds --confirm-memory-guard after the user agreed (see Memory Guard).

goal resume continues a goal whose state is blocked in the same task, conversation, and agent thread, keeping its objective, token budget, and usage; it is a different operation from goal start (a new objective) and resume (restart a stopped session). The desktop and mobile screens show the same Resume goal above the message box. It is available for Codex tasks in chat view that are not completed; the agent's goal capability reports it as blockedResume, and resuming a goal never brings back a completed task. Cockpit reads the goal from the running agent first and changes only its state, so the objective and budget are never reset. Cockpit reports success only after Codex answered or read back the same goal as active, and goal is its state right after, which can already be blocked or complete again when the next turn ended quickly. The agent then starts the next turn itself, and Cockpit never sends a turn of its own: the answer { id, resumed: true, turnStarted, goal } reports turnStarted: false when no turn started; send a message to continue. Only you, or a task working on your request, can resume a goal. Cockpit, your own shell outside any task, and a Crew task whose current turn comes from your request (a Crew working on your message, or a child carrying ownerRequest; Cockpit decides this from the authenticated task and its current turn, never from request fields) may resume it; any other task, an automatic Crew turn, and a Hook are refused, and Cockpit checks this again just before it changes the goal. Like a message, a resume also resumes a task the memory guard stopped; a task adds --confirm-memory-guard after the user agreed (see Memory Guard).

Error code Meaning
task_goal_resume_owner_required Sent by a Hook, or by a task that is not working on your request (exit 1)
task_goal_resume_unsupported Not a Codex task in chat view, or the running Codex cannot read goals (exit 1)
task_goal_resume_no_goal The task has no goal (exit 1)
task_goal_budget_exhausted The goal has used its token budget (exit 1)
task_goal_not_blocked The goal is not blocked; details.state names its state. An active goal is already running, and a completed or limited goal is not resumed (exit 3)
task_goal_resume_busy A turn is running or waits for an approval or a question (exit 3)
task_goal_resume_in_progress Another resume of this task has not finished (exit 3)
task_goal_resume_interrupted While it waited, the task got a message or a steer, was cancelled, cleared or stopped, got a new or different goal, or moved to another session; nothing was changed (exit 3)
task_completed The task is completed, or was completed while the resume waited (exit 3)
task_goal_resume_unconfirmed The agent's answer was lost and reading the goal back did not prove it resumed. Nothing is retried; check task get before trying again (exit 1)

Finish And Clean Up

cockpit task complete <id>                 # Stop the process and move the task to completed. Worktrees are deleted automatically
cockpit task complete <id> --keep-worktree # Complete but keep the worktree
cockpit task remove <id>                   # Remove from Cockpit (complete + delete)
cockpit task resume <id>                   # Resume the session for a stopped task
cockpit task resume <id> --fresh-session   # Start a new conversation in this task, seeded with a summary of the previous visual history
cockpit task resume <id> --confirm-memory-guard # Resume a task the memory guard stopped, after the user agreed
cockpit task retry-start <id> --directory /path/to/folder # Choose a different working folder before retrying
cockpit task retry-start <id>              # Launch a task whose agent process never started (`startFailed: true`), with its saved prompt
cockpit task retry-start <id> --instruction-file prompt.md   # Same, replacing the saved prompt (or `--stdin`; a terminal task replaces its command)
cockpit task reconnect <id>                # Restart the agent process of a visual task in place, keeping its conversation (after signing the account in)
cockpit task reconnect <id> --confirm-memory-guard # Same for a task the memory guard stopped, after the user agreed (also on `retry-start`)
cockpit task rename <id> --name "New name" # Rename the task

A completed task continues when it receives a message: send one in its conversation, or run cockpit task send <id> --text "<message>". resume refuses a completed task (task_completed). When a task completes another task, the completed task's conversation and the OS notification name the caller, and task get returns it as completedBy.

remove also deletes the task's worktree. It has no --keep-worktree: given that option, it removes nothing and answers invalid_arguments with a pointer to cockpit task complete <id> --keep-worktree.

complete and remove leave the worktree in place when another git worktree of the same repository is inside it, or when the folder at its path is no longer the worktree the task created (for example, it was moved with git worktree move and a new worktree was made at the old path). The task is still completed or removed; like other worktree cleanup errors, the reason appears only in the app's main-process console output. Tasks created before Cockpit recorded which worktree they created are checked only for a worktree inside.

Deleting all completed tasks from the task list on the desktop or in the PWA (whether or not the desktop is open) deletes the tasks with their conversations, reports, uploads, and other task files, but leaves each task's Git worktree as it is: the folder, its registration in the original repository, and any uncommitted or untracked files in it. Deleting from the PWA also deletes a task's own temporary workspace folder unless a project or another task still uses it; deleting from the desktop keeps that folder. cockpit task remove on a single task still deletes its worktree, as described above. The confirmation and the result in the list say how many of the tasks have a Git worktree that stays. Cockpit never deletes these worktrees later on its own.

To clean them up later, ask a Crew on that PC to check them first and to delete only what the user names:

  1. List the worktrees still registered in the original repository: git -C <original repository> worktree list.
  2. Look at what each folder actually holds, and list its uncommitted and untracked files: git -C <worktree> status --short.
  3. Check whether another task still works there: cockpit task list --all --directory <worktree>. The list comes in pages of up to 100 tasks by default; while page.hasMore is true, run the same command with --cursor <page.nextCursor> until the last page.
  4. Remove each worktree the user explicitly names, one at a time: git -C <original repository> worktree remove <worktree>. Git refuses a worktree that still has uncommitted or untracked files; force it only when the user has chosen to discard them.

日本語:デスクトップまたは PWA のタスク一覧で完了済みタスクをまとめて削除すると(PWA ではデスクトップが開いているかどうかに関係なく)、タスクとその会話・報告・アップロードなどのファイルは削除されますが、各タスクの Git の作業フォルダ(worktree)はそのまま残ります。フォルダ、元のリポジトリへの登録、未コミット・未追跡のファイルも残ります。PWA から削除すると、プロジェクトや他のタスクが使っていない限り、そのタスク専用の一時作業フォルダも削除します。デスクトップから削除した場合は、そのフォルダを残します。単件の cockpit task remove は従来どおり worktree も削除します。確認と一覧の結果には、worktree が残るタスクの件数が表示されます。Cockpit がこれらの worktree を後から自動で削除することはありません。

後で整理する時は、その PC の Crew に先に確認してもらい、本人が明示したものだけを削除します。

  1. 元のリポジトリに登録されている worktree を一覧する:git -C <元のリポジトリ> worktree list
  2. 各フォルダの実際の中身と、未コミット・未追跡のファイルを確かめる:git -C <worktree> status --short
  3. 他のタスクがまだそこで作業していないか確かめる:cockpit task list --all --directory <worktree>。一覧は既定で 1 ページ 100 件までです。page.hasMore が true の間は、同じコマンドに --cursor <page.nextCursor> を付けて最後のページまで読みます。
  4. 本人が明示した worktree だけを 1 つずつ削除する:git -C <元のリポジトリ> worktree remove <worktree>。未コミット・未追跡のファイルが残る worktree は Git が削除を拒みます。それらを捨てると本人が決めた時だけ強制します。

resume and retry-start are different operations. resume restarts the stopped session of a task that has already run at least once (needsResume: true). retry-start launches a task that never ran because its agent process failed to start (startFailed: true), reusing the same task and its saved prompt exactly as the desktop retry does; a retry that fails again keeps the task retryable. Each command refuses the other's state with exit 3 and an error naming the command to use (task_launch_failed -> use retry-start; task_not_launch_failed -> use resume), and both refuse a completed task (task_completed, exit 3). task_start_retry_unavailable (exit 3) means there is nothing to retry: the task did not fail to launch and has no stopped session to resume (normally because it is live). A retry-start whose launch fails again answers task_start_failed (exit 1) with details.retryable: true; when the failure is reported later by the runtime, the command succeeds and task get shows startFailed: true again. Either way the task keeps its prompt and can be retried.

retry-start --directory changes the working folder only for an unstarted standalone task. The folder must already exist. Existing sessions, branches, child tasks, master tasks, and worktrees cannot change folders through retry. The prompt and attachments are retained; the task is reassigned to the project containing the new folder, if any. Missing folders are never created automatically.

An agent starts again only in a working folder that still exists. When send, resume, resume --fresh-session, or reconnect would start an agent whose folder is missing or cannot be opened, nothing starts, the task keeps its session, and the error says Working folder not found (<path>) or Can’t open the working folder (<path>). Reconnect the folder or network drive and run the command again, or continue in a new task in another folder.

A failed branch whose source is running (including an approval or question wait) requires fresh confirmation on every retry. After confirming with the user, pass cockpit task retry-start <id> --confirm-stop to stop the source before starting the child. Without the flag it returns branch_stop_confirmation_required (exit 3) and leaves both tasks unchanged. Desktop and PWA ask for this confirmation when needed. Stop consent is never saved in the task's launch settings.

reconnect is the third, separate operation: the desktop's sign-in retry. A visual task whose agent reports an authentication error mid-session keeps its process alive, so needsResume stays false and resume reports alreadyResumed: true without restarting anything. After signing the account in, cockpit task reconnect <id> restarts that agent process in place through the same per-agent retry the desktop uses, resuming the existing session (sessionId) for every visual agent so the conversation continues; a task that never got a session starts from its saved prompt. It only applies to a task running in visual UI mode (task_reconnect_unsupported, exit 1, otherwise), refuses a task that never started (task_launch_failed -> use retry-start) and a completed task (task_completed), both exit 3, and, like compact and clear, refuses to interrupt a turn that is running or parked on an approval or question (task_turn_in_flight, exit 3, with details.pending) — a sign-in error finishes its turn, so the legitimate case is never in flight. A reconnect whose process cannot start again fails with exit 1 and the runtime's own message; resume --fresh-session remains the way to start over without the previous conversation.

To keep a task's conversation and let it carry on as a resident Crew, turn it into one with cockpit crew create --from-task <id> (cockpit help crew).

Do not complete or remove tasks unless the user explicitly instructs you to do so.

complete interrupts a turn that is still running or waiting on an approval or a question. When the task is an active Fleet node, Fleet records that as a user interrupt: the node becomes interrupted with failureReason: user_interrupt, the Run pauses, and no output_contract correction turn is sent. Output the node had already submitted with cockpit fleet output is kept and the node completes. Completing a task whose turn has already finished is an ordinary completion.

A visual Grok Build, Antigravity, Cursor, or Qoder turn whose agent sends nothing for 18 minutes ends with waitingReason: runtime_error and errorReason: "stalled". Cockpit stops the process so the next message reconnects to the conversation. Waiting on an approval, a question, a background task, or a running tool does not count as silence. A turn always ends after 12 hours, including those waits, without a retryable errorReason. A turn Cockpit stops, for example with task complete, is recorded as interrupted.

Antigravity confirms native default at start and resume through an advertised mode config option, otherwise session/set_mode. If default cannot be confirmed, startup stops. Approval Auto is unsupported for Antigravity; saved Auto uses Supervised. Cockpit applies a separate turn policy: Supervised asks; accept-edits can approve known edit requests; full access additionally covers known commands. Every automatic permission requires a known request kind and allow_once; missing once requires an explicit decision or denial, and Always is only an explicit human choice. Policy changes do not switch native mode. Restrictions apply immediately; increased access starts with the next new turn. Native steer sends a prompt into the running turn without canceling or restarting it and cannot widen that turn's policy. Native sessions resume without replay. Legacy print-mode conversations keep their saved history and start a new ACP session; the first accepted prompt carries readable history as context, with omissions disclosed. An unreadable conversation blocks migration instead of starting empty.

Antigravity account auto, including legacy task, Autorun, Fleet, and shared caller selectors, means the fixed default account. No automatic account rotation or usage-limit agent switching uses Antigravity.

Memory Guard

On macOS, Cockpit's memory guard (memoryGuard.mode, see cockpit help settings) acts only when the Mac is really short of memory and one of Cockpit's processes keeps growing. It stops one thing at a time. When a process a task started is what grows, such as a test runner or a dev server, it stops that process and its child processes that are at least 2 minutes old (SIGTERM, then SIGKILL five seconds later, each only after reading the process again to make sure its PID still belongs to it), and the task keeps running: memoryGuardStop.scope becomes process, a visual or Cockpit Agent task shows a notice in its chat, a terminal-mode task shows it above the terminal, and the agent is told before the next message. When the task's agent itself is what grows, or a stop in the last 30 minutes already ended every process it targeted in the same task, it stops the task as described next. Right before it holds the task, it reads the processes again and leaves the task alone when memoryGuard.mode is no longer stop, when the reading fails, or when the process that grew is gone; after a failed reading or a gone process it waits 2 minutes before trying again. It never stops a Terminal task, a task excluded with task memory-guard <id> off or Exclude from memory guard in the task's menu, Cockpit itself, the in-app browser, or shared servers such as the Codex app server. Each stop shows a desktop notification, following the notification settings; when it stops a Crew, the Crew's owners also get a Discord or Slack DM saying so (see cockpit help crew). On Linux and Windows the memory guard does not run.

When Cockpit's memory guard stops a task to keep the Mac responsive, the task is not completed: it stays waiting_confirmation with waitingReason: memory_guard, keeps its conversation and session, and records the turn that was running as interrupted. memoryGuardStop in task get says what used the memory, and the task's report carries the same reason in report.message.

Nothing restarts the task on its own, including after Cockpit restarts. Autorun deliveries and Fleet prompts wait for it, Talk Room messages are refused with task_not_resumable (a wake skips it as memory_guard), queued messages and Ask answers wait (for a Crew, only the owner's messages that arrive after the stop are delivered), and opening the task in Cockpit or reading its history does not start its agent. A person resumes it with Resume on the task, with cockpit task resume <id>, or, for a visual or Cockpit Agent task, by sending it a message; starting or resuming a goal, approving, answering, compacting, or clearing resumes it too. A terminal-mode task refuses messages until it is resumed. A resume or reconnect succeeds only once the agent has started again; when it cannot start, the task stays stopped and the command fails with the reason. A resume, reconnect, or message that arrives while the guard is still stopping the task waits for the stop to finish; while the stopped agent's processes have still not ended, it is refused with a message to try again, and the task stays stopped. The first message after the stop tells the agent of a visual or Cockpit Agent task, in a note before that message that only the agent sees, why its previous turn stopped; the conversation shows the message as it was written. A terminal-mode task shows the notice only on screen.

When a task, or a command a Cockpit Hook runs, sends to, resumes, reconnects, retries, starts or resumes a goal in, approves, denies, answers, compacts, or clears a task in this state, the command fails with memory_guard_confirmation_required (exit 3) and nothing happens. Ask the user first, then repeat it with --confirm-memory-guard. A command you run yourself outside any task and any Hook needs no flag. Sending a queued message now (task queue <id> send-now) is refused with memory_guard_held (exit 1) until the task is resumed.

cockpit task memory-guard <id>       # on: the guard may stop this task; off: it never does
cockpit task memory-guard <id> off   # Exclude work that is meant to use much memory, such as a local model
cockpit task memory-guard <id> on    # Include it again

memory-guard answers data.memoryGuard (on or off); task get shows an excluded task as memoryGuardExcluded: true. Any other value answers invalid_arguments, and a Crew's own task answers task_owned_by_crew. On macOS the same switch is Exclude from memory guard (and Include in memory guard) in the task's menu in the task list; an excluded task still counts toward the memory guard's notifications.

Task Project

cockpit task project <id>                          # Read the task's project
cockpit task project <id> <id|name>                # Move the task and its child tasks to another project
cockpit task project <id> --project <id|name>      # Same, with an explicit option

Returns id, projectId, and the full project; both are null for a task outside every project. Moving also moves the task's child tasks and lists every moved task in movedTaskIds. The agents use the new project's folders from their next session. Master Agent and Creative Studio tasks do not belong to projects and fail with task_not_movable. Project names are matched as in cockpit help project, including ambiguous_project and project_not_found.

Switch Task Account

cockpit task account <id>           # Show the account the task runs on
cockpit task account <id> work      # Switch to the account named "work" (name or profile id from `cockpit accounts`)
cockpit task account <id> default   # Switch back to the default account

Switching works mid-task for Claude, Codex, Grok Build, Antigravity, Cursor, and Qoder tasks: the running session stops, its transcript moves to the target account, and the same session resumes there. The target account must be signed in. If the previous turn stopped with waitingReason: "usage_limit", send a prompt after switching to continue the work on the new account.

Switch Task Model

cockpit task model <id>
cockpit task model <id> <model> [--effort <effort>] [--service-tier standard|fast|ultrafast]

The GET form reports the effective model, effort, and serviceTier, using the same fields as task get. Use this command to change the --model, --effort, and --service-tier selection after task create.

A switch preserves the conversation and runtime. It takes effect when the next turn is sent; an in-flight turn keeps its current model. No restart or --fresh-session is needed. A successful switch clears the task's usage-limit waiting state so you can send another prompt or retry a Fleet message node.

Claude, Codex, Antigravity, Cursor, Qoder, Grok Build, and Cockpit support model selection in their visual runtime. Terminal tasks and terminal agent runtimes reject this command. Resume completed tasks before switching. Models are validated against the agent's available catalog; invalid choices return the valid options. To move a visual task to another supported agent, add --agent-type (see Switch Task Agent).

--effort and --service-tier use the same validation as task creation. Without --effort, an effort encoded in a model alias takes precedence, then a supported current effort is retained; otherwise the new model's default is selected and reported in effortFallback: { previous, selected } alongside the effective selection. selected is null for models without effort controls. Service tier is Codex-only: an explicit fast or ultrafast tier that the new model does not offer is rejected, and an omitted tier falls back to standard when the new model does not offer the current tier.

Claude effort changes (including automatic fallback) are saved for the next session start. Its current SDK query keeps the effort chosen when it started; task model returns effortAppliesOn: "session_restart" to distinguish the saved effort from the running effort. The model itself still changes on the next turn without restarting.

Switch to the Default Model

cockpit task switch-to-default-model <id>

Use this when a task stopped because its agent rejected the model, reported as errorCode: "model_not_found". It is the same action as Switch to Codex default in the conversation. It clears the model saved on the Crew or Autorun that owns the task, moves the task to the default, and sends the failed message again. Codex uses the default it reports, and the task records that model because a Codex thread leaves a rejected model only when the next turn names another one. Other agents use the default from Settings.

The response has model (the model the task now uses), scopes (task, crew, autorun), and retried. When retried is false, the model still changed and retryBlockedBy says why nothing was sent: attachments (the failed message or first instruction had attachments), unidentified (Cockpit cannot tell which message failed, for example after a restart), or turn_started (another turn started meanwhile). Send the message again yourself for the first two. A retried message keeps who sent it, so a Crew member's request stays a member's request. On a Crew's internal task the owner may run this command; a Crew may run it only on its own task, in a turn that can change its model, and a Crew's child task cannot run it. Cockpit-agent, terminal, running, and completed tasks reject this command. So does a task with no session that was not kept for a retry (no startFailed: true), such as one from task create whose agent failed to start for a reason other than the model: it answers task_has_no_session and nothing changes, so create a new task. To pick a specific model instead, use cockpit task model <id> <model>.

Switch Task Agent

cockpit task model <id> gpt-5.6-sol --agent-type codex             # Claude Code task -> Codex on the next send
cockpit task model <id> claude-opus-4-8 --agent-type claude    # Codex task -> Claude Code on the next send
cockpit task model <id> <current-agent-model>                   # Cancel a scheduled switch

--agent-type claude|codex|grok|cursor|qoder|antigravity|cockpit with a model of another agent schedules an agent switch in the visual UI. The response keeps the current agentType, model, effort, and serviceTier and adds pendingAgentSwitch; --effort and --service-tier apply to the new agent's model and use the same validation as task create. Choosing a model of the current agent, with or without --agent-type, cancels the scheduled switch. Fleet, Autorun, and Master Agent tasks, terminal-UI tasks, and tasks that are running or waiting on an approval or a question reject the switch and name the reason. A Crew's internal task switches only to an agent a Crew can use; another agent answers crew_agent_unsupported. Switching it changes the Crew's agent instead of scheduling a switch for the next send (see cockpit help crew). On Windows, switching a Crew in auto to Codex makes it full-access, so this command answers owner_confirmation_required when the Crew's own session runs it; the owner can still switch it. As with other model changes, resume a completed task before scheduling a switch; on a completed task, a model of the current agent only cancels a scheduled switch and leaves the model unchanged.

The switch runs on the next task send (or desktop/mobile send), before the message is delivered:

  • The conversation is carried over: messages, every tool call with its input, output, exit code, and status, file changes, images, and the agent's own compaction summaries. A note before the carried-over part names the agent and model that produced it. Thinking and encrypted reasoning are not carried over.
  • Returning to an agent the task used before resumes that agent's own session (a Claude Code session is duplicated first, so the original transcript stays untouched) and adds only what happened while it was away. An agent used for the first time receives the history since the task's conversation last restarted. If the earlier session cannot be resumed, a new session receives the full history instead of starting empty.
  • Codex receives the history through thread/inject_items. Claude Code receives a synthesized session transcript that is checked with the Claude Agent SDK before it is resumed; when Cockpit's startup self-test cannot read such a transcript for the installed Claude Code version, the history is passed as one context message instead. agentSessions[].transplant.method records codex_inject, claude_session_file, or claude_message.
  • Grok Build, Antigravity, Cursor, and Qoder receive an embedded history resource on the next prompt when supported, otherwise plain text; images require advertised image support and an unsupported image rolls back the switch before delivery, leaving the previous agent active and the switch cancelable. Their native sessions are resumed on return. Qoder JSONL and Grok Build multi-file session synthesis are not used because a compatible, consistent native import cannot be verified through their supported interfaces. The method is embedded_resource.
  • Cockpit reads all OpenCode message pages and appends the history with session.prompt({ noReply: true }), preserving images without generating a reply. The method is opencode_message. These targets receive one history message, which the preview explains.
  • ACP/Antigravity history is reduced deterministically when necessary: shorten long tool outputs first, keeping every conversation message; then retain the first request, initial exchanges, and recent exchanges, replacing the middle with an explicit omitted-item count. No model summarizes it. The preview and divider report shortened outputs and omitted messages, tool calls, images, and summaries. A conservative UTF-8 byte estimate plus image allowance reserves 30% of the model context for instructions and the new turn; existing context is deducted on resume. If the reduced history cannot fit in the earlier session’s remaining allowance, a new session receives the full history and the preview/divider explain that decision. Known model context metadata is used when discovery is unavailable. If the first and latest exchanges cannot fit, the switch fails with an explanation.
  • Claude Code and Codex still receive the full history and use their own compaction before the new message is sent.
  • The conversation, including earlier turns, is sent to the new agent's provider (OpenAI for Codex, Anthropic for Claude Code).

If the switch fails, the message is not sent, the task stays on its previous agent, and pendingAgentSwitch remains so the next send retries; cancel it with a model of the current agent. When an earlier part of the conversation cannot be read (for example a transcript removed by the agent's retention cleanup), the rest is carried over, a note tells the new agent that part is missing, and agentSessions[].transplant.omittedParts counts it. When the conversation being left, or all of it, cannot be read, the switch fails with an error; the new agent never starts without it. Pending first-prompt history is retained after a rejected submission and is confirmed only by a prompt response or a conversation update. Older Antigravity tasks reuse available display history and disclose gaps; unreadable images or torn log entries do not discard readable messages. If ACP replay changes its saved boundary, all available history is carried over with an overlap/missing-history note. Confirmed history is not deliberately delivered twice.

Browser Identities

cockpit task browser-identity <id>                   # Show the task's assigned Browser Identities
cockpit task browser-identity <id> work              # Replace the assignment with this one Identity (name or id)
cockpit task browser-identity <id> default           # Return to only the Default Identity
cockpit task browser-identity                        # Show the calling task's assignment
cockpit task browser-identity work                   # Replace the calling task's assignment
cockpit task browser-identity --add work             # Also assign work to the calling task
cockpit task browser-identity <id> --add work        # Also assign work to another task
cockpit task browser-identity --primary work         # Use work when a browser command names no Identity
cockpit task browser-identity --remove work          # Unassign work
cockpit task browser-identity --task-id <id>         # Explicitly inspect another task from task context

A single value without an option is read as a task id first: when a task has that id, the command shows its assignment and changes nothing; otherwise, from a task, it replaces the calling task's assignment with that Identity. Outside a task, a single value is always a task id. With --identity, --add, --remove, or --primary, a value given before it names the task to change, and without one the calling task changes. --task-id <id> names the task explicitly: with an Identity value or one of those options it changes that task, and alone it only reads.

A task can use several Browser Identities at once. Each Identity keeps its own browser sessions and tabs, so cockpit browser open <url> --browser-identity work and cockpit browser open <url> --browser-identity personal work side by side without changing the assignment. The primary Identity is used by browser commands that do not pass --browser-identity; tasks created without --browser-identity start with only the Default Identity as primary. Use at most one of --identity, --add, --remove, and --primary per command, once: combining them fails with option_conflict, and repeating one fails with option_repeated. --add and --remove do nothing when the Identity is already assigned or unassigned; --primary also assigns the Identity when needed; the primary Identity cannot be removed until another one is made primary. The JSON result reports identity (the primary Identity), identities (every assigned Identity, primary first), previousIdentity (the primary before the change), and changed. The task's browserIdentityId field holds the primary Identity id (absent for Default), and browserIdentityIds lists every assigned id when more than one is assigned.

Removing an Identity, or replacing the assignment, detaches the browser side panel only when it shows a session of an Identity that is no longer assigned; the panel then shows the primary Identity. Existing sessions stay with their original Identity and become available again when the Identity is assigned again. No operation copies or deletes cookies, cache, localStorage, or other browser data between Identities. Use cockpit browser identity list --json to discover names and ids.

Remote Devices

Task commands support --host; configure aliases with cockpit devices first, then target a remote Cockpit. --host can be placed before or after the subcommand, following the command family. The same remote options are available for autorun, accounts, fleet, hooks, and ask list/answer/close, and for reading Crews and projects and sending to Crews (crew list/get/status/invite-url/channels/groups/send, project list/get), which go through this computer's Cockpit.

cockpit task list --host build-host
cockpit fleet list --runs --host build-host
Option Description Default
--host Target remote device via sync server: its full name, an alias, a device name from cockpit devices, name:port, or an http:///https:// address -
--port Remote sync server port; wins over the port in --host name:port 47280
--https Use HTTPS for the remote sync server true

Over HTTPS the certificate is issued only for the full name of the device (<machine>.<tailnet>.ts.net: httpsDomain in cockpit remote-access status on that device, or host in cockpit devices), so --host must reach that name. The CLI replaces a saved alias first, then the name of this computer or of a device in cockpit devices with its host; a name with a dot, an address, and an http:///https:// address are used as given, and a name that matches nothing is used as given. A certificate issued for another name answers tls_name_mismatch with the names it is issued for, instead of host_unreachable. --host 127.0.0.1, localhost, or ::1 over HTTPS answers host_is_self: commands on this computer need no --host; to try the remote route, pass the full name of this computer.

Guidance

  • Prefer delegating implementation work to Cockpit tasks when the user asks for orchestration or parallel work.
  • Create tasks sequentially unless there is a clear reason to fan out.
  • Inspect task output before responding to a waiting task; increase --turns or --max-lines when context is insufficient.
  • Keep user-facing summaries concise and report unverified work plainly.