defineInteractiveAgentTask
Purpose and behavior
Section titled “Purpose and behavior”Declare an agent dialogue that asks humans questions between turns. Each turn runs in a new sandbox on a retained named branch and continues the captured conversation; a question leaves the task waiting-input until start() receives an answer. Requires a checkpointed run and throws with code configuration for an agent without portable capture and resume.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”Variant 1 — InteractiveAgentTaskOptions
Section titled “Variant 1 — InteractiveAgentTaskOptions”optionsRequiredInteractiveAgentTaskOptionsAgent, repository, authorized respondents and bounded dialogue settings.options.keyRequiredstringStable workflow task key; also participates in the retained branch identity.options.afterOptionalreadonly Task<unknown>[] | undefinedDependencies that must finish successfully before the first turn.options.repositoryRequiredstringHost Git checkout containing the retained worktree and default conversation storage; must remain accessible on resume.options.agentRequiredAgentAgent with portable conversation capture and resume; otherwise defineInteractiveAgentTask() throws with code configuration.options.briefRequiredstringLiteral initial instructions; human replies are supplied separately on subsequent turns. Exact injected text and customization limits.options.actorsRequiredreadonly string[]Nonempty unique identifiers allowed to answer; the application must authenticate their users.options.sandboxProviderOptionalSandboxProvider | undefinedProvider that allocates a new sandbox for each turn, default createDockerSandboxProvider().options.bootstrapOptionalboolean | undefinedWhether each turn’s sandbox may install a missing CLI agent, default true.options.conversationHomeOptionalstring | undefinedHost home used to locate captured native conversations across turns.options.maxTurnsOptionalnumber | undefinedMaximum completed agent turns, including the final result; defaults to 12. A question at the last turn fails instead of waiting indefinitely.options.timeoutMsOptionalnumber | undefinedCooperative deadline for each executing task attempt, excluding time waiting for a human answer.
Variant 2 — FileInteractiveAgentTaskOptions
Section titled “Variant 2 — FileInteractiveAgentTaskOptions”optionsRequiredFileInteractiveAgentTaskOptionsAgent, repository, authorized respondents and bounded dialogue settings.options.workspaceSourceRequiredFileWorkspaceSourceDeclared source for an owned resource; mutually exclusive with borrowing an open workspace.options.sandboxProviderRequiredSandboxProviderExecution provider with the required file binding capability; legacy providers remain usable for Git.options.agentRequiredAgentAgent with portable conversation capture and resume; otherwise defineInteractiveAgentTask() throws with code configuration.options.keyRequiredstringStable workflow task key; also participates in the retained branch identity.options.afterOptionalreadonly Task<unknown>[] | undefinedDependencies that must finish successfully before the first turn.options.timeoutMsOptionalnumber | undefinedCooperative deadline for each executing task attempt, excluding time waiting for a human answer.options.briefRequiredstringLiteral initial instructions; human replies are supplied separately on subsequent turns. Exact injected text and customization limits.options.actorsRequiredreadonly string[]Nonempty unique identifiers allowed to answer; the application must authenticate their users.options.maxTurnsOptionalnumber | undefinedMaximum completed agent turns, including the final result; defaults to 12. A question at the last turn fails instead of waiting indefinitely.options.signalOptionalAbortSignal | undefinedCancellation signal propagated to the operation and its process group; reusable sandboxes remain usable.options.hooksOptionalLifecycleHooks | undefinedDeclared workspaceReady, hostReady and sandboxReady preparation commands.options.recoveryOptionalFileWorkspaceRecoveryAuthorization | undefinedExplicit stopped-process recovery authorization; interrupted replay remains a separate workflow decision.options.storageQuotaOptionalOmit<StorageReservationOptions, "signal"> | undefinedAdmission reservation through Transport; coordinates cooperating writers without enforcing a physical disk quota.options.inputsOptionalreadonly WorkspaceInput[] | undefinedExplicit file inputs; JSON workflow parameters are never implicitly written to disk.options.runtimeOptionalWorkspaceRuntimeOptions | undefinedControl directory and logical namespace, separate from the workspace files.options.pathsOptionalreadonly string[] | undefinedExplicit relative path selection; copy selection does not implicitly apply .gitignore.options.retentionOptionalWorkspaceRetention | undefinedrun cleans successful owned work, local retains it, portable additionally requires an explicit Transport and namespace.
Instructions added by Outpost
Section titled “Instructions added by Outpost”Templates below preserve the English text sent to the model. ${…} marks runtime substitutions, not brief template syntax.
Every Git or file workspace dialogue turn appends this protocol after the initial brief, the latest human answer or the quota-resume instruction:
After a human answer, the input preceding the protocol is:
answerJSON is JSON.stringify(interaction.answer.value). After a quota interruption, the fixed quota-resume instruction replaces this input.
Dispatch also appends the final-answer format instructions, using tag: "interaction", format: "json" and the following input schema. The internal response contract allows one repair attempt.
The protocol, answer prefix, schema and repair count are fixed. brief supplies the task goal; it does not replace the protocol. There is no dedicated override for these instructions.
Implementation: interactive-task.constants.ts · interactive-task-execution.ts · file-interactive-task.ts.
Returns
Section titled “Returns”Task<InteractiveAgentResult> · Task<FileInteractiveAgentResult>

