Creates and configures a TaskBuilder with all shared fields. Pass `Some(agent)` to set a specific agent, or `None` to let TaskBuilder resolve via project config / default fallback. Callers should add command-specific settings (e.g., `parent_id`, `with_interactive`) before calling `.build()`.
(
&self,
repo_root: PathBuf,
name: String,
agent: Option<String>,
prompt: Option<String>,
)
| 111 | /// Callers should add command-specific settings (e.g., `parent_id`, |
| 112 | /// `with_interactive`) before calling `.build()`. |
| 113 | pub fn configure_builder( |
| 114 | &self, |
| 115 | repo_root: PathBuf, |
| 116 | name: String, |
| 117 | agent: Option<String>, |
| 118 | prompt: Option<String>, |
| 119 | ) -> TaskBuilder { |
| 120 | let worktree_source = self.resolve_worktree_source().unwrap_or_else(|e| { |
| 121 | eprintln!("Warning: failed to detect worktree: {e}"); |
| 122 | None |
| 123 | }); |
| 124 | TaskBuilder::new() |
| 125 | .repo_root(repo_root) |
| 126 | .name(name) |
| 127 | .task_type(self.r#type.clone()) |
| 128 | .prompt(prompt) |
| 129 | .prompt_file(self.prompt_file.as_ref().map(PathBuf::from)) |
| 130 | .edit(self.edit) |
| 131 | .agent(agent) |
| 132 | .stack(self.stack.clone()) |
| 133 | .project(self.project.clone()) |
| 134 | .network_isolation(!self.no_network_isolation) |
| 135 | .dind(if self.dind { Some(true) } else { None }) |
| 136 | .repo_copy_source(worktree_source) |
| 137 | .privileged(if self.privileged { Some(true) } else { None }) |
| 138 | .sudo(if self.sudo { Some(true) } else { None }) |
| 139 | .devices(self.devices.clone()) |
| 140 | .branch(self.branch.clone()) |
| 141 | } |
| 142 | } |
no test coverage detected