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”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.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.