The team announced the deal with the Bay Area native Thursday. Willis had been designated for assignment by the Arizona Diamondbacks earlier this month. In six games with Arizona, Willis was 1-1 with a 6.85 ERA and 27 walks in 22 1/3 innings.
Willis was traded from the Detroit Tigers to Arizona in June. The Tigers are still paying the bulk of his $12 million salary.
Willis won the NL Rookie of the Year in 2003, made two All-Star teams and won 22 games one season for the Florida Marlins. He helped the Marlins win the World Series in 2003. But he is 13-24 with a 5.81 ERA since the start of the 2007 season.