@@ -224,15 +224,56 @@ execute_task() {
224224 local agent_type
225225 agent_type=$( jq -r " .tasks[\" $task_id \" ].agent_type // \" general\" " " $TASKS_META_FILE " )
226226
227- # For now, use simple context and requirements
228- local task_context=" Files: $task_files "
229- local task_requirements=" Complete the task according to specifications"
230- local execution_instructions=" Execute the task and provide detailed results"
231-
232- if dispatch_async_task " $task_id " " $agent_type " " $task_description " " $task_context " " $task_requirements " " $execution_instructions " " $FEATURE_DIR " ; then
233- log_success " ASYNC task $task_id dispatched successfully"
227+ # Check if using local orchestrator (agentic-sdlc-orchestrator)
228+ if [[ " $agent_type " == " agentic-sdlc-orchestrator" ]]; then
229+ # Use local K8s orchestrator
230+ log_info " Spawning K8s pod via agentic-sdlc-orchestrator for task $task_id "
231+
232+ # Get repository info
233+ local repo_url
234+ repo_url=$( git remote get-url origin 2> /dev/null || echo " " )
235+ local branch_name
236+ branch_name=$( git rev-parse --abbrev-ref HEAD 2> /dev/null || echo " main" )
237+
238+ # Call the orchestrator script if available
239+ if command -v agentic-sdlc-orchestrator & > /dev/null; then
240+ agentic-sdlc-orchestrator spawn \
241+ --task-id " $task_id " \
242+ --branch " specs/$( basename " $FEATURE_DIR " ) /${task_id} -async" \
243+ --repo " $repo_url " \
244+ --context-dir " $FEATURE_DIR "
245+
246+ if [[ $? -eq 0 ]]; then
247+ log_success " K8s pod spawned for task $task_id "
248+ safe_json_update " $TASKS_META_FILE " --arg task_id " $task_id " ' .tasks[$task_id].status = "running"'
249+ else
250+ handle_task_failure " $task_id " " Failed to spawn K8s pod"
251+ fi
252+ else
253+ log_warn " agentic-sdlc-orchestrator not installed. Install with: pip install agentic-sdlc-orchestrator"
254+ log_info " Falling back to standard async delegation"
255+ # Fall back to standard dispatch_async_task
256+ local task_context=" Files: $task_files "
257+ local task_requirements=" Complete the task according to specifications"
258+ local execution_instructions=" Execute the task and provide detailed results"
259+
260+ if dispatch_async_task " $task_id " " $agent_type " " $task_description " " $task_context " " $task_requirements " " $execution_instructions " " $FEATURE_DIR " ; then
261+ log_success " ASYNC task $task_id dispatched successfully"
262+ else
263+ handle_task_failure " $task_id " " Failed to dispatch ASYNC task"
264+ fi
265+ fi
234266 else
235- handle_task_failure " $task_id " " Failed to dispatch ASYNC task"
267+ # Standard async delegation (MCP agents like jules, async-copilot, async-codex)
268+ local task_context=" Files: $task_files "
269+ local task_requirements=" Complete the task according to specifications"
270+ local execution_instructions=" Execute the task and provide detailed results"
271+
272+ if dispatch_async_task " $task_id " " $agent_type " " $task_description " " $task_context " " $task_requirements " " $execution_instructions " " $FEATURE_DIR " ; then
273+ log_success " ASYNC task $task_id dispatched successfully"
274+ else
275+ handle_task_failure " $task_id " " Failed to dispatch ASYNC task"
276+ fi
236277 fi
237278 else
238279 # Execute SYNC task (would normally involve AI agent execution)
0 commit comments