huskies: merge 855
This commit is contained in:
@@ -45,6 +45,48 @@ impl AgentPool {
|
||||
agent_name: Option<&str>,
|
||||
resume_context: Option<&str>,
|
||||
session_id_to_resume: Option<String>,
|
||||
) -> Result<AgentInfo, String> {
|
||||
self.start_agent_inner(
|
||||
project_root,
|
||||
story_id,
|
||||
agent_name,
|
||||
resume_context,
|
||||
session_id_to_resume,
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
||||
/// Start an agent with an `AppContext` for direct MCP tool dispatch.
|
||||
///
|
||||
/// API-based runtimes (Gemini, OpenAI) need the `AppContext` to invoke MCP
|
||||
/// tools without an HTTP round-trip. CLI-based runtimes (Claude Code) do not.
|
||||
pub fn start_agent_with_ctx(
|
||||
&self,
|
||||
project_root: &Path,
|
||||
story_id: &str,
|
||||
agent_name: Option<&str>,
|
||||
resume_context: Option<&str>,
|
||||
session_id_to_resume: Option<String>,
|
||||
app_ctx: Arc<crate::http::context::AppContext>,
|
||||
) -> Result<AgentInfo, String> {
|
||||
self.start_agent_inner(
|
||||
project_root,
|
||||
story_id,
|
||||
agent_name,
|
||||
resume_context,
|
||||
session_id_to_resume,
|
||||
Some(app_ctx),
|
||||
)
|
||||
}
|
||||
|
||||
fn start_agent_inner(
|
||||
&self,
|
||||
project_root: &Path,
|
||||
story_id: &str,
|
||||
agent_name: Option<&str>,
|
||||
resume_context: Option<&str>,
|
||||
session_id_to_resume: Option<String>,
|
||||
app_ctx: Option<Arc<crate::http::context::AppContext>>,
|
||||
) -> Result<AgentInfo, String> {
|
||||
let config = ProjectConfig::load(project_root)?;
|
||||
|
||||
@@ -352,6 +394,7 @@ impl AgentPool {
|
||||
self.watcher_tx.clone(),
|
||||
inactivity_timeout_secs,
|
||||
prior_events,
|
||||
app_ctx,
|
||||
));
|
||||
|
||||
// Store the task handle while the agent is still Pending.
|
||||
|
||||
Reference in New Issue
Block a user