huskies: merge 626_refactor_introduce_services_bundle_and_migrate_appcontext_matrix_transport

This commit is contained in:
dave
2026-04-25 15:08:46 +00:00
parent aeff0b55be
commit 4b089c1ed8
21 changed files with 403 additions and 339 deletions
+8 -5
View File
@@ -21,13 +21,14 @@ pub(super) async fn tool_request_qa(args: &Value, ctx: &AppContext) -> Result<St
.and_then(|v| v.as_str())
.unwrap_or("qa");
let project_root = ctx.agents.get_project_root(&ctx.state)?;
let project_root = ctx.services.agents.get_project_root(&ctx.state)?;
// Move story from work/2_current/ to work/3_qa/
move_story_to_qa(&project_root, story_id)?;
// Start the QA agent on the story worktree
let info = ctx
.services
.agents
.start_agent(&project_root, story_id, Some(agent_name), None, None)
.await?;
@@ -51,7 +52,7 @@ pub(super) async fn tool_approve_qa(args: &Value, ctx: &AppContext) -> Result<St
.and_then(|v| v.as_str())
.ok_or("Missing required argument: story_id")?;
let project_root = ctx.agents.get_project_root(&ctx.state)?;
let project_root = ctx.services.agents.get_project_root(&ctx.state)?;
// Clear review_hold before moving
let qa_path = project_root
@@ -76,7 +77,7 @@ pub(super) async fn tool_approve_qa(args: &Value, ctx: &AppContext) -> Result<St
move_story_to_done(&project_root, story_id)?;
let pool = std::sync::Arc::clone(&ctx.agents);
let pool = std::sync::Arc::clone(&ctx.services.agents);
pool.remove_agents_for_story(story_id);
let wt_path = crate::worktree::worktree_path(&project_root, story_id);
@@ -102,6 +103,7 @@ pub(super) async fn tool_approve_qa(args: &Value, ctx: &AppContext) -> Result<St
// Start the mergemaster agent
let info = ctx
.services
.agents
.start_agent(&project_root, story_id, Some("mergemaster"), None, None)
.await?;
@@ -129,7 +131,7 @@ pub(super) async fn tool_reject_qa(args: &Value, ctx: &AppContext) -> Result<Str
.and_then(|v| v.as_str())
.ok_or("Missing required argument: notes")?;
let project_root = ctx.agents.get_project_root(&ctx.state)?;
let project_root = ctx.services.agents.get_project_root(&ctx.state)?;
// Move story from work/3_qa/ back to work/2_current/ with rejection notes
reject_story_from_qa(&project_root, story_id, notes)?;
@@ -155,6 +157,7 @@ pub(super) async fn tool_reject_qa(args: &Value, ctx: &AppContext) -> Result<Str
Please fix the issues described above and try again."
);
if let Err(e) = ctx
.services
.agents
.start_agent(
&project_root,
@@ -179,7 +182,7 @@ pub(super) async fn tool_launch_qa_app(args: &Value, ctx: &AppContext) -> Result
.and_then(|v| v.as_str())
.ok_or("Missing required argument: story_id")?;
let project_root = ctx.agents.get_project_root(&ctx.state)?;
let project_root = ctx.services.agents.get_project_root(&ctx.state)?;
// Find the worktree path for this story
let worktrees = crate::worktree::list_worktrees(&project_root)?;