dispatch
Purpose and behavior
Section titled “Purpose and behavior”Run a brief in a sandbox allocated for this call, apply the selected workspace policy, then close the sandbox. For Git, the default is current for mounted execution and integrate for remote execution; named retains a branch without merging. File workspaces use their retention and publication policies. On failure, recovery details identify retained work. With passes above 1, execution stops once a completion marker matches. A workspace guard checks the synchronized committed diff before integration and retains refused work.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”Variant 1 — FileDispatchRequest<T>
Section titled “Variant 1 — FileDispatchRequest<T>”The fields below cover all variants; the signature specifies their allowed combinations.
optionsRequiredFileDispatchRequest<T>Sandbox settings (repository, branch, provider, hooks) combined with the agent, brief, response contract and limits.options.hooksOptionalLifecycleHooks | undefinedDeclared workspaceReady, hostReady and sandboxReady preparation commands.options.limitsOptionalPick<StageLimits, "copyMs" | "collectMs"> | undefinedCopy and collection deadlines for file execution; Git preparation and integration limits are refused.options.observationOptionalObservationHub | undefinedExplicit observation hub preserving scoped delivery and synchronous usage accounting.options.loggingOptionalLogging | undefinedDeclared execution journal; replayable file effects are refused when reproduction is unsupported.options.activityTransportOptionalTransport | undefinedTransport for bounded resource activity observations; liveness does not authorize recovery.options.recoveryTransportOptionalTransport | undefinedExplicit Transport retaining sandbox recovery evidence independently of file snapshots.options.sandboxProviderRequiredSandboxProviderExecution provider with the required file binding capability; legacy providers remain usable for Git.options.agentRequiredCliAgent | CustomAgent | ReplayAgent | FallbackAgentExplicitly composed agent compatible with the selected file execution and conversation capabilities.options.signalOptionalAbortSignal | undefinedCancellation signal propagated to the operation and its process group; reusable sandboxes remain usable.options.variablesOptionalReadonly<Record<string, string>> | undefinedOnly explicitly declared environment variables reach the sandbox; no implicit .env loading.options.workspaceVariant-dependentFileWorkspace | undefinedOpen workspace borrowed for this operation; its caller remains responsible for closing it.options.workspaceSourceVariant-dependentundefined | FileWorkspaceSourceDeclared source for an owned resource; mutually exclusive with borrowing an open workspace.options.runIdOptionalstring | undefinedObservation ID for a standalone dispatch using createObservation(); generated when omitted. With a transport, creation refuses duplicate IDs. Nested dispatches join their workflow projection. A continuation is a new dispatch and does not inherit this ID.options.watchdogOptionalWatchdogOptions | undefinedOpt-in repetition detection for decoded tool calls and file changes. Disabled when omitted; a stop rejects with code stuck, a warning continues, and an instruction uses steering. Replay agents reject this option.options.pricesOptionalModelPriceTable | undefinedOptional model rates. With them, usage is attributed by model name, including harness requests, to match the table; without them only CLI turns are attributed, under agent-scoped keys. Use calculateUsageCost on the result to display its estimate; no dispatch-level monetary limit is enforced.options.redactOptionalreadonly RegExp[] | undefinedRegular expressions replacing matching persisted and observed strings with [REDACTED]. Added to inherited hub rules; prompts sent to the agent and returned results stay intact.options.labelOptionalstring | undefinedName shown for this dispatch in progress reports.options.briefRequiredBriefTask given to the agent: literal text or a file brief.options.passesOptionalnumber | undefinedMaximum passes, default 1. Each pass reruns the brief in a new conversation and the dispatch stops at the first pass whose text contains a completion marker. Must be 1 with response or continuation.options.untilOptionalstring | readonly string[] | undefinedCompletion marker or markers searched in the last turn’s text, default <outpost>done</outpost>. An empty list disables matching, so every pass runs; empty strings are rejected.options.idleMsOptionalnumber | undefinedLongest silence allowed from the agent, default 600000 (10 minutes). Past it the turn stops with code timeout.options.idleWarningMsOptionalnumber | undefinedSilence after which a warning event is emitted, then repeated at the same interval; default 60000.options.settleMsOptionalnumber | undefinedWait after a completion marker before stopping an agent that is still running, default 60000. The turn still succeeds.options.deadlineMsOptionalnumber | undefinedMaximum duration of each agent process, default 3600000 (one hour). Past it the turn fails with code timeout.options.expansionMsOptionalnumber | undefinedDeadline for each shell expansion in a file brief, default 30000. Past it the dispatch fails with code timeout.options.steeringOptionalSteering | undefinedController from createSteering(), attached for the whole dispatch and released when it ends. resume() and fork() do not reuse it.options.continuationOptional{ readonly id: string; readonly fork?: boolean; } | undefinedNative conversation to continue, by id; fork: true continues a copy and leaves the original unchanged. Requires one pass and an agent that supports resume.options.responseOptionalResponseSpec<T> | undefinedTyped response contract: appends final-answer format instructions and the JSON input schema after the rendered brief and steering messages included at turn start. Parses and validates the tagged answer, with up to repairs correction turns. Requires one pass; injection cannot be disabled.options.telemetryOptionalDispatchTelemetry | undefinedInstrumentation spanning the whole dispatch, including preparation, synchronization and cleanup. Its failures do not change the outcome.options.observeOptional((event: AgentObservation) => void) | undefinedReceives each normalized agent event with its pass number and timestamp. An exception thrown here is collected in observerErrors and does not change the outcome.options.warnOptional((message: string) => void) | undefinedReceives nonfatal warnings, such as an idle agent or a conversation storage problem.options.diagnosticOptional((message: string) => void) | undefinedReceives diagnostic messages, such as the estimated token size of each expanded brief command.options.outputsOptionalreadonly WorkspaceOutputOptions[] | undefinedDeclared protected publications performed only after successful work and sandbox closure.options.recoveryVariant-dependentFileWorkspaceRecoveryAuthorization | undefinedExplicit stopped-process recovery authorization; interrupted replay remains a separate workflow decision.options.storageQuotaVariant-dependentOmit<StorageReservationOptions, "signal"> | undefinedAdmission reservation through Transport; coordinates cooperating writers without enforcing a physical disk quota.options.inputsVariant-dependentreadonly WorkspaceInput[] | undefinedExplicit file inputs; JSON workflow parameters are never implicitly written to disk.options.runtimeVariant-dependentWorkspaceRuntimeOptions | undefinedControl directory and logical namespace, separate from the workspace files.options.pathsVariant-dependentreadonly string[] | undefinedExplicit relative path selection; copy selection does not implicitly apply .gitignore.options.retentionVariant-dependentWorkspaceRetention | undefinedrun cleans successful owned work, local retains it, portable additionally requires an explicit Transport and namespace.
Variant 2 — GitDispatchRequest<T>
Section titled “Variant 2 — GitDispatchRequest<T>”optionsRequiredGitDispatchRequest<T>Sandbox settings (repository, branch, provider, hooks) combined with the agent, brief, response contract and limits.options.workspaceSourceRequiredGitWorkspaceSourceDeclared source for an owned resource; mutually exclusive with borrowing an open workspace.options.workspaceOptionalundefinedForbidden with workspaceSource; declare Git settings inside the single source instead.options.repositoryOptionalundefinedForbidden with workspaceSource; declare Git settings inside the single source instead.options.branchOptionalundefinedForbidden with workspaceSource; declare Git settings inside the single source instead.options.copiesOptionalundefinedForbidden with workspaceSource; declare Git settings inside the single source instead.options.guardOptionalundefinedForbidden with workspaceSource; declare Git settings inside the single source instead.options.signalOptionalAbortSignal | undefinedAborting it stops the agent process and rejects the dispatch with the signal’s reason.options.agentRequiredCliAgent | CustomAgent | ReplayAgent | FallbackAgentDefault agent for dispatch(), resume(), fork() and attach() on this sandbox; an operation’s own agent replaces it. On a remote provider with bootstrap on, its first candidate is installed during allocation; attach() rejects a fallback agent on every provider.options.hooksOptionalLifecycleHooks | undefinedSetup commands, each required to exit 0 within its deadlineMs, default 600000 (10 minutes): workspaceReady on the host once a new worktree exists, then hostReady (host, in order) and sandboxReady (sandbox, all at once) concurrently; a nonzero exit fails setup with code process. With a supplied workspace, workspaceReady does not run and hooks given here replace the workspace’s hostReady and sandboxReady. With when: changed(files), checked again before each warm command, dispatch or attachment; successful fingerprints are scoped to this sandbox.options.storageQuotaOptionalOmit<StorageReservationOptions, "signal"> | undefinedStorage admission checked before the workspace opens: reserves reserveBytes and fails with code configuration when usage under .outpost plus active reservations would exceed maxBytes. The reservation is released when the workspace closes.options.includeUncommittedOptionalboolean | undefinedRemote providers only: also send the managed worktree’s uncommitted changes and untracked, non-ignored files, default false. Without it, synchronization fails with code workspace when the sandbox touches one of those files, which includes any copies entry not ignored by a committed .gitignore.options.sandboxProviderOptionalSandboxProvider | undefinedProvider that allocates the environment, default createDockerSandboxProvider(). A remote provider requires a named or integrate branch and defaults branch to integrate.options.loggingOptionalLogging | undefinedJournal settings: transport, verbose event retention and commit recording for replay.options.bootstrapOptionalboolean | undefinedInstall a built-in CLI agent missing from a remote sandbox, at its pinned version, before its first use; default true. Mounted and host providers never install: the CLI must be in the image or on the host.options.conversationHomeOptionalstring | undefinedHost directory used in place of your home directory to store and find captured native conversations. Default: your home directory for Claude and Codex transcripts, the repository for Copilot and Kimi session bundles.options.recoveryTransportOptionalTransport | undefinedRemote providers only: before pulled changes are applied, archive the host backup to this transport as well as to .outpost/recovery. Archives outlive the sandbox.options.activityTransportOptionalTransport | undefinedTransport for this sandbox’s resource activity record, default local storage under .outpost/storage. The record is deleted after a clean close and kept with a failure phase when cleanup fails.options.observationOptionalObservationHub | undefinedParent observation hub. The dispatch opens a child hub with its own dispatchId and drains it before returning or throwing.options.limitsOptionalStageLimits | undefinedDeadlines in milliseconds for copying, Git preparation, commit collection and integration. Past a deadline the stage fails with code timeout, or conflict for integration. collectMs also bounds each Git command inspecting a diff guard; incomplete inspection fails with code guard.options.labelOptionalstring | undefinedName shown for this dispatch in progress reports.options.runIdOptionalstring | undefinedObservation ID for a standalone dispatch using createObservation(); generated when omitted. With a transport, creation refuses duplicate IDs. Nested dispatches join their workflow projection. A continuation is a new dispatch and does not inherit this ID.options.watchdogOptionalWatchdogOptions | undefinedOpt-in repetition detection for decoded tool calls and file changes. Disabled when omitted; a stop rejects with code stuck, a warning continues, and an instruction uses steering. Replay agents reject this option.options.pricesOptionalModelPriceTable | undefinedOptional model rates. With them, usage is attributed by model name, including harness requests, to match the table; without them only CLI turns are attributed, under agent-scoped keys. Use calculateUsageCost on the result to display its estimate; no dispatch-level monetary limit is enforced.options.redactOptionalreadonly RegExp[] | undefinedRegular expressions replacing matching persisted and observed strings with [REDACTED]. Added to inherited hub rules; prompts sent to the agent and returned results stay intact.options.briefRequiredBriefTask given to the agent: literal text or a file brief.options.passesOptionalnumber | undefinedMaximum passes, default 1. Each pass reruns the brief in a new conversation and the dispatch stops at the first pass whose text contains a completion marker. Must be 1 with response or continuation.options.untilOptionalstring | readonly string[] | undefinedCompletion marker or markers searched in the last turn’s text, default <outpost>done</outpost>. An empty list disables matching, so every pass runs; empty strings are rejected.options.idleMsOptionalnumber | undefinedLongest silence allowed from the agent, default 600000 (10 minutes). Past it the turn stops with code timeout.options.idleWarningMsOptionalnumber | undefinedSilence after which a warning event is emitted, then repeated at the same interval; default 60000.options.settleMsOptionalnumber | undefinedWait after a completion marker before stopping an agent that is still running, default 60000. The turn still succeeds.options.deadlineMsOptionalnumber | undefinedMaximum duration of each agent process, default 3600000 (one hour). Past it the turn fails with code timeout.options.expansionMsOptionalnumber | undefinedDeadline for each shell expansion in a file brief, default 30000. Past it the dispatch fails with code timeout.options.steeringOptionalSteering | undefinedController from createSteering(), attached for the whole dispatch and released when it ends. resume() and fork() do not reuse it.options.continuationOptional{ readonly id: string; readonly fork?: boolean; } | undefinedNative conversation to continue, by id; fork: true continues a copy and leaves the original unchanged. Requires one pass and an agent that supports resume.options.responseOptionalResponseSpec<T> | undefinedTyped response contract: appends final-answer format instructions and the JSON input schema after the rendered brief and steering messages included at turn start. Parses and validates the tagged answer, with up to repairs correction turns. Requires one pass; injection cannot be disabled.options.telemetryOptionalDispatchTelemetry | undefinedInstrumentation spanning the whole dispatch, including preparation, synchronization and cleanup. Its failures do not change the outcome.options.observeOptional((event: AgentObservation) => void) | undefinedReceives each normalized agent event with its pass number and timestamp. An exception thrown here is collected in observerErrors and does not change the outcome.options.warnOptional((message: string) => void) | undefinedReceives nonfatal warnings, such as an idle agent or a conversation storage problem.options.diagnosticOptional((message: string) => void) | undefinedReceives diagnostic messages, such as the estimated token size of each expanded brief command.
Variant 3 — DispatchRequest<T>
Section titled “Variant 3 — DispatchRequest<T>”optionsRequiredDispatchRequest<T>Sandbox settings (repository, branch, provider, hooks) combined with the agent, brief, response contract and limits.options.includeUncommittedOptionalboolean | undefinedRemote providers only: also send the managed worktree’s uncommitted changes and untracked, non-ignored files, default false. Without it, synchronization fails with code workspace when the sandbox touches one of those files, which includes any copies entry not ignored by a committed .gitignore.options.agentRequiredCliAgent | CustomAgent | ReplayAgent | FallbackAgentDefault agent for dispatch(), resume(), fork() and attach() on this sandbox; an operation’s own agent replaces it. On a remote provider with bootstrap on, its first candidate is installed during allocation; attach() rejects a fallback agent on every provider.options.sandboxProviderOptionalSandboxProvider | undefinedProvider that allocates the environment, default createDockerSandboxProvider(). A remote provider requires a named or integrate branch and defaults branch to integrate.options.workspaceOptionalWorkspace | undefinedOpen workspace to run in, from openWorkspace(); close() leaves it open. Combining it with repository, branch, guard, copies or storageQuota, or passing a workspace already bound to an open sandbox, fails with code configuration.options.hooksOptionalLifecycleHooks | undefinedSetup commands, each required to exit 0 within its deadlineMs, default 600000 (10 minutes): workspaceReady on the host once a new worktree exists, then hostReady (host, in order) and sandboxReady (sandbox, all at once) concurrently; a nonzero exit fails setup with code process. With a supplied workspace, workspaceReady does not run and hooks given here replace the workspace’s hostReady and sandboxReady. With when: changed(files), checked again before each warm command, dispatch or attachment; successful fingerprints are scoped to this sandbox.options.signalOptionalAbortSignal | undefinedAborting it cancels sandbox setup: allocation, repository seeding, agent installation and setup hooks. createSandbox() stops watching it once the sandbox is returned.options.loggingOptionalLogging | undefinedJournal of each dispatch on this sandbox, default a local journal under .outpost/storage; stdout prints progress instead, false disables it, and an object sets transporter, verbose and replayable. A dispatch’s own logging replaces it.options.bootstrapOptionalboolean | undefinedInstall a built-in CLI agent missing from a remote sandbox, at its pinned version, before its first use; default true. Mounted and host providers never install: the CLI must be in the image or on the host.options.conversationHomeOptionalstring | undefinedHost directory used in place of your home directory to store and find captured native conversations. Default: your home directory for Claude and Codex transcripts, the repository for Copilot and Kimi session bundles.options.recoveryTransportOptionalTransport | undefinedRemote providers only: before pulled changes are applied, archive the host backup to this transport as well as to .outpost/recovery. Archives outlive the sandbox.options.activityTransportOptionalTransport | undefinedTransport for this sandbox’s resource activity record, default local storage under .outpost/storage. The record is deleted after a clean close and kept with a failure phase when cleanup fails.options.guardOptionalDiffGuard | undefinedOptional committed-diff policy owned by this workspace and reused by every sandbox and agent. Requires named or integrate; current fails with code configuration before execution. Successful dispatches and terminal sessions check it after synchronization; integrate checks again under the merge lock. Refusal throws code guard and retains the branch and worktree when this workspace closes, even without preserve. Named workspaces compare their opening commit with the current commit across executions; integration workspaces compare the candidate with its unique merge base with the host, including inherited commits.options.observationOptionalObservationHub | undefinedHub that receives this workspace’s Git, copy, hook, integration and cleanup operations. The caller keeps ownership; the workspace never closes it.options.storageQuotaOptionalOmit<StorageReservationOptions, "signal"> | undefinedStorage admission checked before the workspace opens: reserves reserveBytes and fails with code configuration when usage under .outpost plus active reservations would exceed maxBytes. The reservation is released when the workspace closes.options.repositoryOptionalstring | undefinedPath inside the host Git checkout, default the process working directory. Outpost works from the checkout’s top-level directory; an unavailable directory fails with code workspace.options.branchOptionalBranchPolicy | undefinedBranch policy: current, named or integrate. Default { mode: “current” }; createSandbox() and dispatch() on a remote provider default to integrate.options.copiesOptionalreadonly string[] | undefinedRepository-relative files or directories copied from the host checkout into the new worktree before workspaceReady; missing entries are skipped. Requires named or integrate, and absolute, .. or .git paths fail with code configuration. An untracked or ignored copy keeps the worktree when it closes. On a remote provider without includeUncommitted, a copy not ignored by a committed .gitignore makes the first synchronization fail with code workspace.options.limitsOptionalStageLimits | undefinedDeadlines in milliseconds for copying, Git preparation, commit collection and integration. Past a deadline the stage fails with code timeout, or conflict for integration. collectMs also bounds each Git command inspecting a diff guard; incomplete inspection fails with code guard.options.labelOptionalstring | undefinedName used in the integrate branch (outpost/<label>-<id>), the worktree directory under .outpost/workspaces and the startup-failure journal; lowercased, other characters replaced by -, cut to 48.options.runIdOptionalstring | undefinedObservation ID for a standalone dispatch using createObservation(); generated when omitted. With a transport, creation refuses duplicate IDs. Nested dispatches join their workflow projection. A continuation is a new dispatch and does not inherit this ID.options.watchdogOptionalWatchdogOptions | undefinedOpt-in repetition detection for decoded tool calls and file changes. Disabled when omitted; a stop rejects with code stuck, a warning continues, and an instruction uses steering. Replay agents reject this option.options.pricesOptionalModelPriceTable | undefinedOptional model rates. With them, usage is attributed by model name, including harness requests, to match the table; without them only CLI turns are attributed, under agent-scoped keys. Use calculateUsageCost on the result to display its estimate; no dispatch-level monetary limit is enforced.options.redactOptionalreadonly RegExp[] | undefinedRegular expressions replacing matching persisted and observed strings with [REDACTED]. Added to inherited hub rules; prompts sent to the agent and returned results stay intact.options.briefRequiredBriefTask given to the agent: literal text or a file brief.options.passesOptionalnumber | undefinedMaximum passes, default 1. Each pass reruns the brief in a new conversation and the dispatch stops at the first pass whose text contains a completion marker. Must be 1 with response or continuation.options.untilOptionalstring | readonly string[] | undefinedCompletion marker or markers searched in the last turn’s text, default <outpost>done</outpost>. An empty list disables matching, so every pass runs; empty strings are rejected.options.idleMsOptionalnumber | undefinedLongest silence allowed from the agent, default 600000 (10 minutes). Past it the turn stops with code timeout.options.idleWarningMsOptionalnumber | undefinedSilence after which a warning event is emitted, then repeated at the same interval; default 60000.options.settleMsOptionalnumber | undefinedWait after a completion marker before stopping an agent that is still running, default 60000. The turn still succeeds.options.deadlineMsOptionalnumber | undefinedMaximum duration of each agent process, default 3600000 (one hour). Past it the turn fails with code timeout.options.expansionMsOptionalnumber | undefinedDeadline for each shell expansion in a file brief, default 30000. Past it the dispatch fails with code timeout.options.steeringOptionalSteering | undefinedController from createSteering(), attached for the whole dispatch and released when it ends. resume() and fork() do not reuse it.options.continuationOptional{ readonly id: string; readonly fork?: boolean; } | undefinedNative conversation to continue, by id; fork: true continues a copy and leaves the original unchanged. Requires one pass and an agent that supports resume.options.responseOptionalResponseSpec<T> | undefinedTyped response contract: appends final-answer format instructions and the JSON input schema after the rendered brief and steering messages included at turn start. Parses and validates the tagged answer, with up to repairs correction turns. Requires one pass; injection cannot be disabled.options.telemetryOptionalDispatchTelemetry | undefinedInstrumentation spanning the whole dispatch, including preparation, synchronization and cleanup. Its failures do not change the outcome.options.observeOptional((event: AgentObservation) => void) | undefinedReceives each normalized agent event with its pass number and timestamp. An exception thrown here is collected in observerErrors and does not change the outcome.options.warnOptional((message: string) => void) | undefinedReceives nonfatal warnings, such as an idle agent or a conversation storage problem.options.diagnosticOptional((message: string) => void) | undefinedReceives diagnostic messages, such as the estimated token size of each expanded brief command.
Returns
Section titled “Returns”Promise<FileDispatchResult<T>> · Promise<DispatchResult<T>>

