In 2006, the Supreme Court ruled in Hamdan v. Rumsfeld that Bush’s military commissions violated the Geneva Conventions and the Uniform Code of Military Justice. As a result of that decision, the Bush administration asked Congress to pass legislation on military commissions. They passed the Military Commissions Act, which was struck down later.
From 2006-2008, Congress was giving the Bush administration nearly everything they wanted. They got their very own courts to try detainees and their very own spying program complete with immunity, even while the administration was suspected of holding detainees in secret CIA black sites.
Enter Dick Cheney.